X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Futils.py;h=dffad274c508c9c06dccc9143c5be4c6c0490fc0;hb=26fd1f178ce88c250744d85d6bc15765d9ccf203;hp=1756f58fa2d27132a3675a95716ab4404cf9a898;hpb=1655d67a017e5b572ca4669e658f8f9a6a7cbcc8;p=dak.git diff --git a/daklib/utils.py b/daklib/utils.py index 1756f58f..dffad274 100755 --- a/daklib/utils.py +++ b/daklib/utils.py @@ -1571,3 +1571,24 @@ def parse_wnpp_bug_file(file = "/srv/ftp-master.debian.org/scripts/masterfiles/w bugs.append(bug_no) wnpp[source] = bugs return wnpp + +################################################################################ + +def get_packages_from_ftp(root, suite, component, architecture): + """ + Returns a filename containing data collected by aggregating Packages.gz files + gathered for each architecture. + + 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() + (result, output) = commands.getstatusoutput("gunzip -c %s > %s" % (filename, temp_file)) + if (result != 0): + fubar("Gunzip invocation failed!\n%s\n" % (output), result) + filename = "%s/dists/%s/%s/debian-installer/binary-%s/Packages.gz" % (root, suite, component, architecture) + if os.path.exists(filename): + (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