]> git.decadent.org.uk Git - dak.git/blobdiff - dak/generate_releases.py
untouchable
[dak.git] / dak / generate_releases.py
index 1c258bd5c511d292757d59f678d86fcbab0f56b3..137c84472beb08369230b444e97687ffba563366 100755 (executable)
@@ -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()
@@ -157,7 +159,7 @@ def main ():
         print "Processing: " + suite
         SuiteBlock = Cnf.SubTree("Suite::" + suite)
 
-        if SuiteBlock.has_key("Untouchable") and not Options["Force-Touch"]:
+        if database.get_suite_untouchable(suite) and not Options["Force-Touch"]:
             print "Skipping: " + suite + " (untouchable)"
             continue
 
@@ -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":