X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fgenerate_releases.py;h=983c8573f17aacde6f3a8721fb38028db3206f2a;hb=2c588fd4aecbf98896d7e2acb3b9a2cb2d2c4cc8;hp=a1552451051f2a189b9ab57cd8093da8ca2673fb;hpb=cdffcfe2a0e6804ed35df56c4c2aa084c2b63677;p=dak.git diff --git a/dak/generate_releases.py b/dak/generate_releases.py index a1552451..983c8573 100755 --- a/dak/generate_releases.py +++ b/dak/generate_releases.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -# Create all the Release files +""" Create all the Release files """ # Copyright (C) 2001, 2002, 2006 Anthony Towns @@ -26,6 +26,7 @@ import sys, os, stat, time, pg import gzip, bz2 import apt_pkg from daklib import utils +from daklib import database from daklib.dak_exceptions import * ################################################################################ @@ -149,6 +150,7 @@ def main (): apt_pkg.ReadConfigFileISC(AptCnf, Options["Apt-Conf"]) projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"])) + database.init(Cnf, projectB) if not suites: suites = Cnf.SubTree("Suite").List() @@ -176,6 +178,10 @@ def main (): if qs[0][0] != "-": version = qs[0][0] if qs[0][1]: description = qs[0][1] + architectures = database.get_suite_architectures(suite) + if architectures == None: + architectures = [] + if SuiteBlock.has_key("NotAutomatic"): notautomatic = "yes" else: @@ -221,7 +227,7 @@ def main (): if notautomatic != "": out.write("NotAutomatic: %s\n" % (notautomatic)) - out.write("Architectures: %s\n" % (" ".join(filter(utils.real_arch, SuiteBlock.ValueList("Architectures"))))) + out.write("Architectures: %s\n" % (" ".join(filter(utils.real_arch, architectures)))) if components: out.write("Components: %s\n" % (" ".join(components))) @@ -231,6 +237,13 @@ def main (): files = [] if AptCnf.has_key("tree::%s" % (tree)): + if AptCnf.has_key("tree::%s::Contents" % (tree)): + pass + else: + for x in os.listdir("%s/%s" % (Cnf["Dir::Root"], tree)): + if x.startswith('Contents-'): + files.append(x) + for sec in AptCnf["tree::%s::Sections" % (tree)].split(): for arch in AptCnf["tree::%s::Architectures" % (tree)].split(): if arch == "source":