From: Ansgar Burchardt Date: Sun, 6 May 2012 15:16:52 +0000 (+0200) Subject: stop using deprecated python-apt functions X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9a4fb568340b14698947bfa59b309ae0c67c693a;p=dak stop using deprecated python-apt functions Renamed functions and methods: Find -> find FindB -> find_b newConfiguration -> Configuration ParseCommandLine -> parse_commandline ParseSrcDepends -> parse_src_depends ReadConfigFileISC -> read_config_file_isc SubTree -> subtree ValueList -> value_list VersionCompare -> version_compare Removed functions: debExtractControl: replaced with utils.deb_extract_control Other changes: x.has_key(y) -> y in x x.Find(y) -> x[y] The last change was only done in places where `y' is sure to exists (`x.Find' would return None otherwise, `x[y]' would raise an exception). --- diff --git a/dak/add_user.py b/dak/add_user.py index 8ab4d230..aaab5c80 100755 --- a/dak/add_user.py +++ b/dak/add_user.py @@ -115,9 +115,9 @@ def main(): if not Cnf.has_key("Add-User::Options::%s" % (i)): Cnf["Add-User::Options::%s" % (i)] = "" - apt_pkg.ParseCommandLine(Cnf, Arguments, sys.argv) + apt_pkg.parse_commandline(Cnf, Arguments, sys.argv) - Options = Cnf.SubTree("Add-User::Options") + Options = Cnf.subtree("Add-User::Options") if Options["help"]: usage() @@ -187,7 +187,7 @@ def main(): name, primary_key) # Should we send mail to the newly added user? - if Cnf.FindB("Add-User::SendEmail"): + if Cnf.find_b("Add-User::SendEmail"): mail = name + "<" + emails[0] +">" Subst = {} Subst["__NEW_MAINTAINER__"] = mail diff --git a/dak/admin.py b/dak/admin.py index de324bfd..23b4c2d8 100755 --- a/dak/admin.py +++ b/dak/admin.py @@ -537,9 +537,9 @@ def main(): if not Cnf.has_key("Admin::Options::%s" % (i)): Cnf["Admin::Options::%s" % (i)] = "" - arguments = apt_pkg.ParseCommandLine(Cnf, arguments, sys.argv) + arguments = apt_pkg.parse_commandline(Cnf, arguments, sys.argv) - options = Cnf.SubTree("Admin::Options") + options = Cnf.subtree("Admin::Options") if options["Help"] or len(arguments) < 1: usage() if options["Dry-Run"]: diff --git a/dak/bts_categorize.py b/dak/bts_categorize.py index b2cb3d40..c8739af6 100755 --- a/dak/bts_categorize.py +++ b/dak/bts_categorize.py @@ -162,8 +162,8 @@ def main(): if not Cnf.has_key(opt): Cnf[opt] = "" - packages = apt_pkg.ParseCommandLine(Cnf, arguments, sys.argv) - Options = Cnf.SubTree('BtsCategorize::Options') + packages = apt_pkg.parse_commandline(Cnf, arguments, sys.argv) + Options = Cnf.subtree('BtsCategorize::Options') if Options["Help"]: usage() diff --git a/dak/check_archive.py b/dak/check_archive.py index e5425226..a47febbd 100755 --- a/dak/check_archive.py +++ b/dak/check_archive.py @@ -529,9 +529,9 @@ def main (): if not cnf.has_key("Check-Archive::Options::%s" % (i)): cnf["Check-Archive::Options::%s" % (i)] = "" - args = apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv) + args = apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv) - Options = cnf.SubTree("Check-Archive::Options") + Options = cnf.subtree("Check-Archive::Options") if Options["Help"]: usage() diff --git a/dak/check_overrides.py b/dak/check_overrides.py index e833aa75..aed0a647 100755 --- a/dak/check_overrides.py +++ b/dak/check_overrides.py @@ -321,8 +321,8 @@ def main (): for i in [ "help", "no-action" ]: if not cnf.has_key("Check-Overrides::Options::%s" % (i)): cnf["Check-Overrides::Options::%s" % (i)] = "" - apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv) - Options = cnf.SubTree("Check-Overrides::Options") + apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv) + Options = cnf.subtree("Check-Overrides::Options") if Options["Help"]: usage() diff --git a/dak/clean_queues.py b/dak/clean_queues.py index e6e4f76c..d947818c 100755 --- a/dak/clean_queues.py +++ b/dak/clean_queues.py @@ -208,8 +208,8 @@ def main (): ('n',"no-action","Clean-Queues::Options::No-Action"), ('v',"verbose","Clean-Queues::Options::Verbose")] - apt_pkg.ParseCommandLine(cnf.Cnf,Arguments,sys.argv) - Options = cnf.SubTree("Clean-Queues::Options") + apt_pkg.parse_commandline(cnf.Cnf,Arguments,sys.argv) + Options = cnf.subtree("Clean-Queues::Options") if Options["Help"]: usage() diff --git a/dak/clean_suites.py b/dak/clean_suites.py index 7419b83b..66bda62d 100755 --- a/dak/clean_suites.py +++ b/dak/clean_suites.py @@ -417,8 +417,8 @@ def main(): ('n',"no-action","Clean-Suites::Options::No-Action"), ('m',"maximum","Clean-Suites::Options::Maximum", "HasArg")] - apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv) - Options = cnf.SubTree("Clean-Suites::Options") + apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv) + Options = cnf.subtree("Clean-Suites::Options") if cnf["Clean-Suites::Options::Maximum"] != "": try: diff --git a/dak/contents.py b/dak/contents.py index 76effc1d..f36e96dc 100755 --- a/dak/contents.py +++ b/dak/contents.py @@ -124,8 +124,8 @@ def main(): ('l', "limit", 'Contents::Options::Limit', "HasArg"), ('f', "force", 'Contents::Options::Force'), ] - args = apt_pkg.ParseCommandLine(cnf.Cnf, arguments, sys.argv) - options = cnf.SubTree('Contents::Options') + args = apt_pkg.parse_commandline(cnf.Cnf, arguments, sys.argv) + options = cnf.subtree('Contents::Options') if (len(args) != 1) or options['Help']: usage() diff --git a/dak/control_overrides.py b/dak/control_overrides.py index 803c8951..f9258d52 100755 --- a/dak/control_overrides.py +++ b/dak/control_overrides.py @@ -320,7 +320,7 @@ def main (): if not cnf.has_key("Control-Overrides::Options::Type"): cnf["Control-Overrides::Options::Type"] = "deb" - file_list = apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv) + file_list = apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv) if cnf["Control-Overrides::Options::Help"]: usage() diff --git a/dak/control_suite.py b/dak/control_suite.py index 4216a2ab..2d8a295a 100755 --- a/dak/control_suite.py +++ b/dak/control_suite.py @@ -128,7 +128,7 @@ def britney_changelog(packages, suite, session): 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] @@ -176,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 @@ -199,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]) ####################################################################################### @@ -397,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() diff --git a/dak/copy_installer.py b/dak/copy_installer.py index 34ae3215..c70b048d 100755 --- a/dak/copy_installer.py +++ b/dak/copy_installer.py @@ -44,8 +44,8 @@ def main(): for option in [ "help", "source", "destination", "no-action" ]: if not cnf.has_key("Copy-Installer::Options::%s" % (option)): cnf["Copy-Installer::Options::%s" % (option)] = "" - extra_arguments = apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv) - Options = cnf.SubTree("Copy-Installer::Options") + extra_arguments = apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv) + Options = cnf.subtree("Copy-Installer::Options") if Options["Help"]: usage() diff --git a/dak/cruft_report.py b/dak/cruft_report.py index 93410620..73f51025 100755 --- a/dak/cruft_report.py +++ b/dak/cruft_report.py @@ -106,7 +106,7 @@ def do_anais(architecture, binaries_list, source, session): version = i[1] if architectures.has_key(arch): versions.append(version) - versions.sort(apt_pkg.VersionCompare) + versions.sort(apt_pkg.version_compare) if versions: latest_version = versions.pop() else: @@ -123,7 +123,7 @@ def do_anais(architecture, binaries_list, source, session): if versions_d != {}: anais_output += "\n (*) %s_%s [%s]: %s\n" % (binary, latest_version, source, architecture) versions = versions_d.keys() - versions.sort(apt_pkg.VersionCompare) + versions.sort(apt_pkg.version_compare) for version in versions: arches = versions_d[version] arches.sort() @@ -401,7 +401,7 @@ def do_dubious_nbs(dubious_nbs): source_binaries.get(source, "(source does not exist)")) print " won't admit to building:" versions = dubious_nbs[source].keys() - versions.sort(apt_pkg.VersionCompare) + versions.sort(apt_pkg.version_compare) for version in versions: packages = dubious_nbs[source][version].keys() packages.sort() @@ -598,9 +598,9 @@ def main (): if not cnf.has_key("Cruft-Report::Options::Wanna-Build-Dump"): cnf["Cruft-Report::Options::Wanna-Build-Dump"] = "/srv/ftp-master.debian.org/scripts/nfu" - apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv) + apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv) - Options = cnf.SubTree("Cruft-Report::Options") + Options = cnf.subtree("Cruft-Report::Options") if Options["Help"]: usage() @@ -722,7 +722,7 @@ def main (): if source == "": source = package if bin2source.has_key(package) and \ - apt_pkg.VersionCompare(version, bin2source[package]["version"]) > 0: + apt_pkg.version_compare(version, bin2source[package]["version"]) > 0: bin2source[package]["version"] = version bin2source[package]["source"] = source else: @@ -751,10 +751,10 @@ def main (): for source in nbs.keys(): for package in nbs[source].keys(): versions = nbs[source][package].keys() - versions.sort(apt_pkg.VersionCompare) + versions.sort(apt_pkg.version_compare) latest_version = versions.pop() source_version = source_versions.get(source,"0") - if apt_pkg.VersionCompare(latest_version, source_version) == 0: + if apt_pkg.version_compare(latest_version, source_version) == 0: add_nbs(dubious_nbs, source, latest_version, package, suite_id, session) if "nviu" in checks: diff --git a/dak/dakdb/update20.py b/dak/dakdb/update20.py index c1424ab2..0e8ac9d8 100755 --- a/dak/dakdb/update20.py +++ b/dak/dakdb/update20.py @@ -59,7 +59,7 @@ def do_update(self): c.execute("UPDATE queue SET path = %s WHERE id = %s", (dir, row[0])) print "Adding missing queues to the queue table" - for q in cnf.SubTree("Dir::Queue").keys(): + for q in cnf.subtree("Dir::Queue").keys(): qname = q.lower() if qname in seenqueues.keys(): continue diff --git a/dak/dakdb/update21.py b/dak/dakdb/update21.py index c91b6f14..41cef6dc 100755 --- a/dak/dakdb/update21.py +++ b/dak/dakdb/update21.py @@ -115,7 +115,7 @@ def do_update(self): cnf = Config() c.execute("""INSERT INTO queue (queue_name, path) VALUES ('buildd', '%s')""" % cnf["Dir::QueueBuild"].rstrip('/')) - for s in cnf.ValueList("Dinstall::QueueBuildSuites"): + for s in cnf.value_list("Dinstall::QueueBuildSuites"): c.execute("""INSERT INTO suite_queue_copy (suite, queue) VALUES ( (SELECT id FROM suite WHERE suite_name = '%s'), (SELECT id FROM queue WHERE queue_name = 'buildd'))""" % s.lower()) diff --git a/dak/dakdb/update28.py b/dak/dakdb/update28.py index 1455ee31..f0c62e0e 100755 --- a/dak/dakdb/update28.py +++ b/dak/dakdb/update28.py @@ -40,7 +40,7 @@ def _suites(): """ return a list of suites to operate on """ - suites = Config().SubTree("Suite").List() + suites = Config().subtree("Suite").list() return suites def arches(cursor, suite): diff --git a/dak/dakdb/update4.py b/dak/dakdb/update4.py index 938522cc..a6456bea 100755 --- a/dak/dakdb/update4.py +++ b/dak/dakdb/update4.py @@ -53,9 +53,9 @@ def do_update(self): for suite in s: suites[suite[1]]=suite[0] - for suite in Cnf.SubTree("Suite").List(): + for suite in Cnf.subtree("Suite").list(): print "Processing suite %s" % (suite) - architectures = Cnf.SubTree("Suite::" + suite).ValueList("Architectures") + architectures = Cnf.subtree("Suite::" + suite).value_list("Architectures") suite = suite.lower() for arch in architectures: c.execute(query, [suites[suite], archs[arch]]) diff --git a/dak/dakdb/update52.py b/dak/dakdb/update52.py index aa7a10d1..8bfaba30 100755 --- a/dak/dakdb/update52.py +++ b/dak/dakdb/update52.py @@ -55,7 +55,7 @@ def do_update(self): for check in ["Enhances", "MustBeNewerThan", "MustBeOlderThan"]: for suite_name in suite_id_map.keys(): - for reference_name in [ s.lower() for s in cnf.ValueList("Suite::%s::VersionChecks::%s" % (suite_name, check)) ]: + for reference_name in [ s.lower() for s in cnf.value_list("Suite::%s::VersionChecks::%s" % (suite_name, check)) ]: c.execute("""INSERT INTO version_check (suite, "check", reference) VALUES (%s, %s, %s)""", (suite_id_map[suite_name], check, suite_id_map[reference_name])) c.execute("UPDATE config SET value = '52' WHERE name = 'db_revision'") diff --git a/dak/dakdb/update7.py b/dak/dakdb/update7.py index 9c3dd1ed..bfd88670 100755 --- a/dak/dakdb/update7.py +++ b/dak/dakdb/update7.py @@ -49,8 +49,8 @@ def do_update(self): c.execute("ALTER TABLE suite ADD COLUMN untouchable BOOLEAN NOT NULL DEFAULT FALSE;") query = "UPDATE suite SET untouchable = TRUE WHERE suite_name = %s" #: Update query - for suite in Cnf.SubTree("Suite").List(): - untouchable = Cnf.Find("Suite::%s::Untouchable" % (suite)) + for suite in Cnf.subtree("Suite").list(): + untouchable = Cnf.find("Suite::%s::Untouchable" % (suite)) if not untouchable: continue print "[Untouchable] Processing suite %s" % (suite) @@ -60,32 +60,32 @@ def do_update(self): c.execute("ALTER TABLE suite ADD COLUMN announce text NOT NULL DEFAULT 'debian-devel-changes@lists.debian.org';") query = "UPDATE suite SET announce = %s WHERE suite_name = %s" #: Update query - for suite in Cnf.SubTree("Suite").List(): - announce_list = Cnf.Find("Suite::%s::Announce" % (suite)) + for suite in Cnf.subtree("Suite").list(): + announce_list = Cnf.find("Suite::%s::Announce" % (suite)) print "[Announce] Processing suite %s" % (suite) suite = suite.lower() c.execute(query, [announce_list, suite]) c.execute("ALTER TABLE suite ADD COLUMN codename text;") query = "UPDATE suite SET codename = %s WHERE suite_name = %s" #: Update query - for suite in Cnf.SubTree("Suite").List(): - codename = Cnf.Find("Suite::%s::CodeName" % (suite)) + for suite in Cnf.subtree("Suite").list(): + codename = Cnf.find("Suite::%s::CodeName" % (suite)) print "[Codename] Processing suite %s" % (suite) suite = suite.lower() c.execute(query, [codename, suite]) c.execute("ALTER TABLE suite ADD COLUMN overridecodename text;") query = "UPDATE suite SET overridecodename = %s WHERE suite_name = %s" #: Update query - for suite in Cnf.SubTree("Suite").List(): - codename = Cnf.Find("Suite::%s::OverrideCodeName" % (suite)) + for suite in Cnf.subtree("Suite").list(): + codename = Cnf.find("Suite::%s::OverrideCodeName" % (suite)) print "[OverrideCodeName] Processing suite %s" % (suite) suite = suite.lower() c.execute(query, [codename, suite]) c.execute("ALTER TABLE suite ADD COLUMN validtime integer NOT NULL DEFAULT 604800;") query = "UPDATE suite SET validtime = %s WHERE suite_name = %s" #: Update query - for suite in Cnf.SubTree("Suite").List(): - validtime = Cnf.Find("Suite::%s::ValidTime" % (suite)) + for suite in Cnf.subtree("Suite").list(): + validtime = Cnf.find("Suite::%s::ValidTime" % (suite)) print "[ValidTime] Processing suite %s" % (suite) if not validtime: validtime = 0 @@ -94,8 +94,8 @@ def do_update(self): c.execute("ALTER TABLE suite ADD COLUMN priority integer NOT NULL DEFAULT 0;") query = "UPDATE suite SET priority = %s WHERE suite_name = %s" #: Update query - for suite in Cnf.SubTree("Suite").List(): - priority = Cnf.Find("Suite::%s::Priority" % (suite)) + for suite in Cnf.subtree("Suite").list(): + priority = Cnf.find("Suite::%s::Priority" % (suite)) print "[Priority] Processing suite %s" % (suite) if not priority: priority = 0 @@ -105,8 +105,8 @@ def do_update(self): c.execute("ALTER TABLE suite ADD COLUMN notautomatic BOOLEAN NOT NULL DEFAULT FALSE;") query = "UPDATE suite SET notautomatic = TRUE WHERE suite_name = %s" #: Update query - for suite in Cnf.SubTree("Suite").List(): - notautomatic = Cnf.Find("Suite::%s::NotAutomatic" % (suite)) + for suite in Cnf.subtree("Suite").list(): + notautomatic = Cnf.find("Suite::%s::NotAutomatic" % (suite)) print "[NotAutomatic] Processing suite %s" % (suite) if not notautomatic: continue diff --git a/dak/dakdb/update70.py b/dak/dakdb/update70.py index 333c5d6b..72421b49 100755 --- a/dak/dakdb/update70.py +++ b/dak/dakdb/update70.py @@ -47,7 +47,7 @@ def do_update(self): # Migrate config file values into database if cnf.has_key("Check-Overrides::OverrideSuites"): - for suitename in cnf.SubTree("Check-Overrides::OverrideSuites").List(): + for suitename in cnf.subtree("Check-Overrides::OverrideSuites").list(): if cnf.get("Check-Overrides::OverrideSuites::%s::Process" % suitename, "0") == "1": print "Marking %s to have overrides processed automatically" % suitename.lower() c.execute("UPDATE suite SET overrideprocess = TRUE WHERE suite_name = %s", [suitename.lower()]) diff --git a/dak/dakdb/update8.py b/dak/dakdb/update8.py index 98e0f088..6bacd4ed 100755 --- a/dak/dakdb/update8.py +++ b/dak/dakdb/update8.py @@ -48,8 +48,8 @@ def do_update(self): c.execute("ALTER TABLE suite ADD COLUMN copychanges TEXT;") query = "UPDATE suite SET copychanges = %s WHERE suite_name = %s" #: Update query - for suite in Cnf.SubTree("Suite").List(): - copychanges = Cnf.Find("Suite::%s::CopyChanges" % (suite)) + for suite in Cnf.subtree("Suite").list(): + copychanges = Cnf.find("Suite::%s::CopyChanges" % (suite)) print "[CopyChanges] Processing suite %s" % (suite) if not copychanges: continue @@ -58,8 +58,8 @@ def do_update(self): c.execute("ALTER TABLE suite ADD COLUMN copydotdak TEXT;") query = "UPDATE suite SET copydotdak = %s WHERE suite_name = %s" #: Update query - for suite in Cnf.SubTree("Suite").List(): - copydotdak = Cnf.Find("Suite::%s::CopyDotDak" % (suite)) + for suite in Cnf.subtree("Suite").list(): + copydotdak = Cnf.find("Suite::%s::CopyDotDak" % (suite)) print "[CopyDotDak] Processing suite %s" % (suite) if not copydotdak: continue @@ -68,8 +68,8 @@ def do_update(self): c.execute("ALTER TABLE suite ADD COLUMN commentsdir TEXT;") query = "UPDATE suite SET commentsdir = %s WHERE suite_name = %s" #: Update query - for suite in Cnf.SubTree("Suite").List(): - commentsdir = Cnf.Find("Suite::%s::CommentsDir" % (suite)) + for suite in Cnf.subtree("Suite").list(): + commentsdir = Cnf.find("Suite::%s::CommentsDir" % (suite)) print "[CommentsDir] Processing suite %s" % (suite) if not commentsdir: continue @@ -78,8 +78,8 @@ def do_update(self): c.execute("ALTER TABLE suite ADD COLUMN overridesuite TEXT;") query = "UPDATE suite SET overridesuite = %s WHERE suite_name = %s" #: Update query - for suite in Cnf.SubTree("Suite").List(): - overridesuite = Cnf.Find("Suite::%s::OverrideSuite" % (suite)) + for suite in Cnf.subtree("Suite").list(): + overridesuite = Cnf.find("Suite::%s::OverrideSuite" % (suite)) print "[OverrideSuite] Processing suite %s" % (suite) if not overridesuite: continue @@ -88,8 +88,8 @@ def do_update(self): c.execute("ALTER TABLE suite ADD COLUMN changelogbase TEXT;") query = "UPDATE suite SET changelogbase = %s WHERE suite_name = %s" #: Update query - for suite in Cnf.SubTree("Suite").List(): - changelogbase = Cnf.Find("Suite::%s::ChangeLogBase" % (suite)) + for suite in Cnf.subtree("Suite").list(): + changelogbase = Cnf.find("Suite::%s::ChangeLogBase" % (suite)) print "[ChangeLogBase] Processing suite %s" % (suite) if not changelogbase: continue diff --git a/dak/dominate.py b/dak/dominate.py index 5d1bafdf..5c919ab8 100755 --- a/dak/dominate.py +++ b/dak/dominate.py @@ -132,8 +132,8 @@ def main(): cnf['Obsolete::Options::Help'] = '' cnf['Obsolete::Options::No-Action'] = '' cnf['Obsolete::Options::Force'] = '' - apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv) - Options = cnf.SubTree("Obsolete::Options") + apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv) + Options = cnf.subtree("Obsolete::Options") if Options['Help']: usage() Logger = daklog.Logger("dominate") diff --git a/dak/examine_package.py b/dak/examine_package.py index edb9384b..87c7ea9f 100755 --- a/dak/examine_package.py +++ b/dak/examine_package.py @@ -238,8 +238,8 @@ def read_control (filename): deb_file = utils.open_file(filename) try: - extracts = apt_inst.debExtractControl(deb_file) - control = apt_pkg.ParseSection(extracts) + extracts = utils.deb_extract_control(deb_file) + control = apt_pkg.TagSection(extracts) except: print formatted_text("can't parse control info") deb_file.close() @@ -249,17 +249,17 @@ def read_control (filename): control_keys = control.keys() - if control.has_key("Depends"): - depends_str = control.Find("Depends") + if "Depends" in control: + depends_str = control["Depends"] # create list of dependancy lists depends = split_depends(depends_str) - if control.has_key("Recommends"): - recommends_str = control.Find("Recommends") + if "Recommends" in control: + recommends_str = control["Recommends"] recommends = split_depends(recommends_str) - if control.has_key("Section"): - section_str = control.Find("Section") + if "Section" in control: + section_str = control["Section"] c_match = re_contrib.search(section_str) nf_match = re_nonfree.search(section_str) @@ -272,12 +272,12 @@ def read_control (filename): else : # main section = colour_output(section_str, 'main') - if control.has_key("Architecture"): - arch_str = control.Find("Architecture") + if "Architecture" in control: + arch_str = control["Architecture"] arch = colour_output(arch_str, 'arch') - if control.has_key("Maintainer"): - maintainer = control.Find("Maintainer") + if "Maintainer" in control: + maintainer = control["Maintainer"] localhost = re_localhost.search(maintainer) if localhost: #highlight bad email @@ -436,13 +436,13 @@ def output_deb_info(suite, filename, packagename, session = None): field_value = maintainer elif key == 'Description': if use_html: - field_value = formatted_text(control.Find(key), strip=True) + field_value = formatted_text(control.find(key), strip=True) else: - desc = control.Find(key) + desc = control.find(key) desc = re_newlinespace.sub('\n ', desc) field_value = escape_if_needed(desc) else: - field_value = escape_if_needed(control.Find(key)) + field_value = escape_if_needed(control.find(key)) to_print += " "+format_field(key,field_value)+'\n' return to_print @@ -598,8 +598,8 @@ def main (): if not Cnf.has_key("Examine-Package::Options::%s" % (i)): Cnf["Examine-Package::Options::%s" % (i)] = "" - args = apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv) - Options = Cnf.SubTree("Examine-Package::Options") + args = apt_pkg.parse_commandline(Cnf,Arguments,sys.argv) + Options = Cnf.subtree("Examine-Package::Options") if Options["Help"]: usage() diff --git a/dak/external_overrides.py b/dak/external_overrides.py index 5bc098c7..40bdb80e 100755 --- a/dak/external_overrides.py +++ b/dak/external_overrides.py @@ -153,9 +153,9 @@ def main(): Arguments = [('h',"help","External-Overrides::Options::Help"), ('f','force','External-Overrides::Options::Force')] - args = apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv) + args = apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv) try: - Options = cnf.SubTree("External-Overrides::Options") + Options = cnf.subtree("External-Overrides::Options") except KeyError: Options = {} diff --git a/dak/find_null_maintainers.py b/dak/find_null_maintainers.py index 730b2770..3894f574 100755 --- a/dak/find_null_maintainers.py +++ b/dak/find_null_maintainers.py @@ -53,9 +53,9 @@ def main(): if not cnf.has_key("Find-Null-Maintainers::Options::%s" % (i)): cnf["Find-Null-Maintainers::Options::%s" % (i)] = "" - apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv) + apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv) - Options = cnf.SubTree("Find-Null-Maintainers::Options") + Options = cnf.subtree("Find-Null-Maintainers::Options") if Options["Help"]: usage() diff --git a/dak/generate_filelist.py b/dak/generate_filelist.py index 7823295f..faf08bd7 100755 --- a/dak/generate_filelist.py +++ b/dak/generate_filelist.py @@ -155,8 +155,8 @@ def main(): cnf['Filelist::Options::Architecture'] = ','.join(architectures).encode() cnf['Filelist::Options::Help'] = '' cnf['Filelist::Options::Incremental'] = '' - apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv) - Options = cnf.SubTree("Filelist::Options") + apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv) + Options = cnf.subtree("Filelist::Options") if Options['Help']: usage() pool = DakProcessPool() diff --git a/dak/generate_index_diffs.py b/dak/generate_index_diffs.py index e3699a46..db483761 100755 --- a/dak/generate_index_diffs.py +++ b/dak/generate_index_diffs.py @@ -298,8 +298,8 @@ def main(): ('m', "maxdiffs", "Generate-Index-Diffs::Options::MaxDiffs", "hasArg"), ('n', "n-act", "Generate-Index-Diffs::Options::NoAct"), ] - suites = apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv) - Options = Cnf.SubTree("Generate-Index-Diffs::Options") + suites = apt_pkg.parse_commandline(Cnf,Arguments,sys.argv) + Options = Cnf.subtree("Generate-Index-Diffs::Options") if Options.has_key("Help"): usage() maxdiffs = Options.get("MaxDiffs::Default", "56") @@ -318,11 +318,11 @@ def main(): Cnf["Dir::Root"] = Options["RootDir"] if not suites: - suites = Cnf.SubTree("Suite").List() + suites = Cnf.subtree("Suite").list() for suitename in suites: print "Processing: " + suitename - SuiteBlock = Cnf.SubTree("Suite::" + suitename) + SuiteBlock = Cnf.subtree("Suite::" + suitename) suiteobj = get_suite(suitename.lower()) @@ -336,11 +336,11 @@ def main(): architectures = get_suite_architectures(suite, skipall=True) if SuiteBlock.has_key("Components"): - components = SuiteBlock.ValueList("Components") + components = SuiteBlock.value_list("Components") else: components = [] - suite_suffix = Cnf.Find("Dinstall::SuiteSuffix") + suite_suffix = Cnf.find("Dinstall::SuiteSuffix") if components and suite_suffix: longsuite = suite + "/" + suite_suffix else: diff --git a/dak/generate_packages_sources.py b/dak/generate_packages_sources.py index 9b4526fe..39b2486d 100755 --- a/dak/generate_packages_sources.py +++ b/dak/generate_packages_sources.py @@ -396,8 +396,8 @@ def main (): ('s',"suite","Generate-Packages-Sources::Options::Suite"), ('f',"force","Generate-Packages-Sources::Options::Force")] - suite_names = apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv) - Options = cnf.SubTree("Generate-Packages-Sources::Options") + suite_names = apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv) + Options = cnf.subtree("Generate-Packages-Sources::Options") if Options["Help"]: usage() diff --git a/dak/generate_packages_sources2.py b/dak/generate_packages_sources2.py index 151920c1..f0e08654 100755 --- a/dak/generate_packages_sources2.py +++ b/dak/generate_packages_sources2.py @@ -313,9 +313,9 @@ def main(): ('f',"force","Generate-Packages-Sources::Options::Force"), ('o','option','','ArbItem')] - suite_names = apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv) + suite_names = apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv) try: - Options = cnf.SubTree("Generate-Packages-Sources::Options") + Options = cnf.subtree("Generate-Packages-Sources::Options") except KeyError: Options = {} diff --git a/dak/generate_releases.py b/dak/generate_releases.py index f4672d2b..3801132d 100755 --- a/dak/generate_releases.py +++ b/dak/generate_releases.py @@ -145,7 +145,7 @@ class ReleaseWriter(object): cnf = Config() - suite_suffix = "%s" % (cnf.Find("Dinstall::SuiteSuffix")) + suite_suffix = "%s" % (cnf.find("Dinstall::SuiteSuffix")) outfile = os.path.join(cnf["Dir::Root"], 'dists', "%s/%s" % (suite.suite_name, suite_suffix), "Release") out = open(outfile + ".new", "w") @@ -301,8 +301,8 @@ def main (): ('f',"force","Generate-Releases::Options::Force"), ('o','option','','ArbItem')] - suite_names = apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv) - Options = cnf.SubTree("Generate-Releases::Options") + suite_names = apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv) + Options = cnf.subtree("Generate-Releases::Options") if Options["Help"]: usage() diff --git a/dak/graph.py b/dak/graph.py index 8d94b6b2..0566130b 100755 --- a/dak/graph.py +++ b/dak/graph.py @@ -175,9 +175,9 @@ def main(): if not Cnf.has_key("Graph::Options::%s" % (i)): Cnf["Graph::Options::%s" % (i)] = "" - apt_pkg.ParseCommandLine(Cnf, Arguments, sys.argv) + apt_pkg.parse_commandline(Cnf, Arguments, sys.argv) - Options = Cnf.SubTree("Graph::Options") + Options = Cnf.subtree("Graph::Options") if Options["Help"]: usage() @@ -187,7 +187,7 @@ def main(): for i in Cnf["Graph::Options::Names"].split(","): names.append(i) elif Cnf.has_key("Graph::Names"): - names = Cnf.ValueList("Graph::Names") + names = Cnf.value_list("Graph::Names") else: names = default_names @@ -199,7 +199,7 @@ def main(): extra_rrdtool_args.extend(f.read().strip().split("\n")) f.close() elif Cnf.has_key("Graph::Extra-Rrd"): - for i in Cnf.ValueList("Graph::Extra-Rrd"): + for i in Cnf.value_list("Graph::Extra-Rrd"): f = open(i) extra_rrdtool_args.extend(f.read().strip().split("\n")) f.close() diff --git a/dak/import_keyring.py b/dak/import_keyring.py index 6f366d85..89c2b755 100755 --- a/dak/import_keyring.py +++ b/dak/import_keyring.py @@ -93,11 +93,11 @@ def main(): if not cnf.has_key("Import-Keyring::Options::%s" % (i)): cnf["Import-Keyring::Options::%s" % (i)] = "" - keyring_names = apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv) + keyring_names = apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv) ### Parse options - Options = cnf.SubTree("Import-Keyring::Options") + Options = cnf.subtree("Import-Keyring::Options") if Options["Help"]: usage() diff --git a/dak/import_known_changes.py b/dak/import_known_changes.py index 7b182d6f..4e8068f6 100755 --- a/dak/import_known_changes.py +++ b/dak/import_known_changes.py @@ -321,7 +321,7 @@ def main(): ('v',"verbose", "%s::%s" % (options_prefix,"Verbose")), ] - args = apt_pkg.ParseCommandLine(cnf.Cnf, arguments,sys.argv) + args = apt_pkg.parse_commandline(cnf.Cnf, arguments,sys.argv) num_threads = 1 diff --git a/dak/import_ldap_fingerprints.py b/dak/import_ldap_fingerprints.py index 337edb61..0c2a7bd8 100755 --- a/dak/import_ldap_fingerprints.py +++ b/dak/import_ldap_fingerprints.py @@ -84,9 +84,9 @@ def main(): if not cnf.has_key("Import-LDAP-Fingerprints::Options::%s" % (i)): cnf["Import-LDAP-Fingerprints::Options::%s" % (i)] = "" - apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv) + apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv) - Options = cnf.SubTree("Import-LDAP-Fingerprints::Options") + Options = cnf.subtree("Import-LDAP-Fingerprints::Options") if Options["Help"]: usage() @@ -173,7 +173,7 @@ SELECT f.fingerprint, f.id, u.uid FROM fingerprint f, uid u WHERE f.uid = u.id print "Assigning %s to 0x%s." % (uid, fingerprint) else: extra_keyrings = "" - for keyring in cnf.ValueList("Import-LDAP-Fingerprints::ExtraKeyrings"): + for keyring in cnf.value_list("Import-LDAP-Fingerprints::ExtraKeyrings"): extra_keyrings += " --keyring=%s" % (keyring) cmd = "gpg %s %s --list-key %s" \ % (utils.gpg_keyring_args(), extra_keyrings, fingerprint) diff --git a/dak/import_new_files.py b/dak/import_new_files.py index 5b132c82..7a29467a 100755 --- a/dak/import_new_files.py +++ b/dak/import_new_files.py @@ -158,7 +158,7 @@ def main(): ('v',"verbose", "%s::%s" % (options_prefix,"Verbose")), ] - args = apt_pkg.ParseCommandLine(cnf.Cnf, arguments,sys.argv) + args = apt_pkg.parse_commandline(cnf.Cnf, arguments,sys.argv) num_threads = 1 diff --git a/dak/import_users_from_passwd.py b/dak/import_users_from_passwd.py index a9dacd34..ae99ef90 100755 --- a/dak/import_users_from_passwd.py +++ b/dak/import_users_from_passwd.py @@ -63,8 +63,8 @@ def main (): if not cnf.has_key("Import-Users-From-Passwd::Options::%s" % (i)): cnf["Import-Users-From-Passwd::Options::%s" % (i)] = "" - arguments = apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv) - Options = cnf.SubTree("Import-Users-From-Passwd::Options") + arguments = apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv) + Options = cnf.subtree("Import-Users-From-Passwd::Options") if Options["Help"]: usage() diff --git a/dak/init_dirs.py b/dak/init_dirs.py index fc5efd32..fdd7da96 100755 --- a/dak/init_dirs.py +++ b/dak/init_dirs.py @@ -63,7 +63,7 @@ def process_file(config, config_name): def process_tree(config, tree): """Create directories for a config tree.""" - for entry in config.SubTree(tree).List(): + for entry in config.subtree(tree).list(): entry = entry.lower() config_name = "%s::%s" % (tree, entry) target = config[config_name] @@ -121,7 +121,7 @@ def create_directories(): for subdir in [ "Clean-Queues", "Clean-Suites" ]: process_morguesubdir(subdir) - suite_suffix = "%s" % (Cnf.Find("Dinstall::SuiteSuffix")) + suite_suffix = "%s" % (Cnf.find("Dinstall::SuiteSuffix")) # Process secret keyrings if Cnf.has_key('Dinstall::SigningKeyring'): @@ -179,9 +179,9 @@ def main (): d = DBConn() - arguments = apt_pkg.ParseCommandLine(Cnf, arguments, sys.argv) + arguments = apt_pkg.parse_commandline(Cnf, arguments, sys.argv) - options = Cnf.SubTree("Init-Dirs::Options") + options = Cnf.subtree("Init-Dirs::Options") if options["Help"]: usage() elif arguments: diff --git a/dak/ls.py b/dak/ls.py index 66e8d427..79f417fd 100755 --- a/dak/ls.py +++ b/dak/ls.py @@ -80,8 +80,8 @@ def main (): if not cnf.has_key("Ls::Options::%s" % (i)): cnf["Ls::Options::%s" % (i)] = "" - packages = apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv) - Options = cnf.SubTree("Ls::Options") + packages = apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv) + Options = cnf.subtree("Ls::Options") if Options["Help"]: usage() @@ -166,7 +166,7 @@ SELECT s.source, s.version, 'source', su.suite_name, c.name, m.name highver.setdefault(pkg,"") if not d[pkg].has_key(version): d[pkg][version] = {} - if apt_pkg.VersionCompare(version, highver[pkg]) > 0: + if apt_pkg.version_compare(version, highver[pkg]) > 0: highver[pkg] = version if not d[pkg][version].has_key(suite): d[pkg][version][suite] = [] @@ -176,7 +176,7 @@ SELECT s.source, s.version, 'source', su.suite_name, c.name, m.name packages.sort() for pkg in packages: versions = d[pkg].keys() - versions.sort(apt_pkg.VersionCompare) + versions.sort(apt_pkg.version_compare) for version in versions: suites = d[pkg][version].keys() suites.sort() diff --git a/dak/make_changelog.py b/dak/make_changelog.py index ad6dbab1..2fe77fe6 100755 --- a/dak/make_changelog.py +++ b/dak/make_changelog.py @@ -263,8 +263,8 @@ def main(): if not Cnf.has_key('Make-Changelog::Options::%s' % (i)): Cnf['Make-Changelog::Options::%s' % (i)] = '' - apt_pkg.ParseCommandLine(Cnf, Arguments, sys.argv) - Options = Cnf.SubTree('Make-Changelog::Options') + apt_pkg.parse_commandline(Cnf, Arguments, sys.argv) + Options = Cnf.subtree('Make-Changelog::Options') suite = Cnf['Make-Changelog::Options::Suite'] base_suite = Cnf['Make-Changelog::Options::Base-Suite'] binnmu = Cnf['Make-Changelog::Options::binNMU'] diff --git a/dak/make_maintainers.py b/dak/make_maintainers.py index 8e93f8af..b7f72985 100755 --- a/dak/make_maintainers.py +++ b/dak/make_maintainers.py @@ -71,8 +71,8 @@ def main(): if not cnf.has_key("Make-Maintainers::Options::Help"): cnf["Make-Maintainers::Options::Help"] = "" - extra_files = apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv) - Options = cnf.SubTree("Make-Maintainers::Options") + extra_files = apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv) + Options = cnf.subtree("Make-Maintainers::Options") if Options["Help"]: usage() diff --git a/dak/make_overrides.py b/dak/make_overrides.py index 1d8f9c02..140ada9f 100755 --- a/dak/make_overrides.py +++ b/dak/make_overrides.py @@ -104,8 +104,8 @@ def main (): for i in [ "help" ]: if not cnf.has_key("Make-Overrides::Options::%s" % (i)): cnf["Make-Overrides::Options::%s" % (i)] = "" - apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv) - Options = cnf.SubTree("Make-Overrides::Options") + apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv) + Options = cnf.subtree("Make-Overrides::Options") if Options["Help"]: usage() diff --git a/dak/manage_build_queues.py b/dak/manage_build_queues.py index a292b4ae..b6342b1e 100755 --- a/dak/manage_build_queues.py +++ b/dak/manage_build_queues.py @@ -67,8 +67,8 @@ def main (): ('n',"no-action","Manage-Build-Queues::Options::No-Action"), ('a',"all","Manage-Build-Queues::Options::All")] - queue_names = apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv) - Options = cnf.SubTree("Manage-Build-Queues::Options") + queue_names = apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv) + Options = cnf.subtree("Manage-Build-Queues::Options") if Options["Help"]: usage() diff --git a/dak/metadata.py b/dak/metadata.py index 1fe32110..b4c1d585 100755 --- a/dak/metadata.py +++ b/dak/metadata.py @@ -86,8 +86,8 @@ def main(): ('l', "limit", 'Metadata::Options::Limit', "HasArg"), ('f', "force", 'Metadata::Options::Force'), ] - args = apt_pkg.ParseCommandLine(cnf.Cnf, arguments, sys.argv) - options = cnf.SubTree('Metadata::Options') + args = apt_pkg.parse_commandline(cnf.Cnf, arguments, sys.argv) + options = cnf.subtree('Metadata::Options') if (len(args) != 1) or options['Help']: usage() diff --git a/dak/new_security_install.py b/dak/new_security_install.py index fb2d5ccf..026dcced 100755 --- a/dak/new_security_install.py +++ b/dak/new_security_install.py @@ -142,9 +142,9 @@ def main(): if not cnf.has_key("Security::Options::%s" % (i)): cnf["Security::Options::%s" % (i)] = "" - changes_files = apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv) + changes_files = apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv) - Options = cnf.SubTree("Security::Options") + Options = cnf.subtree("Security::Options") if Options['Help']: usage() diff --git a/dak/override.py b/dak/override.py index de888e55..ce5d12ff 100755 --- a/dak/override.py +++ b/dak/override.py @@ -124,8 +124,8 @@ def main (): if not cnf.has_key("Override::Options::Suite"): cnf["Override::Options::Suite"] = "unstable" - arguments = apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv) - Options = cnf.SubTree("Override::Options") + arguments = apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv) + Options = cnf.subtree("Override::Options") if Options["Help"]: usage() @@ -295,7 +295,7 @@ def main (): Subst["__OVERRIDE_ADDRESS__"] = cnf["Dinstall::MyEmailAddress"] Subst["__BUG_SERVER__"] = cnf["Dinstall::BugServer"] bcc = [] - if cnf.Find("Dinstall::Bcc") != "": + if cnf.find("Dinstall::Bcc") != "": bcc.append(cnf["Dinstall::Bcc"]) if bcc: Subst["__BCC__"] = "Bcc: " + ", ".join(bcc) diff --git a/dak/override_disparity.py b/dak/override_disparity.py index 3ec6ff1f..6cb392df 100755 --- a/dak/override_disparity.py +++ b/dak/override_disparity.py @@ -73,8 +73,8 @@ def main(): if not cnf.has_key('Override-Disparity::Options::Suite'): cnf['Override-Disparity::Options::Suite'] = 'unstable' - apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv) - Options = cnf.SubTree('Override-Disparity::Options') + apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv) + Options = cnf.subtree('Override-Disparity::Options') if Options['help']: usage() diff --git a/dak/process_new.py b/dak/process_new.py index 1c2231a3..11950f14 100755 --- a/dak/process_new.py +++ b/dak/process_new.py @@ -368,10 +368,10 @@ def do_bxa_notification(upload): summary = "" for f in files.keys(): if files[f]["type"] == "deb": - control = apt_pkg.ParseSection(apt_inst.debExtractControl(utils.open_file(f))) + control = apt_pkg.TagSection(utils.deb_extract_control(utils.open_file(f))) summary += "\n" - summary += "Package: %s\n" % (control.Find("Package")) - summary += "Description: %s\n" % (control.Find("Description")) + summary += "Package: %s\n" % (control.find("Package")) + summary += "Description: %s\n" % (control.find("Description")) upload.Subst["__BINARY_DESCRIPTIONS__"] = summary bxa_mail = utils.TemplateSubst(upload.Subst,Config()["Dir::Templates"]+"/process-new.bxa_notification") utils.send_mail(bxa_mail) @@ -400,7 +400,7 @@ def add_overrides (new, upload, session): session.commit() - if Config().FindB("Dinstall::BXANotify"): + if Config().find_b("Dinstall::BXANotify"): do_bxa_notification(upload) ################################################################################ @@ -774,14 +774,14 @@ def main(): if not cnf.has_key("Process-New::Options::%s" % (i)): cnf["Process-New::Options::%s" % (i)] = "" - changes_files = apt_pkg.ParseCommandLine(cnf.Cnf,Arguments,sys.argv) + changes_files = apt_pkg.parse_commandline(cnf.Cnf,Arguments,sys.argv) if len(changes_files) == 0: new_queue = get_policy_queue('new', session ); changes_paths = [ os.path.join(new_queue.path, j) for j in utils.get_changes_files(new_queue.path) ] else: changes_paths = [ os.path.abspath(j) for j in changes_files ] - Options = cnf.SubTree("Process-New::Options") + Options = cnf.subtree("Process-New::Options") if Options["Help"]: usage() diff --git a/dak/process_policy.py b/dak/process_policy.py index 3f237f62..e401a3bd 100755 --- a/dak/process_policy.py +++ b/dak/process_policy.py @@ -126,7 +126,7 @@ def main(): if not cnf.has_key("Process-Policy::Options::%s" % (i)): cnf["Process-Policy::Options::%s" % (i)] = "" - queue_name = apt_pkg.ParseCommandLine(cnf.Cnf,Arguments,sys.argv) + queue_name = apt_pkg.parse_commandline(cnf.Cnf,Arguments,sys.argv) if len(queue_name) != 1: print "E: Specify exactly one policy queue" @@ -134,7 +134,7 @@ def main(): queue_name = queue_name[0] - Options = cnf.SubTree("Process-Policy::Options") + Options = cnf.subtree("Process-Policy::Options") if Options["Help"]: usage() diff --git a/dak/process_upload.py b/dak/process_upload.py index 4d9f3b00..53ab7cc9 100755 --- a/dak/process_upload.py +++ b/dak/process_upload.py @@ -439,8 +439,8 @@ def main(): if not cnf.has_key("Dinstall::Options::%s" % (i)): cnf["Dinstall::Options::%s" % (i)] = "" - changes_files = apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv) - Options = cnf.SubTree("Dinstall::Options") + changes_files = apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv) + Options = cnf.subtree("Dinstall::Options") if Options["Help"]: usage() diff --git a/dak/queue_report.py b/dak/queue_report.py index 862a6d20..a3b59738 100755 --- a/dak/queue_report.py +++ b/dak/queue_report.py @@ -619,9 +619,9 @@ def main(): if not Cnf.has_key("Queue-Report::Options::%s" % (i)): Cnf["Queue-Report::Options::%s" % (i)] = "" - apt_pkg.ParseCommandLine(Cnf, Arguments, sys.argv) + apt_pkg.parse_commandline(Cnf, Arguments, sys.argv) - Options = Cnf.SubTree("Queue-Report::Options") + Options = Cnf.subtree("Queue-Report::Options") if Options["Help"]: usage() @@ -637,7 +637,7 @@ def main(): for i in Cnf["Queue-Report::Options::Directories"].split(","): queue_names.append(i) elif Cnf.has_key("Queue-Report::Directories"): - queue_names = Cnf.ValueList("Queue-Report::Directories") + queue_names = Cnf.value_list("Queue-Report::Directories") else: queue_names = [ "byhand", "new" ] diff --git a/dak/rm.py b/dak/rm.py index 03d12f0f..bbd4b458 100755 --- a/dak/rm.py +++ b/dak/rm.py @@ -289,8 +289,8 @@ def main (): if not cnf.has_key("Rm::Options::Suite"): cnf["Rm::Options::Suite"] = "unstable" - arguments = apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv) - Options = cnf.SubTree("Rm::Options") + arguments = apt_pkg.parse_commandline(cnf.Cnf, Arguments, sys.argv) + Options = cnf.subtree("Rm::Options") if Options["Help"]: usage() @@ -441,8 +441,8 @@ def main (): q = session.execute("SELECT l.path, f.filename, b.package, b.version, a.arch_string, b.id, b.maintainer FROM binaries b, bin_associations ba, architecture a, suite su, files f, location l, component c WHERE ba.bin = b.id AND ba.suite = su.id AND b.architecture = a.id AND b.file = f.id AND f.location = l.id AND l.component = c.id %s %s %s AND b.package = '%s'" % (con_suites, con_components, con_architectures, package)) for i in q.fetchall(): filename = "/".join(i[:2]) - control = apt_pkg.ParseSection(apt_inst.debExtractControl(utils.open_file(filename))) - source = control.Find("Source", control.Find("Package")) + control = apt_pkg.TagSection(utils.deb_extract_control(utils.open_file(filename))) + source = control.find("Source", control.find("Package")) source = re_strip_source_version.sub('', source) if source_packages.has_key(source): to_remove.append(i[2:]) @@ -490,7 +490,7 @@ def main (): versions = [] for package in removals: versions = d[package].keys() - versions.sort(apt_pkg.VersionCompare) + versions.sort(apt_pkg.version_compare) for version in versions: d[package][version].sort(utils.arch_compare_sw) summary += "%10s | %10s | %s\n" % (package, version, ", ".join(d[package][version])) @@ -623,9 +623,9 @@ def main (): if Options["Done"]: Subst_close_rm = Subst_common bcc = [] - if cnf.Find("Dinstall::Bcc") != "": + if cnf.find("Dinstall::Bcc") != "": bcc.append(cnf["Dinstall::Bcc"]) - if cnf.Find("Rm::Bcc") != "": + if cnf.find("Rm::Bcc") != "": bcc.append(cnf["Rm::Bcc"]) if bcc: Subst_close_rm["__BCC__"] = "Bcc: " + ", ".join(bcc) diff --git a/dak/show_deferred.py b/dak/show_deferred.py index f9f24d6f..e7dded0f 100755 --- a/dak/show_deferred.py +++ b/dak/show_deferred.py @@ -269,7 +269,7 @@ def init(): ("p","link-path","Show-Deferred::LinkPath","HasArg"), ("d","deferred-queue","Show-Deferred::DeferredQueue","HasArg"), ('r',"rrd","Show-Deferred::Options::Rrd", "HasArg")] - args = apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv) + args = apt_pkg.parse_commandline(Cnf,Arguments,sys.argv) for i in ["help"]: if not Cnf.has_key("Show-Deferred::Options::%s" % (i)): Cnf["Show-Deferred::Options::%s" % (i)] = "" @@ -278,7 +278,7 @@ def init(): print >> sys.stderr, """Show-Deferred::%s is mandatory. set via config file or command-line option %s"""%(i,j) - Options = Cnf.SubTree("Show-Deferred::Options") + Options = Cnf.subtree("Show-Deferred::Options") if Options["help"]: usage() diff --git a/dak/show_new.py b/dak/show_new.py index 5d45c844..eac91d8a 100755 --- a/dak/show_new.py +++ b/dak/show_new.py @@ -258,12 +258,12 @@ def init(session): if not cnf.has_key("Show-New::Options::%s" % (i)): cnf["Show-New::Options::%s" % (i)] = "" - changes_files = apt_pkg.ParseCommandLine(cnf.Cnf,Arguments,sys.argv) + changes_files = apt_pkg.parse_commandline(cnf.Cnf,Arguments,sys.argv) if len(changes_files) == 0: new_queue = get_policy_queue('new', session ); changes_files = utils.get_changes_files(new_queue.path) - Options = cnf.SubTree("Show-New::Options") + Options = cnf.subtree("Show-New::Options") if Options["help"]: usage() diff --git a/dak/stats.py b/dak/stats.py index bbd58881..f3387347 100755 --- a/dak/stats.py +++ b/dak/stats.py @@ -198,9 +198,9 @@ def main (): if not Cnf.has_key("Stats::Options::%s" % (i)): Cnf["Stats::Options::%s" % (i)] = "" - args = apt_pkg.ParseCommandLine(Cnf, Arguments, sys.argv) + args = apt_pkg.parse_commandline(Cnf, Arguments, sys.argv) - Options = Cnf.SubTree("Stats::Options") + Options = Cnf.subtree("Stats::Options") if Options["Help"]: usage() diff --git a/dak/transitions.py b/dak/transitions.py index a5eb6b6c..7409f6f9 100755 --- a/dak/transitions.py +++ b/dak/transitions.py @@ -76,9 +76,9 @@ def init(): if not Cnf.has_key("Edit-Transitions::Options::%s" % (i)): Cnf["Edit-Transitions::Options::%s" % (i)] = "" - apt_pkg.ParseCommandLine(Cnf, Arguments, sys.argv) + apt_pkg.parse_commandline(Cnf, Arguments, sys.argv) - Options = Cnf.SubTree("Edit-Transitions::Options") + Options = Cnf.subtree("Edit-Transitions::Options") if Options["help"]: usage() @@ -415,7 +415,7 @@ def check_transitions(transitions): print "Transition source %s not in testing, transition still ongoing." % (source) else: current = sourceobj.version - compare = apt_pkg.VersionCompare(current, expected) + compare = apt_pkg.version_compare(current, expected) if compare < 0: # This is still valid, the current version in database is older than # the new version we wait for @@ -540,7 +540,7 @@ def transition_info(transitions): # No package in testing print "Transition source %s not in testing, transition still ongoing." % (source) else: - compare = apt_pkg.VersionCompare(sourceobj.version, expected) + compare = apt_pkg.version_compare(sourceobj.version, expected) print "Apt compare says: %s" % (compare) if compare < 0: # This is still valid, the current version in database is older than diff --git a/dak/update_db.py b/dak/update_db.py index 2a946822..36ba93aa 100755 --- a/dak/update_db.py +++ b/dak/update_db.py @@ -190,9 +190,9 @@ Updates dak's database schema to the lastest version. You should disable crontab if not cnf.has_key("Update-DB::Options::%s" % (i)): cnf["Update-DB::Options::%s" % (i)] = "" - arguments = apt_pkg.ParseCommandLine(cnf.Cnf, arguments, sys.argv) + arguments = apt_pkg.parse_commandline(cnf.Cnf, arguments, sys.argv) - options = cnf.SubTree("Update-DB::Options") + options = cnf.subtree("Update-DB::Options") if options["Help"]: self.usage() elif arguments: diff --git a/daklib/changes.py b/daklib/changes.py index 1214b03b..d6ccaa00 100644 --- a/daklib/changes.py +++ b/daklib/changes.py @@ -34,10 +34,9 @@ import datetime from cPickle import Unpickler, Pickler from errno import EPERM -from apt_inst import debExtractControl -from apt_pkg import ParseSection +from apt_pkg import TagSection -from utils import open_file, fubar, poolify +from utils import open_file, fubar, poolify, deb_extract_control from config import * from dbconn import * @@ -127,7 +126,7 @@ class Changes(object): if entry["type"] == "deb": deb_fh = open_file(name) - summary += ParseSection(debExtractControl(deb_fh))["Description"] + '\n' + summary += TagSection(deb_extract_control(deb_fh))["Description"] + '\n' deb_fh.close() else: diff --git a/daklib/changesutils.py b/daklib/changesutils.py index 3a4c6dd7..d1dbad84 100755 --- a/daklib/changesutils.py +++ b/daklib/changesutils.py @@ -45,7 +45,7 @@ def indiv_sg_compare (a, b): """Sort by source name, source, version, 'have source', and finally by filename.""" # Sort by source version - q = apt_pkg.VersionCompare(a["version"], b["version"]) + q = apt_pkg.version_compare(a["version"], b["version"]) if q: return -q diff --git a/daklib/config.py b/daklib/config.py index dc90d49a..7e3c8bac 100755 --- a/daklib/config.py +++ b/daklib/config.py @@ -65,24 +65,24 @@ class Config(object): def _readconf(self): apt_pkg.init() - self.Cnf = apt_pkg.newConfiguration() + self.Cnf = apt_pkg.Configuration() - apt_pkg.ReadConfigFileISC(self.Cnf, which_conf_file()) + apt_pkg.read_config_file_isc(self.Cnf, which_conf_file()) # Check whether our dak.conf was the real one or # just a pointer to our main one res = socket.gethostbyaddr(socket.gethostname()) conffile = self.Cnf.get("Config::" + res[0] + "::DakConfig") if conffile: - apt_pkg.ReadConfigFileISC(self.Cnf, conffile) + apt_pkg.read_config_file_isc(self.Cnf, conffile) # Rebind some functions # TODO: Clean this up self.get = self.Cnf.get - self.SubTree = self.Cnf.SubTree - self.ValueList = self.Cnf.ValueList - self.Find = self.Cnf.Find - self.FindB = self.Cnf.FindB + self.subtree = self.Cnf.subtree + self.value_list = self.Cnf.value_list + self.find = self.Cnf.find + self.find_b = self.Cnf.find_b def has_key(self, name): return self.Cnf.has_key(name) diff --git a/daklib/dbconn.py b/daklib/dbconn.py index c0295e17..80a1f233 100755 --- a/daklib/dbconn.py +++ b/daklib/dbconn.py @@ -75,6 +75,7 @@ from sqlalchemy.orm.exc import NoResultFound from config import Config from textutils import fix_maintainer from dak_exceptions import DBUpdateError, NoSourceFieldError, FileExistsError +import utils # suppress some deprecation warnings in squeeze related to sqlalchemy import warnings @@ -561,7 +562,7 @@ class DBBinary(ORMObject): import apt_inst fullpath = self.poolfile.fullpath deb_file = open(fullpath, 'r') - stanza = apt_inst.debExtractControl(deb_file) + stanza = utils.deb_extract_control(deb_file) deb_file.close() return stanza diff --git a/daklib/queue.py b/daklib/queue.py index 2f347f47..d0772276 100755 --- a/daklib/queue.py +++ b/daklib/queue.py @@ -655,7 +655,7 @@ class Upload(object): Cnf = Config() # Handle suite mappings - for m in Cnf.ValueList("SuiteMappings"): + for m in Cnf.value_list("SuiteMappings"): args = m.split() mtype = args[0] if mtype == "map" or mtype == "silent-map": @@ -713,9 +713,9 @@ class Upload(object): # Extract package control information deb_file = utils.open_file(f) try: - control = apt_pkg.ParseSection(apt_inst.debExtractControl(deb_file)) + control = apt_pkg.TagSection(utils.deb_extract_control(deb_file)) except: - self.rejects.append("%s: debExtractControl() raised %s." % (f, sys.exc_info()[0])) + self.rejects.append("%s: deb_extract_control() raised %s." % (f, sys.exc_info()[0])) deb_file.close() # Can't continue, none of the checks on control would work. return @@ -724,28 +724,28 @@ class Upload(object): # Check for mandatory fields for field in [ "Package", "Architecture", "Version", "Description" ]: - if control.Find(field) == None: + if field not in control: # Can't continue self.rejects.append("%s: No %s field in control." % (f, field)) return # Ensure the package name matches the one give in the .changes - if not self.pkg.changes["binary"].has_key(control.Find("Package", "")): - self.rejects.append("%s: control file lists name as `%s', which isn't in changes file." % (f, control.Find("Package", ""))) + if not self.pkg.changes["binary"].has_key(control.find("Package", "")): + self.rejects.append("%s: control file lists name as `%s', which isn't in changes file." % (f, control.find("Package", ""))) # Validate the package field - package = control.Find("Package") + package = control["Package"] if not re_valid_pkg_name.match(package): self.rejects.append("%s: invalid package name '%s'." % (f, package)) # Validate the version field - version = control.Find("Version") + version = control["Version"] if not re_valid_version.match(version): self.rejects.append("%s: invalid version number '%s'." % (f, version)) # Ensure the architecture of the .deb is one we know about. default_suite = cnf.get("Dinstall::DefaultSuite", "unstable") - architecture = control.Find("Architecture") + architecture = control["Architecture"] upload_suite = self.pkg.changes["distribution"].keys()[0] if architecture not in [a.arch_string for a in get_suite_architectures(default_suite, session = session)] \ @@ -758,13 +758,13 @@ class Upload(object): self.rejects.append("%s: control file lists arch as `%s', which isn't in changes file." % (f, architecture)) # Sanity-check the Depends field - depends = control.Find("Depends") + depends = control.find("Depends") if depends == '': self.rejects.append("%s: Depends field is empty." % (f)) # Sanity-check the Provides field - provides = control.Find("Provides") - if provides: + provides = control.find("Provides") + if provides is not None: provide = re_spacestrip.sub('', provides) if provide == '': self.rejects.append("%s: Provides field is empty." % (f)) @@ -775,8 +775,8 @@ class Upload(object): # If there is a Built-Using field, we need to check we can find the # exact source version - built_using = control.Find("Built-Using") - if built_using: + built_using = control.find("Built-Using") + if built_using is not None: try: entry["built-using"] = [] for dep in apt_pkg.parse_depends(built_using): @@ -798,19 +798,19 @@ class Upload(object): # Check the section & priority match those given in the .changes (non-fatal) - if control.Find("Section") and entry["section"] != "" \ - and entry["section"] != control.Find("Section"): + if control.find("Section") and entry["section"] != "" \ + and entry["section"] != control.find("Section"): self.warnings.append("%s control file lists section as `%s', but changes file has `%s'." % \ - (f, control.Find("Section", ""), entry["section"])) - if control.Find("Priority") and entry["priority"] != "" \ - and entry["priority"] != control.Find("Priority"): + (f, control.find("Section", ""), entry["section"])) + if control.find("Priority") and entry["priority"] != "" \ + and entry["priority"] != control.find("Priority"): self.warnings.append("%s control file lists priority as `%s', but changes file has `%s'." % \ - (f, control.Find("Priority", ""), entry["priority"])) + (f, control.find("Priority", ""), entry["priority"])) entry["package"] = package entry["architecture"] = architecture entry["version"] = version - entry["maintainer"] = control.Find("Maintainer", "") + entry["maintainer"] = control.find("Maintainer", "") if f.endswith(".udeb"): self.pkg.files[f]["dbtype"] = "udeb" @@ -819,7 +819,7 @@ class Upload(object): else: self.rejects.append("%s is neither a .deb or a .udeb." % (f)) - entry["source"] = control.Find("Source", entry["package"]) + entry["source"] = control.find("Source", entry["package"]) # Get the source version source = entry["source"] @@ -844,7 +844,7 @@ class Upload(object): if entry["package"] != file_package: self.rejects.append("%s: package part of filename (%s) does not match package name in the %s (%s)." % \ (f, file_package, entry["dbtype"], entry["package"])) - epochless_version = re_no_epoch.sub('', control.Find("Version")) + epochless_version = re_no_epoch.sub('', control.find("Version")) # version file_version = m.group(2) @@ -954,7 +954,7 @@ class Upload(object): return # Handle component mappings - for m in cnf.ValueList("ComponentMappings"): + for m in cnf.value_list("ComponentMappings"): (source, dest) = m.split() if entry["component"] == source: entry["original component"] = source @@ -1108,7 +1108,7 @@ class Upload(object): if not has_source: self.rejects.append("no source found and Architecture line in changes mention source.") - if (not has_binaries) and (not cnf.FindB("Dinstall::AllowSourceOnlyUploads")): + if (not has_binaries) and (not cnf.find_b("Dinstall::AllowSourceOnlyUploads")): self.rejects.append("source only uploads are not supported.") ########################################################################### @@ -1235,7 +1235,7 @@ class Upload(object): if field: # Have apt try to parse them... try: - apt_pkg.ParseSrcDepends(field) + apt_pkg.parse_src_depends(field) except: self.rejects.append("%s: invalid %s field (can not be parsed by apt)." % (dsc_filename, field_name.title())) @@ -1322,7 +1322,7 @@ class Upload(object): self.rejects.append("'dpkg-source -x' failed for %s. (%s)" % (dsc_filename, str(e))) return - if not cnf.Find("Dir::BTSVersionTrack"): + if not cnf.find("Dir::BTSVersionTrack"): return # Get the upstream version @@ -1606,7 +1606,7 @@ class Upload(object): if not self.pkg.changes.has_key("urgency"): self.pkg.changes["urgency"] = cnf["Urgency::Default"] self.pkg.changes["urgency"] = self.pkg.changes["urgency"].lower() - if self.pkg.changes["urgency"] not in cnf.ValueList("Urgency::Valid"): + if self.pkg.changes["urgency"] not in cnf.value_list("Urgency::Valid"): self.warnings.append("%s is not a valid urgency; it will be treated as %s by testing." % \ (self.pkg.changes["urgency"], cnf["Urgency::Default"])) self.pkg.changes["urgency"] = cnf["Urgency::Default"] @@ -1880,7 +1880,7 @@ class Upload(object): # Will be None if nothing is in testing. current = get_source_in_suite(source, "testing", session) if current is not None: - compare = apt_pkg.VersionCompare(current.version, expected) + compare = apt_pkg.version_compare(current.version, expected) if current is None or compare < 0: # This is still valid, the current version in testing is older than @@ -2047,7 +2047,7 @@ distribution.""" del self.Subst["__ANNOUNCE_LIST_ADDRESS__"] - if cnf.FindB("Dinstall::CloseBugs") and cnf.has_key("Dinstall::BugServer"): + if cnf.find_b("Dinstall::CloseBugs") and cnf.has_key("Dinstall::BugServer"): summary = self.close_bugs(summary, action) del self.Subst["__SHORT_SUMMARY__"] @@ -2211,7 +2211,7 @@ distribution.""" self.announce(short_summary, 1) ## Helper stuff for DebBugs Version Tracking - if cnf.Find("Dir::BTSVersionTrack"): + if cnf.find("Dir::BTSVersionTrack"): if self.pkg.changes["architecture"].has_key("source"): (fd, temp_filename) = utils.temp_filename(cnf["Dir::BTSVersionTrack"], prefix=".") version_history = os.fdopen(fd, 'w') @@ -2264,7 +2264,7 @@ distribution.""" cnf = Config() # Abandon the check if override disparity checks have been disabled - if not cnf.FindB("Dinstall::OverrideDisparityCheck"): + if not cnf.find_b("Dinstall::OverrideDisparityCheck"): return summary = self.pkg.check_override() @@ -2540,7 +2540,7 @@ distribution.""" anysuite = [suite] + [ vc.reference.suite_name for vc in get_version_checks(suite, "Enhances") ] for (s, v) in sv_list: if s in [ x.lower() for x in anysuite ]: - if not anyversion or apt_pkg.VersionCompare(anyversion, v) <= 0: + if not anyversion or apt_pkg.version_compare(anyversion, v) <= 0: anyversion = v return anyversion @@ -2581,7 +2581,7 @@ distribution.""" must_be_newer_than.append(target_suite) for (suite, existent_version) in sv_list: - vercmp = apt_pkg.VersionCompare(new_version, existent_version) + vercmp = apt_pkg.version_compare(new_version, existent_version) if suite in must_be_newer_than and sourceful and vercmp < 1: self.rejects.append("%s: old version (%s) in %s >= new version (%s) targeted at %s." % (filename, existent_version, suite, new_version, target_suite)) @@ -2615,12 +2615,12 @@ distribution.""" # we could just stick with the "...old version..." REJECT # for this, I think. self.rejects.append("Won't propogate NEW packages.") - elif apt_pkg.VersionCompare(new_version, add_version) < 0: + elif apt_pkg.version_compare(new_version, add_version) < 0: # propogation would be redundant. no need to reject though. self.warnings.append("ignoring versionconflict: %s: old version (%s) in %s <= new version (%s) targeted at %s." % (filename, existent_version, suite, new_version, target_suite)) cansave = 1 - elif apt_pkg.VersionCompare(new_version, add_version) > 0 and \ - apt_pkg.VersionCompare(add_version, target_version) >= 0: + elif apt_pkg.version_compare(new_version, add_version) > 0 and \ + apt_pkg.version_compare(add_version, target_version) >= 0: # propogate!! self.warnings.append("Propogating upload to %s" % (addsuite)) self.pkg.changes.setdefault("propdistribution", {}) diff --git a/daklib/queue_install.py b/daklib/queue_install.py index fac21f99..8f05e7bf 100755 --- a/daklib/queue_install.py +++ b/daklib/queue_install.py @@ -178,7 +178,7 @@ def is_autobyhand(u): all_auto = 0 continue - ABH = cnf.SubTree("AutomaticByHandPackages") + ABH = cnf.subtree("AutomaticByHandPackages") if not ABH.has_key(pckg) or \ ABH["%s::Source" % (pckg)] != u.pkg.changes["source"]: print "not match %s %s" % (pckg, u.pkg.changes["source"]) diff --git a/daklib/utils.py b/daklib/utils.py index 0b8a08d5..83f556b2 100755 --- a/daklib/utils.py +++ b/daklib/utils.py @@ -762,7 +762,7 @@ def which_conf_file (): res = socket.getfqdn() # In case we allow local config files per user, try if one exists - if Cnf.FindB("Config::" + res + "::AllowLocalConfig"): + if Cnf.find_b("Config::" + res + "::AllowLocalConfig"): homedir = os.getenv("HOME") confpath = os.path.join(homedir, "/etc/dak.conf") if os.path.exists(confpath): @@ -778,7 +778,7 @@ def which_conf_file (): def which_apt_conf_file (): res = socket.getfqdn() # In case we allow local config files per user, try if one exists - if Cnf.FindB("Config::" + res + "::AllowLocalConfig"): + if Cnf.find_b("Config::" + res + "::AllowLocalConfig"): homedir = os.getenv("HOME") confpath = os.path.join(homedir, "/etc/dak.conf") if os.path.exists(confpath): @@ -874,7 +874,7 @@ def changes_compare (a, b): # Sort by source version a_version = a_changes.get("version", "0") b_version = b_changes.get("version", "0") - q = apt_pkg.VersionCompare(a_version, b_version) + q = apt_pkg.version_compare(a_version, b_version) if q: return q @@ -1547,12 +1547,12 @@ def get_changes_files(from_dir): apt_pkg.init() -Cnf = apt_pkg.newConfiguration() +Cnf = apt_pkg.Configuration() if not os.getenv("DAK_TEST"): - apt_pkg.ReadConfigFileISC(Cnf,default_config) + apt_pkg.read_config_file_isc(Cnf,default_config) if which_conf_file() != default_config: - apt_pkg.ReadConfigFileISC(Cnf,which_conf_file()) + apt_pkg.read_config_file_isc(Cnf,which_conf_file()) ################################################################################