# close associated bug reports
if close_related_bugs:
+ latest_version = ''
Subst_close_other = Subst_common
bcc = []
wnpp = utils.parse_wnpp_bug_file()
versions = list(set([re_bin_only_nmu.sub('', v) for v in versions]))
- if len(versions) == 1:
- Subst_close_other["__VERSION__"] = versions[0]
+ if len(set(s.split("_", 1)[0] for s in sources)) == 1:
+ source_pkg = source.split("_", 1)[0]
+ else:
+ logfile.write("=========================================================================\n")
+ logfile822.write("\n")
+ raise ValueError("Closing bugs for multiple source packages is not supported. Please do it yourself.")
+ for version in versions:
+ if apt_pkg.version_compare(version, latest_version) > 0:
+ latest_version = version
+ if latest_version != '':
+ Subst_close_other["__VERSION__"] = latest_version
else:
logfile.write("=========================================================================\n")
logfile822.write("\n")
- raise ValueError("Closing bugs with multiple package versions is not supported. Do it yourself.")
+ raise ValueError("No versions can be found. Close bugs yourself.")
if bcc:
Subst_close_other["__BCC__"] = "Bcc: " + ", ".join(bcc)
else:
# 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__"] = done_bugs[0]
- if len(sources) == 1:
- source_pkg = source.split("_", 1)[0]
- else:
- logfile.write("=========================================================================\n")
- logfile822.write("\n")
- raise ValueError("Closing bugs for multiple source packages is not supported. Please do it yourself.")
Subst_close_other["__BUG_NUMBER_ALSO__"] = ""
Subst_close_other["__SOURCE__"] = source_pkg
merged_bugs = set()