From: Luca Falavigna Date: Sun, 28 Apr 2013 01:43:37 +0000 (+0000) Subject: Fix number of removed files when rmtree'ing directories X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=41ecb7eec32563c9e9f72316ea410a52a48c6923;p=dak Fix number of removed files when rmtree'ing directories --- diff --git a/dak/make_changelog.py b/dak/make_changelog.py index 50307b15..eeb738e5 100755 --- a/dak/make_changelog.py +++ b/dak/make_changelog.py @@ -244,13 +244,13 @@ def export_files(session, archive, clpool, progress=False): if len(files): if root.split('/')[-1] not in sources.keys(): if os.path.exists(root): + stats['removed'] += len(os.listdir(root)) rmtree(root) - stats['removed'] += 1 for file in files: if os.path.exists(os.path.join(root, file)): if os.stat(os.path.join(root, file)).st_nlink == 1: - os.unlink(os.path.join(root, file)) stats['removed'] += 1 + os.unlink(os.path.join(root, file)) for root, dirs, files in os.walk(clpool): stats['files'] += len(files)