From: Ansgar Burchardt Date: Sat, 25 May 2013 11:20:34 +0000 (+0200) Subject: stop using deprecated methods from apt_pkg X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52c35949e1e7948a29133ffc9b24897d66af23c1;p=dak stop using deprecated methods from apt_pkg More deprecated python-apt stuff: renamed methods in apt_pkg.TagFile: Section -> section Step -> step renamed methods in apt_pkg.TagSection: Find -> find Reported-by: Matthias Klumpp Reference: https://lists.debian.org/debian-dak/2013/03/msg00028.html --- diff --git a/dak/check_archive.py b/dak/check_archive.py index d0c71d47..5265cc50 100755 --- a/dak/check_archive.py +++ b/dak/check_archive.py @@ -391,10 +391,10 @@ def validate_sources(suite, component): sys.exit(result) sources = utils.open_file(temp_filename) Sources = apt_pkg.TagFile(sources) - while Sources.Step(): - source = Sources.Section.Find('Package') - directory = Sources.Section.Find('Directory') - files = Sources.Section.Find('Files') + while Sources.step(): + source = Sources.section.find('Package') + directory = Sources.section.find('Directory') + files = Sources.section.find('Files') for i in files.split('\n'): (md5, size, name) = i.split() filename = "%s/%s/%s" % (Cnf["Dir::Root"], directory, name) @@ -434,7 +434,7 @@ def validate_packages(suite, component, architecture): packages = utils.open_file(temp_filename) Packages = apt_pkg.TagFile(packages) while Packages.Step(): - filename = "%s/%s" % (Cnf["Dir::Root"], Packages.Section.Find('Filename')) + filename = "%s/%s" % (Cnf["Dir::Root"], Packages.section.find('Filename')) if not os.path.exists(filename): print "W: %s missing." % (filename) packages.close() diff --git a/dak/cruft_report.py b/dak/cruft_report.py index 812a39b2..7dedceed 100755 --- a/dak/cruft_report.py +++ b/dak/cruft_report.py @@ -689,11 +689,11 @@ def main (): sys.exit(result) sources = utils.open_file(temp_filename) Sources = apt_pkg.TagFile(sources) - while Sources.Step(): - source = Sources.Section.Find('Package') - source_version = Sources.Section.Find('Version') - architecture = Sources.Section.Find('Architecture') - binaries = Sources.Section.Find('Binary') + while Sources.step(): + source = Sources.section.find('Package') + source_version = Sources.section.find('Version') + architecture = Sources.section.find('Architecture') + binaries = Sources.section.find('Binary') binaries_list = [ i.strip() for i in binaries.split(',') ] if "bnb" in checks: @@ -743,10 +743,10 @@ def main (): packages = utils.open_file(temp_filename) Packages = apt_pkg.TagFile(packages) - while Packages.Step(): - package = Packages.Section.Find('Package') - source = Packages.Section.Find('Source', "") - version = Packages.Section.Find('Version') + while Packages.step(): + package = Packages.section.find('Package') + source = Packages.section.find('Source', "") + version = Packages.section.find('Version') if source == "": source = package if bin2source.has_key(package) and \ diff --git a/dak/override.py b/dak/override.py index d27cf702..1d43a625 100755 --- a/dak/override.py +++ b/dak/override.py @@ -67,9 +67,9 @@ def check_override_compliance(package, priority, archive_path, suite_name, cnf, for arch in arches: for component in components: Packages = utils.get_packages_from_ftp(archive_path, suite_name, component, arch) - while Packages.Step(): - package_name = Packages.Section.Find("Package") - dep_list = Packages.Section.Find("Depends") + while Packages.step(): + package_name = Packages.section.find("Package") + dep_list = Packages.section.find("Depends") if dep_list: if package_name == package: for d in apt_pkg.parse_depends(dep_list): diff --git a/dak/override_disparity.py b/dak/override_disparity.py index d93a8f2b..413dcaab 100755 --- a/dak/override_disparity.py +++ b/dak/override_disparity.py @@ -91,9 +91,9 @@ def main(): for arch in arches: for component in components: Packages = utils.get_packages_from_ftp(suite.archive.path, suite_name, component, arch) - while Packages.Step(): - package = Packages.Section.Find('Package') - dep_list = Packages.Section.Find('Depends') + while Packages.step(): + package = Packages.section.find('Package') + dep_list = Packages.section.find('Depends') if Options['package'] and package != Options['package']: continue if dep_list: