# at this point, I just assume, that the first closed bug gives
# some useful information on why the package got removed
Subst_close_other["__BUG_NUMBER__"] = utils.split_args(Options["Done"])[0]
- if len(sources) > 1:
+ if len(sources) == 1:
+ source_pkg = source.split("_", 1)[0]
+ else:
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.split("_", 1)[0]
- logfile.write("Also closing bugs: ")
- 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))
+ Subst_close_other["__SOURCE__"] = source_pkg
+ 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:")
+ for bug in wnpp[source_pkg]:
+ # the wnpp-rm file we parse also contains our removal
+ # bugs, filtering that out
+ if bug != Subst_close_other["__BUG_NUMBER__"]:
+ 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")
-
++
mail_message = utils.TemplateSubst(Subst_close_other,cnf["Dir::Templates"]+"/rm.bug-close-related")
if Subst_close_other["__BUG_NUMBER_ALSO__"]:
utils.send_mail(mail_message)
- logfile.write("\n")
- logfile822.write("\n")
-
++
logfile.write("=========================================================================\n")
logfile.close()
if which_conf_file() != default_config:
apt_pkg.ReadConfigFileISC(Cnf,which_conf_file())
-
+
+ ################################################################################
+
+ def parse_wnpp_bug_file(file = "/srv/ftp-master.debian.org/scripts/masterfiles/wnpp_rm"):
+ """
+ Parses the wnpp bug list available at http://qa.debian.org/data/bts/wnpp_rm
+ Well, actually it parsed a local copy, but let's document the source
+ somewhere ;)
+
+ returns a dict associating source package name with a list of open wnpp
+ bugs (Yes, there might be more than one)
+ """
-
++
+ line = []
+ try:
+ f = open(file)
+ lines = f.readlines()
+ except IOerror, e:
+ print "Warning: Couldn't open %s; don't know about WNPP bugs, so won't close any." % file
+ lines = []
+ wnpp = {}
+
+ for line in lines:
+ splited_line = line.split(": ", 1)
+ if len(splited_line) > 1:
+ wnpp[splited_line[0]] = splited_line[1].split("|")
+
+ for source in wnpp.keys():
+ bugs = []
+ for wnpp_bug in wnpp[source]:
+ bug_no = re.search("(\d)+", wnpp_bug).group()
+ if bug_no:
+ bugs.append(bug_no)
+ wnpp[source] = bugs
+ return wnpp
--- /dev/null
-__CC__
+ From: __RM_ADDRESS__
+ To: __BUG_NUMBER__-close@__BUG_SERVER__
++__CC__
+ __BCC__
+ X-Debian: DAK
+ MIME-Version: 1.0
+ Content-Type: text/plain; charset="utf-8"
+ Content-Transfer-Encoding: 8bit
+ Subject: Bug#__BUG_NUMBER__: __SUBJECT__
+
+ We believe that the bug you reported is now fixed; the following
+ package(s) have been removed from __SUITE_LIST__:
+
+ __SUMMARY__
+ Note that the package(s) have simply been removed from the tag
+ database and may (or may not) still be in the pool; this is not a bug.
+ The package(s) will be physically removed automatically when no suite
+ references them (and in the case of source, when no binary references
+ it). Please also remember that the changes have been done on the
+ master archive (__MASTER_ARCHIVE__) and will not propagate to any
+ mirrors (__PRIMARY_MIRROR__ included) until the next cron.daily run at the
+ earliest.
+
+ Packages are usually not removed from testing by hand. Testing tracks
+ unstable and will automatically remove packages which were removed
+ from unstable when removing them from testing causes no dependency
+ problems. The release team can force a removal from testing if it is
+ really needed, please contact them if this should be the case.
+
+ We try to close Bugs which have been reported against this package
+ automatically. But please check all old bugs, if they where closed
+ correctly or should have been re-assign to another package.
+
+ Thank you for reporting the bug, which will now be closed. If you
+ have further comments please address them to __BUG_NUMBER__@__BUG_SERVER__.
+
+ The full log for this bug can be viewed at http://__BUG_SERVER__/__BUG_NUMBER__
+
+ This message was generated automatically; if you believe that there is
+ a problem with it please contact the archive administrators by mailing
+ __ADMIN_ADDRESS__.
+
+ __DISTRO__ distribution maintenance software
+ pp.
+ __WHOAMI__ (the ftpmaster behind the curtain)