[dak/master] cruft_report: Split NBS command by source package
This makes the commands easier to check if there are a lot of
them or if some source packages lost a lot of binary packages-
Signed-off-by: Frank Lichtenheld <djpig@debian.org>
---
dak/cruft_report.py | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/dak/cruft_report.py b/dak/cruft_report.py
index 4c6d323..30650d4 100755
--- a/dak/cruft_report.py
+++ b/dak/cruft_report.py
@@ -206,7 +206,7 @@ def do_nbs(real_nbs):
output = "Not Built from Source\n"
output += "---------------------\n\n"
- nbs_to_remove = []
+ cmd_output = ""
nbs_keys = real_nbs.keys()
nbs_keys.sort()
for source in nbs_keys:
@@ -216,21 +216,22 @@ def do_nbs(real_nbs):
output += " but no longer builds:\n"
versions = real_nbs[source].keys()
versions.sort(apt_pkg.VersionCompare)
+ all_packages = []
for version in versions:
packages = real_nbs[source][version].keys()
packages.sort()
- for pkg in packages:
- nbs_to_remove.append(pkg)
+ all_packages.extend(packages)
output += " o %s: %s\n" % (version, ", ".join(packages))
+ if all_packages:
+ all_packages.sort()
+ cmd_output += " dak rm -m \"[auto-cruft] NBS (was built by %s)\" -s %s -b %s\n\n" % (source, suite, " ".join(all_packages))
output += "\n"
- if nbs_to_remove:
+ if len(cmd_output):
print output
-
- print "Suggested command:"
- print " dak rm -m \"[auto-cruft] NBS\" -s %s -b %s" % (suite, " ".join(nbs_to_remove))
- print
+ print "Suggested commands:\n"
+ print cmd_output
################################################################################
--
1.5.6.5
Reply to: