]> git.decadent.org.uk Git - dak.git/blobdiff - dak/override.py
Move common code to the new get_packages_from_ftp()
[dak.git] / dak / override.py
index 6d5b82e890852c52e62e3c3b808cc66109711f80..ddb829b621a2bdb5beb95db1b56bed38504d7b6a 100755 (executable)
@@ -28,7 +28,6 @@
 import os
 import sys
 import apt_pkg
-import commands
 
 from daklib.config import Config
 from daklib.dbconn import *
@@ -67,16 +66,7 @@ def check_override_compliance(package, priority, suite, cnf, session):
     arches -= set(["source", "all"])
     for arch in arches:
         for component in components:
-            filename = "%s/dists/%s/%s/binary-%s/Packages.gz" % (cnf["Dir::Root"], suite, component, arch)
-            (fd, temp_filename) = utils.temp_filename()
-            (result, output) = commands.getstatusoutput("gunzip -c %s > %s" % (filename, temp_filename))
-            if (result != 0):
-                utils.fubar("Gunzip invocation failed!\n%s\n" % (output), result)
-            filename = "%s/dists/%s/%s/debian-installer/binary-%s/Packages.gz" % (cnf["Dir::Root"], suite, component, arch)
-            if os.path.exists(filename):
-                (result, output) = commands.getstatusoutput("gunzip -c %s >> %s" % (filename, temp_filename))
-                if (result != 0):
-                    utils.fubar("Gunzip invocation failed!\n%s\n" % (output), result)
+            temp_filename = utils.get_packages_from_ftp(cnf['Dir::Root'], suite, component, arch)
             packages = utils.open_file(temp_filename)
             Packages = apt_pkg.ParseTagFile(packages)
             while Packages.Step():