]> git.decadent.org.uk Git - dak.git/blobdiff - dak/generate_releases.py
Get rid of overridesuite and validtime in dak.conf
[dak.git] / dak / generate_releases.py
index 11e37807121181c892bca57ab40471fec5674969..04627fc458ffc78d36e1f53de3ab684945ea2b4c 100755 (executable)
@@ -1,9 +1,12 @@
 #!/usr/bin/env python
 
-""" Create all the Release files """
-
-# Copyright (C) 2001, 2002, 2006  Anthony Towns <ajt@debian.org>
+""" Create all the Release files
 
+@contact: Debian FTPMaster <ftpmaster@debian.org>
+@Copyright: 2001, 2002, 2006  Anthony Towns <ajt@debian.org>
+@copyright: 2009  Joerg Jaspert <joerg@debian.org>
+@license: GNU General Public License version 2 or later
+"""
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation; either version 2 of the License, or
 
 ################################################################################
 
-import sys, os, stat, time
-import gzip, bz2
+import sys
+import os
+import stat
+import time
+import gzip
+import bz2
 import apt_pkg
 
 from daklib import utils
@@ -197,26 +204,30 @@ def main ():
 
     for suitename in suites:
         print "Processing: " + suitename
-        SuiteBlock = Cnf.SubTree("Suite::" + suite)
-        suiteobj = get_suite(suitename)
+        SuiteBlock = Cnf.SubTree("Suite::" + suitename)
+        suiteobj = get_suite(suitename.lower())
+        if not suiteobj:
+            print "ALERT: Cannot find suite %s!" % (suitename.lower())
+            continue
 
-        suite = suite.suite_name.lower()
+        # Use the canonical name
+        suite = suiteobj.suite_name.lower()
 
-        if suite.untouchable and not Options["Force-Touch"]:
+        if suiteobj.untouchable and not Options["Force-Touch"]:
             print "Skipping: " + suite + " (untouchable)"
             continue
 
-        origin = suite.origin
-        label = suite.label or suite.origin
-        codename = suite.codename or ""
+        origin = suiteobj.origin
+        label = suiteobj.label or suiteobj.origin
+        codename = suiteobj.codename or ""
         version = ""
-        if suite.version and suite.version != '-':
-            version = suite.version
-        description = suite.description or ""
+        if suiteobj.version and suiteobj.version != '-':
+            version = suiteobj.version
+        description = suiteobj.description or ""
 
         architectures = get_suite_architectures(suite, skipall=True, skipsrc=True)
 
-        if SuiteBlock.has_key("NotAutomatic"):
+        if suiteobj.notautomatic:
             notautomatic = "yes"
         else:
             notautomatic = ""
@@ -255,8 +266,8 @@ def main ():
             out.write("Codename: %s\n" % (codename))
         out.write("Date: %s\n" % (time.strftime("%a, %d %b %Y %H:%M:%S UTC", time.gmtime(time.time()))))
 
-        if SuiteBlock.has_key("ValidTime"):
-            validtime=float(SuiteBlock["ValidTime"])
+        if suiteobj.validtime:
+            validtime=float(suiteobj.validtime)
             out.write("Valid-Until: %s\n" % (time.strftime("%a, %d %b %Y %H:%M:%S UTC", time.gmtime(time.time()+validtime))))
 
         if notautomatic != "":
@@ -368,13 +379,21 @@ def main ():
             dest = Cnf["Dir::Root"] + tree + "/Release.gpg"
             if os.path.exists(dest):
                 os.unlink(dest)
+            inlinedest = Cnf["Dir::Root"] + tree + "/InRelease"
+            if os.path.exists(inlinedest):
+                os.unlink(inlinedest)
 
             for keyid in signkeyids:
-                if keyid != "": defkeyid = "--default-key %s" % keyid
-                else: defkeyid = ""
+                if keyid != "":
+                    defkeyid = "--default-key %s" % keyid
+                else:
+                    defkeyid = ""
                 os.system("gpg %s %s %s --detach-sign <%s >>%s" %
                         (keyring, defkeyid, arguments,
                         Cnf["Dir::Root"] + tree + "/Release", dest))
+                os.system("gpg %s %s %s --clearsign <%s >>%s" %
+                        (keyring, defkeyid, arguments,
+                        Cnf["Dir::Root"] + tree + "/Release", inlinedest))
 
 #######################################################################################