From: Chris Lamb Date: Wed, 28 Oct 2009 10:26:43 +0000 (+0000) Subject: Improve logging in clean_empty_directories. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3439f9aefaaec77da534df93fa9173aa8a5dbc89;p=dak Improve logging in clean_empty_directories. Signed-off-by: Chris Lamb --- diff --git a/dak/clean_suites.py b/dak/clean_suites.py index d0efdcc9..52b2a8cc 100755 --- a/dak/clean_suites.py +++ b/dak/clean_suites.py @@ -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]) ################################################################################