diff --git a/CONTROL/control b/CONTROL/control index 5ae6047..36135f8 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,7 +1,7 @@ Package: webif Priority: optional Section: web -Version: 1.0.14-9 +Version: 1.0.14-10 Architecture: mipsel Maintainer: af123@hummypkg.org.uk Depends: webif-channelicons(>=1.1.11),lighttpd(>=1.4.35-2),jim(>=0.75-1),jim-oo,jim-sqlite3(>=0.75),jim-cgi(>=0.7),jim-binary(>=0.75),service-control(>=1.2),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.0.13),hmt(>=1.1.19),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2-1),stripts(>=1.2.5-3),smartmontools,tmenu(>=1.08),ffmpeg,id3v2,multienv(>=1.6),mongoose diff --git a/webif/lib/bin/auto b/webif/lib/bin/auto index 2a92cc0..3b85038 100755 --- a/webif/lib/bin/auto +++ b/webif/lib/bin/auto @@ -1,7 +1,7 @@ #!/mod/bin/jimsh source /mod/webif/lib/setup -require lock system.class ts.class tdelete pretty_size browse.class \ +require lock system.class ts.class pretty_size browse.class \ safe_delete settings.class plugin set settings [settings] @@ -125,7 +125,7 @@ if {![file exists $tmp]} { } # Clean-up the temporary directory -foreach file [readdir -nocomplain $tmp] { tdelete "$tmp/$file" } +foreach file [readdir -nocomplain $tmp] { file tdelete "$tmp/$file" } if {[system pkginst undelete]} { set dustbin "[system dustbin]" @@ -357,7 +357,7 @@ proc do_decrypt {ts} { } } } else { - tdelete "$rfile.encrypted" + file tdelete "$rfile.encrypted" } log "Done... [endclock $size]" 0 file delete $flagfile diff --git a/webif/lib/fileops b/webif/lib/fileops index 6f181e5..77eef1e 100644 --- a/webif/lib/fileops +++ b/webif/lib/fileops @@ -55,11 +55,23 @@ proc {file touch} {target {ref ""}} { } } +proc {file tdelete} {target} { + if {[file isdirectory $target]} { + foreach f [readdir -nocomplain $target] { + file tdelete "$target/$f" + } + exec /mod/bin/busybox/rm -rf $target + } else { + exec /mod/bin/trm $target + } +} + local proc file {cmd args} { switch $cmd { "rename" { tailcall {file rename} {*}$args } "copy" { tailcall {file copy} {*}$args } "touch" { tailcall {file touch} {*}$args } + "tdelete" { tailcall {file tdelete} {*}$args } default { tailcall upcall file $cmd {*}$args } } } diff --git a/webif/lib/safe_delete b/webif/lib/safe_delete index a94c322..0265bd3 100755 --- a/webif/lib/safe_delete +++ b/webif/lib/safe_delete @@ -2,7 +2,7 @@ if {![exists -proc _del_bindir]} { source /mod/webif/lib/setup - require ts.class system.class tdelete + require ts.class system.class if {[system pkginst undelete]} { set _del_dustbin [system dustbin] @@ -48,7 +48,7 @@ if {![exists -proc _del_bindir]} { file rename $file $ndir _del_touch $ndir } else { - tdelete $file + file tdelete $file } return 1 } @@ -78,7 +78,7 @@ if {![exists -proc _del_bindir]} { file rename $file $nfile _del_touch $nfile } else { - tdelete $file + file tdelete $file } catch {file delete "[file rootname $file].hmi"} return 1 diff --git a/webif/lib/tdelete b/webif/lib/tdelete index 245f4ec..e2fa979 100644 --- a/webif/lib/tdelete +++ b/webif/lib/tdelete @@ -1,19 +1,7 @@ -if {![exists -proc tdelete]} { - proc tdelete {path} { - if {[file isdirectory $path]} { - regsub -all {([\\["$])} $path {\\\1} cpath - foreach file [glob -nocomplain "${cpath}/*"] { - if {[file isdirectory $file]} { - tdelete $file - } else { - exec /mod/bin/trm $file - } - } - exec /mod/bin/busybox/rm -rf $path - } else { - exec /mod/bin/trm $path - } - } +# Deprecated - just use {file tdelete} + +if {![exists -alias tdelete]} { + alias tdelete {file tdelete} } diff --git a/webif/lib/ts.class b/webif/lib/ts.class index 72377e7..7905727 100644 --- a/webif/lib/ts.class +++ b/webif/lib/ts.class @@ -2,7 +2,7 @@ if {![exists -proc class]} { package require oo } if {![exists -proc pack]} { package require pack } source /mod/webif/lib/setup -require tdelete system.class +require system.class set dmsfile /mnt/hd2/dms_cds.db @@ -164,7 +164,7 @@ proc {ts fetch} {file {checked 0}} { ts method delete {} { foreach f [$self fileset] { - tdelete $f + file tdelete $f puts "Removed $f
" } return 1 @@ -287,7 +287,7 @@ ts method mkthm {{offset 0}} { } exec /bin/echo -n " " >> $bfile.thm~ file rename -force $bfile.thm~ $bfile.thm - tdelete $bfile.bmp + file tdelete $bfile.bmp return 1 }