From 9d75b810c828b5836aee5284253c9ca7ebbdc2b4 Mon Sep 17 00:00:00 2001 From: hummypkg Date: Wed, 30 Jan 2013 23:48:37 +0000 Subject: [PATCH] safe delete library git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1381 2a923420-c742-0410-a762-8d5b09965624 --- CONTROL/control | 2 +- CONTROL/postinst | 2 + var/mongoose/cgi-bin/browse/delete.jim | 74 ++-------------------- var/mongoose/lib/bin/auto | 2 +- var/mongoose/lib/safe_delete | 85 ++++++++++++++++++++++++++ 5 files changed, 93 insertions(+), 72 deletions(-) create mode 100755 var/mongoose/lib/safe_delete diff --git a/CONTROL/control b/CONTROL/control index bc126b9..f8e3ddd 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,7 +1,7 @@ Package: webif Priority: optional Section: web -Version: 0.11.0-3 +Version: 0.11.0-4 Architecture: mipsel Maintainer: af123@hummypkg.org.uk Depends: webif-channelicons(>=1.0.4-1),mongoose(>=3.0-7),jim(>=0.73-1),jim-oo,jim-sqlite3(>=0.73-1),jim-cgi(>=0.6),jim-binary,service-control(>=1.2),busybox(>=1.20.2-1),lsof,epg(>=1.0.9-1),hmt(>=1.1.10),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2),stripts(>=1.1.2),smartmontools,tmenu(>=1.05) diff --git a/CONTROL/postinst b/CONTROL/postinst index cde602e..d5718ab 100755 --- a/CONTROL/postinst +++ b/CONTROL/postinst @@ -25,5 +25,7 @@ grep -v 'backup/backup.jim' $ana > $tmpf $PKG_ROOT/etc/init.d/S02anacron start < /dev/null > /dev/null 2>&1 & +[ -f /tmp/webif_auto.log ] && rm -f /tmp/webif_auto.log + exit 0 diff --git a/var/mongoose/cgi-bin/browse/delete.jim b/var/mongoose/cgi-bin/browse/delete.jim index 8a990fe..f84164f 100755 --- a/var/mongoose/cgi-bin/browse/delete.jim +++ b/var/mongoose/cgi-bin/browse/delete.jim @@ -2,7 +2,7 @@ package require cgi source /mod/webif/lib/setup -require ts.class pretty_size system.class tdelete +require safe_delete puts "Content-Type: text/html\r\n" @@ -13,30 +13,10 @@ set dir [cgi_get dir] #puts "DIR: ($dir)" -if {[system pkginst undelete]} { - set dustbin [system dustbin] -} else { - set dustbin "" -} - -proc bindir {file} { - global dustbin - set dir [file dirname $file] - regsub "^[system mediaroot]" $dir $dustbin ndir - if {$dir eq $ndir} { set ndir $dustbin } - system mkdir_p $ndir - return $ndir -} - -proc touch {file} { - exec /mod/bin/busybox/touch $file -} - puts "
Deleting...
" puts "