X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Futils.py;h=b5e090da3eb24324f89307fedff7920928115d4c;hb=431c457ab5dd067044c20716b5dfdc64ea6a7046;hp=dffad274c508c9c06dccc9143c5be4c6c0490fc0;hpb=26fd1f178ce88c250744d85d6bc15765d9ccf203;p=dak.git diff --git a/daklib/utils.py b/daklib/utils.py index dffad274..b5e090da 100755 --- a/daklib/utils.py +++ b/daklib/utils.py @@ -1576,10 +1576,24 @@ def parse_wnpp_bug_file(file = "/srv/ftp-master.debian.org/scripts/masterfiles/w def get_packages_from_ftp(root, suite, component, architecture): """ - Returns a filename containing data collected by aggregating Packages.gz files - gathered for each architecture. + Returns an object containing apt_pkg-parseable data collected by + aggregating Packages.gz files gathered for each architecture. + + @type root: string + @param root: path to ftp archive root directory + + @type suite: string + @param suite: suite to extract files from + + @type component: string + @param component: component to extract files from + + @type architecture: string + @param architecture: architecture to extract files from + + @rtype: TagFile + @return: apt_pkg class containing package data - Returned file has to be manually deleted afterwards. """ filename = "%s/dists/%s/%s/binary-%s/Packages.gz" % (root, suite, component, architecture) (fd, temp_file) = temp_filename() @@ -1591,4 +1605,7 @@ def get_packages_from_ftp(root, suite, component, architecture): (result, output) = commands.getstatusoutput("gunzip -c %s >> %s" % (filename, temp_file)) if (result != 0): fubar("Gunzip invocation failed!\n%s\n" % (output), result) - return temp_file + packages = open_file(temp_file) + Packages = apt_pkg.ParseTagFile(packages) + os.unlink(temp_file) + return Packages