X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fcontrol_suite.py;h=2d8a295a7fa0f8e3805d8e5fb7b5d54230732d1c;hb=654c6d73d3023eb95bc8d2ff7ac7ebf8d92a30de;hp=d18bc70594ac8fd8c03d60978f69953a8f3744b7;hpb=e939620de1f925def64465f20f1f2320f092d967;p=dak.git diff --git a/dak/control_suite.py b/dak/control_suite.py index d18bc705..2d8a295a 100755 --- a/dak/control_suite.py +++ b/dak/control_suite.py @@ -122,14 +122,13 @@ def britney_changelog(packages, suite, session): for p in q.fetchall(): current[p[0]] = p[1] for p in packages.keys(): - p = p.split() if p[2] == "source": old[p[0]] = p[1] new = {} for p in current.keys(): if p in old.keys(): - if apt_pkg.VersionCompare(current[p], old[p]) > 0: + if apt_pkg.version_compare(current[p], old[p]) > 0: new[p] = [current[p], old[p]] else: new[p] = [current[p], 0] @@ -177,7 +176,7 @@ def version_checks(package, architecture, target_suite, new_version, session, fo violations = False for suite, version in suite_version_list: - cmp = apt_pkg.VersionCompare(new_version, version) + cmp = apt_pkg.version_compare(new_version, version) if suite in must_be_newer_than and cmp < 1: utils.warn("%s (%s): version check violated: %s targeted at %s is *not* newer than %s in %s" % (package, architecture, new_version, target_suite, version, suite)) violations = True @@ -200,7 +199,7 @@ def cmp_package_version(a, b): cmp_package = cmp(a[0], b[0]) if cmp_package != 0: return cmp_package - return apt_pkg.VersionCompare(a[1], b[1]) + return apt_pkg.version_compare(a[1], b[1]) ####################################################################################### @@ -318,12 +317,15 @@ def process_file(file, suite, action, session, britney=False, force=False): session.execute("""INSERT INTO src_associations (suite, source) VALUES (:suiteid, :pkid)""", {'suiteid': suite_id, 'pkid': pkid}) + Logger.log(["added", package, version, architecture, suite.suite_name, pkid]) + elif action == "remove": if association_id == None: utils.warn("'%s_%s_%s' doesn't exist in suite %s." % (package, version, architecture, suite)) continue else: session.execute("""DELETE FROM src_associations WHERE id = :pkid""", {'pkid': association_id}) + Logger.log(["removed", package, version, architecture, suite.suite_name, pkid]) else: # Find the existing associations ID, if any q = session.execute("""SELECT id FROM bin_associations @@ -344,12 +346,14 @@ def process_file(file, suite, action, session, britney=False, force=False): session.execute("""INSERT INTO bin_associations (suite, bin) VALUES (:suiteid, :pkid)""", {'suiteid': suite_id, 'pkid': pkid}) + Logger.log(["added", package, version, architecture, suite.suite_name, pkid]) elif action == "remove": if association_id == None: utils.warn("'%s_%s_%s' doesn't exist in suite %s." % (package, version, architecture, suite)) continue else: session.execute("""DELETE FROM bin_associations WHERE id = :pkid""", {'pkid': association_id}) + Logger.log(["removed", package, version, architecture, suite.suite_name, pkid]) session.commit() @@ -393,11 +397,11 @@ def main (): cnf["Control-Suite::Options::%s" % (i)] = "" try: - file_list = apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv); + file_list = apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv); except SystemError as e: print "%s\n" % e usage(1) - Options = cnf.SubTree("Control-Suite::Options") + Options = cnf.subtree("Control-Suite::Options") if Options["Help"]: usage()