]> git.decadent.org.uk Git - dak.git/commitdiff
Only log, if there is something to log
authorAlexander Reichle-Schmehl <alexander@schmehl.info>
Tue, 28 Sep 2010 15:45:18 +0000 (15:45 +0000)
committerAlexander Reichle-Schmehl <alexander@schmehl.info>
Tue, 28 Sep 2010 15:45:18 +0000 (15:45 +0000)
dak/rm.py

index 0f7c9f2a8d018402400ce656309f07985316fb06..936468cf2c8e2dfbae1e2944ff2e972b6cb2cc46 100755 (executable)
--- a/dak/rm.py
+++ b/dak/rm.py
@@ -647,14 +647,16 @@ def main ():
             utils.fubar("Closing bugs for multiple source pakcages is not supported.  Do it yourself.")
         Subst_close_other["__BUG_NUMBER_ALSO__"] = ""
         Subst_close_other["__SOURCE__"] = source_pkg
-        logfile.write("Also closing bug(s):")
-        logfile822.write("Also-Bugs:")
-        for bug in bts.get_bugs('src', source.split("_", 1)[0], 'status', 'open'):
-            Subst_close_other["__BUG_NUMBER_ALSO__"] += str(bug) + "-done@" + cnf["Dinstall::BugServer"] + ","
-            logfile.write(" " + str(bug))
-            logfile822.write(" " + str(bug))
-        logfile.write("\n")
-        logfile822.write("\n")
+        other_bugs = bts.get_bugs('src', source_pkg, 'status', 'open')
+        if other_bugs:
+            logfile.write("Also closing bug(s):")
+            logfile822.write("Also-Bugs:")
+            for bug in other_bugs:
+                Subst_close_other["__BUG_NUMBER_ALSO__"] += str(bug) + "-done@" + cnf["Dinstall::BugServer"] + ","
+                logfile.write(" " + str(bug))
+                logfile822.write(" " + str(bug))
+            logfile.write("\n")
+            logfile822.write("\n")
         if source_pkg in wnpp.keys():
             logfile.write("Also closing WNPP bug(s):")
             logfile822.write("Also-WNPP:")