]> git.decadent.org.uk Git - dak.git/commitdiff
Improve logging in clean_empty_directories.
authorChris Lamb <lamby@debian.org>
Wed, 28 Oct 2009 10:26:43 +0000 (10:26 +0000)
committerChris Lamb <lamby@debian.org>
Wed, 28 Oct 2009 10:26:43 +0000 (10:26 +0000)
Signed-off-by: Chris Lamb <lamby@debian.org>
dak/clean_suites.py

index d0efdcc9d5f9d09df9da2cf9f6cffaa5c43ff3b1..52b2a8ccb1f4504003ff487493305e9577ef707c 100755 (executable)
@@ -375,14 +375,14 @@ def clean_empty_directories(session):
     for base in bases:
         for dirpath, dirnames, filenames in os.walk(base, topdown=False):
             if not filenames and not dirnames:
+                to_remove = os.path.join(base, dirpath)
                 if not Options["No-Action"]:
-                    os.removedirs(os.path.join(base, dirpath))
+                    Logger.log(["removing directory", to_remove])
+                    os.removedirs(to_remove)
                 count += 1
 
     if count:
-        Logger.log(["total", count])
-        print "Cleaned %d empty directories from %d location(s)" % \
-            (count, len(bases))
+        Logger.log(["total removed directories", count])
 
 ################################################################################