fix sorting of backups

git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@553 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg 2011-12-09 10:57:13 +00:00
parent a189b524ab
commit b6ce0e3b16
2 changed files with 13 additions and 2 deletions

View File

@ -1,7 +1,7 @@
Package: webif Package: webif
Priority: optional Priority: optional
Section: web Section: web
Version: 0.8.4 Version: 0.8.4-1
Architecture: mipsel Architecture: mipsel
Maintainer: af123@hummypkg.org.uk Maintainer: af123@hummypkg.org.uk
Depends: mongoose(>=3.0-2),jim(>=0.71-1),jim-sqlite3(>=0.71-1),jim-cgi(>=0.4-1),jim-oo,jim-pack,service-control,busybox(>=1.19.3-1),lsof,epg(>=1.0.8),hmt(>=1.1.1),ssmtp,anacron Depends: mongoose(>=3.0-2),jim(>=0.71-1),jim-sqlite3(>=0.71-1),jim-cgi(>=0.4-1),jim-oo,jim-pack,service-control,busybox(>=1.19.3-1),lsof,epg(>=1.0.8),hmt(>=1.1.1),ssmtp,anacron

View File

@ -20,7 +20,18 @@ if {![file isdirectory $dir]} {
exit exit
} }
set backups [glob -nocomplain "$dir/*.rbk"] proc s_time {a b} {
file stat $a l
set at $l(ctime)
file stat $b l
set bt $l(ctime)
if {$at < $bt} { return -1 }
if {$at > $bt} { return 1 }
return 0
}
set backups [lsort -command s_time [glob -nocomplain "$dir/*.rbk"]]
if {![llength $backups]} { if {![llength $backups]} {
empty empty