X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fgenerate_packages_sources.py;h=3c02e0dda7704f2fa8d20e0a461deab2c8c87986;hb=b8d1a705c16f087e93d2ee8232c1ecf379242e86;hp=f1d07fab5779325d29b0293747d9ef4624cf1ba6;hpb=3d4f5a474e5550e42c88f30bdc5fd094984dfcc1;p=dak.git diff --git a/dak/generate_packages_sources.py b/dak/generate_packages_sources.py index f1d07fab..3c02e0dd 100755 --- a/dak/generate_packages_sources.py +++ b/dak/generate_packages_sources.py @@ -31,7 +31,7 @@ import sys import apt_pkg from tempfile import mkstemp, mkdtemp import commands -from multiprocessing import Pool +from multiprocessing import Pool, TimeoutError from daklib import daklog from daklib.dbconn import * @@ -41,6 +41,7 @@ from daklib.config import Config Options = None #: Commandline arguments parsed into this Logger = None #: Our logging object +results = [] #: Results of the subprocesses ################################################################################ @@ -284,6 +285,32 @@ tree "dists/proposed-updates/main" Packages::Extensions ".udeb"; Contents " "; }; +""" + apt_trees["oldstable-proposed-updates"]=""" +tree "dists/oldstable-proposed-updates" +{ + FileList "/srv/ftp-master.debian.org/database/dists/oldstable-proposed-updates_$(SECTION)_binary-$(ARCH).list"; + SourceFileList "/srv/ftp-master.debian.org/database/dists/oldstable-proposed-updates_$(SECTION)_source.list"; + Sections "main contrib non-free"; + Architectures "%(arch)s"; + BinOverride "override.lenny.$(SECTION)"; + ExtraOverride "override.lenny.extra.$(SECTION)"; + SrcOverride "override.lenny.$(SECTION).src"; + Contents " "; +}; +""" + apt_trees["di"]["oldstable-proposed-updates"]=""" +tree "dists/oldstable-proposed-updates/main" +{ + FileList "/srv/ftp-master.debian.org/database/dists/oldstable-proposed-updates_main_$(SECTION)_binary-$(ARCH).list"; + Sections "debian-installer"; + Architectures "%(arch)s"; + BinOverride "override.lenny.main.$(SECTION)"; + SrcOverride "override.lenny.main.src"; + BinCacheDB "packages-debian-installer-$(ARCH).db"; + Packages::Extensions ".udeb"; + Contents " "; +}; """ cnf = Config() @@ -312,9 +339,10 @@ tree "dists/proposed-updates/main" # it has errormessages we like to see os.environ['GZIP'] = '--rsyncable' os.chdir(tmppath) - (result, output) = commands.getstatusoutput('apt-ftparchive generate %s' % os.path.basename(ac_name)) + (result, output) = commands.getstatusoutput('apt-ftparchive -o APT::FTPArchive::Contents=off generate %s' % os.path.basename(ac_name)) sn="a-f %s,%s: " % (suite, arch) print sn + output.replace('\n', '\n%s' % (sn)) + return result # Clean up any left behind files finally: @@ -333,11 +361,16 @@ tree "dists/proposed-updates/main" def sname(arch): return arch.arch_string +def get_result(arg): + global results + if arg: + results.append(arg) + ######################################################################## ######################################################################## def main (): - global Options, Logger + global Options, Logger, results cnf = Config() @@ -375,19 +408,26 @@ def main (): startdir = os.getcwd() os.chdir(cnf["Dir::TempPath"]) + broken=[] # For each given suite, each architecture, run one apt-ftparchive for s in suites: + results=[] # Setup a multiprocessing Pool. As many workers as we have CPU cores. pool = Pool() arch_list=get_suite_architectures(s.suite_name, skipsrc=False, skipall=True, session=session) Logger.log(['generating output for Suite %s, Architectures %s' % (s.suite_name, map(sname, arch_list))]) for a in arch_list: - pool.apply_async(generate_packages_sources, (a.arch_string, s.suite_name, cnf["Dir::TempPath"])) + pool.apply_async(generate_packages_sources, (a.arch_string, s.suite_name, cnf["Dir::TempPath"]), callback=get_result) # No more work will be added to our pool, close it and then wait for all to finish pool.close() pool.join() + if len(results) > 0: + Logger.log(['Trouble, something with a-f broke, resultcodes: %s' % (results)]) + print "Trouble, something with a-f broke, resultcodes: %s" % (results) + sys.exit(1) + os.chdir(startdir) # this script doesn't change the database session.close()