fix src dir removal

This commit is contained in:
hummypkg 2014-07-21 21:48:19 +00:00
parent 635246de8a
commit 2a77e9a634
2 changed files with 8 additions and 6 deletions

View File

@ -1,9 +1,9 @@
Package: sweeper
Priority: optional
Section: misc
Version: 2.0.7-1
Version: 2.0.7-2
Architecture: mipsel
Maintainer: af123@hummypkg.org.uk
Depends: webif(>=1.0.15-7)
Depends: webif(>=1.0.16)
Description: Sweeper is a package for managing recordings in a variety of ways using custom rules [See forum for details]
Tags: http://hummy.tv/forum/threads/5138/

View File

@ -244,11 +244,13 @@ proc ::sweeper::folder_apply {dir callback args} {
}
}
proc ::sweeper::rmdir_if_empty {src} {
if {![system rmdir_if_empty $src]} {
proc ::sweeper::rmdir_if_empty {dir} {
if {$dir eq $::root} return
if {[file exists "$dir/.sweeper"]} return
if {![system rmdir_if_empty $dir]} {
log "Failed to remove directory" 0
foreach l [system rmdir_if_empty $src 1] {
log "Blocking file: $l" 0
foreach l [system rmdir_if_empty $dir 1] {
log "Blocking file: $l" 2
}
}
}