import os
import sys
import apt_pkg
-import commands
from daklib.config import Config
from daklib.dbconn import *
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():
import os
import sys
import apt_pkg
-import commands
from daklib.config import Config
from daklib.dbconn import *
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_file = utils.open_file(temp_filename)
Packages = apt_pkg.ParseTagFile(packages_file)
while Packages.Step():
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