2013-03-05 00:10:38 +00:00
|
|
|
#!/mod/bin/jimsh
|
|
|
|
|
|
|
|
source /mod/webif/lib/setup
|
|
|
|
require system.class ts.class
|
|
|
|
|
2014-04-03 20:21:40 +00:00
|
|
|
ts iterate [lambda {ts} {
|
|
|
|
#puts " [$ts get file]"
|
2013-03-05 00:10:38 +00:00
|
|
|
if {[$ts flag "Shrunk"]} { return }
|
|
|
|
|
|
|
|
set file [file rootname [$ts get file]]
|
|
|
|
|
|
|
|
if {[$ts inuse]} { return }
|
|
|
|
|
|
|
|
if {[catch {
|
|
|
|
set perc [exec /mod/bin/stripts -aq $file]
|
|
|
|
} msg]} {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
if {[string match {*%} $perc]} {
|
|
|
|
set perc [string range $perc 0 end-1]
|
|
|
|
} else {
|
|
|
|
set perc 0
|
|
|
|
}
|
|
|
|
|
|
|
|
if {$perc == 0} {
|
|
|
|
puts " Flagging $file as shrunk..."
|
|
|
|
$ts set_shrunk
|
|
|
|
}
|
2014-04-03 20:21:40 +00:00
|
|
|
}] 1
|
2013-03-05 00:10:38 +00:00
|
|
|
|