From f3189a11ae188afc71e298f334e5e6eea54e3ca3 Mon Sep 17 00:00:00 2001 From: Luca Falavigna Date: Sun, 3 Jan 2016 18:41:35 +0000 Subject: [PATCH] Define correct RM version when binary name is different than source --- daklib/rm.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/daklib/rm.py b/daklib/rm.py index db1d907f..1e523d2e 100644 --- a/daklib/rm.py +++ b/daklib/rm.py @@ -350,6 +350,7 @@ def remove(session, reason, suites, removals, binaries = [] whitelists = [] versions = [] + newest_source = '' suite_ids_list = [] suites_list = utils.join_with_commas_and(suites) cnf = utils.get_conf() @@ -400,6 +401,8 @@ def remove(session, reason, suites, removals, for version in versions: d[package][version].sort(utils.arch_compare_sw) summary += "%10s | %10s | %s\n" % (package, version, ", ".join(d[package][version])) + if apt_pkg.version_compare(version, newest_source) > 0: + newest_source = version for package in summary.split("\n"): for row in package.split("\n"): @@ -524,22 +527,18 @@ def remove(session, reason, suites, removals, # 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])) + newest_source = re_bin_only_nmu.sub('', newest_source) 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 + if newest_source != '': + Subst_close_other["__VERSION__"] = newest_source else: logfile.write("=========================================================================\n") logfile822.write("\n") -- 2.39.5