]> git.decadent.org.uk Git - dak.git/commitdiff
stop using deprecated methods from apt_pkg
authorAnsgar Burchardt <ansgar@debian.org>
Sat, 25 May 2013 11:20:34 +0000 (13:20 +0200)
committerAnsgar Burchardt <ansgar@debian.org>
Sat, 25 May 2013 11:26:31 +0000 (13:26 +0200)
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 <mak@debian.org>
Reference: https://lists.debian.org/debian-dak/2013/03/msg00028.html

dak/check_archive.py
dak/cruft_report.py
dak/override.py
dak/override_disparity.py

index d0c71d478c2d3a941670749086e8c6e66bafaf4f..5265cc50b9977d6ed1591d8771b36c1d92d402db 100755 (executable)
@@ -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()
index 812a39b2db9194f2a8522a864a6f75c70ed5f536..7dedceed886c1c9f4c11c0e3fab4db0389147764 100755 (executable)
@@ -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 \
index d27cf702ebf77b2235ad2a0afa5b133a60f3cac7..1d43a62579fe08012426cb5dcd1fc2d435c50883 100755 (executable)
@@ -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):
index d93a8f2bbe5f0f8ac483a41d4fb021d04a7d0fdb..413dcaabfbfcca0cddc1ac2074711744b24b3371 100755 (executable)
@@ -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: