From 41ecb7eec32563c9e9f72316ea410a52a48c6923 Mon Sep 17 00:00:00 2001 From: Luca Falavigna Date: Sun, 28 Apr 2013 01:43:37 +0000 Subject: [PATCH] Fix number of removed files when rmtree'ing directories --- dak/make_changelog.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) -- 2.39.5