finish recursive handling

git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1358 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg 2013-01-18 19:24:50 +00:00
parent f550931f71
commit d649456cfe
2 changed files with 30 additions and 10 deletions

View File

@ -553,10 +553,18 @@ var dmenuclick = function(action, el, pos)
flagdir(file, 'autoshrink', iconset, results, el);
break;
case 'shrinkr':
flagdir(file, 'autoshrinkr', iconset, results, el);
break;
case 'decrypt':
flagdir(file, 'autodecrypt', iconset, results, el);
break;
case 'decryptr':
flagdir(file, 'autodecryptr', iconset, results, el);
break;
case 'resetnew':
var url = '/cgi-bin/browse/resetnew.jim?dir=' + file;
$.get(url, function() { window.location.reload(true); });

View File

@ -3,6 +3,8 @@
source /mod/webif/lib/setup
require lock system.class ts.class tdelete
set testing 0
proc dsc {} {
lassign [system diskspace] x x perc
if {$perc > 90} {
@ -47,10 +49,13 @@ proc bindir {file binroot} {
}
proc dedup {dir} {
#puts "DEDUP: \[$dir]"
if {$::testing} {
puts "DEDUP: \[$dir]"
} else {
puts [exec /mod/webif/html/dedup/dedup -yes $dir]
exec /mod/webif/html/dedup/dedup -yes $dir
}
}
proc do_shrink {ts} {
global tmp dustbin tsgroup
@ -223,32 +228,39 @@ proc entries {dir callback} {
proc shrink {dir} {
puts "SHRINK: \[$dir]"
entries $dir do_shrink
if {!$::testing} { entries $dir do_shrink }
}
proc decrypt {dir} {
puts "DECRYPT: \[$dir]"
entries $dir do_decrypt
if {!$::testing} { entries $dir do_decrypt }
}
proc mpg {dir} {
puts "MPG: \[$dir]"
entries $dir do_mpg
if {!$::testing} { entries $dir do_mpg }
}
proc scan {dir attr} {{indent 0}} {
proc scan {dir attr {force 0}} {{indent 0}} {
incr indent 2
#puts "[string repeat " " $indent]\[$dir]"
if {$::testing} { puts "[string repeat " " $indent]\[$dir]" }
if {[string match {\[*} $dir]} continue
dsc
if {[file exists "$dir/.auto$attr"]} { $attr $dir }
# Recursion
if {[file exists "$dir/.auto${attr}r"]} {
if {$::testing} { puts "[string repeat " " $indent] (R)" }
set force 1
}
if {$force || [file exists "$dir/.auto$attr"]} { $attr $dir }
foreach entry [readdir -nocomplain $dir] {
if {[file isdirectory "$dir/$entry"]} {
scan "$dir/$entry" $attr
scan "$dir/$entry" $attr $force
}
}