]> git.decadent.org.uk Git - dak.git/blobdiff - ziyi
add mips, mipsel, s390 to testing
[dak.git] / ziyi
diff --git a/ziyi b/ziyi
index e056f5039278d3571cd156d9afcd70957d38ef1b..cd7033429cfef972396c5aa87529c58038d5a492 100755 (executable)
--- a/ziyi
+++ b/ziyi
@@ -3,7 +3,7 @@
 # Create all the Release files
 
 # Copyright (C) 2001  Anthony Towns <ajt@debian.org>
-# $Id: ziyi,v 1.5 2001-04-24 05:16:22 ajt Exp $
+# $Id: ziyi,v 1.8 2001-09-27 01:22:51 troup Exp $
 
 # 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
@@ -34,6 +34,16 @@ projectB = None
 
 ################################################################################
 
+def usage (exit_code=0):
+    print """Usage: ziyi [OPTION]
+Generate Release files.
+
+  -h, --help                 show this help and exit"""
+
+    sys.exit(exit_code)
+
+################################################################################
+
 def compressnames (tree,type,file):
     compress = AptCnf.get("%s::%s::Compress" % (tree,type), AptCnf.get("Default::%s::Compress" % (type), ". gzip"))
     result = []
@@ -82,19 +92,22 @@ def main ():
 
 
     apt_pkg.init()
-    
+
     Cnf = apt_pkg.newConfiguration()
     apt_pkg.ReadConfigFileISC(Cnf,utils.which_conf_file())
 
     AptCnf = apt_pkg.newConfiguration()
     apt_pkg.ReadConfigFileISC(AptCnf,utils.which_apt_conf_file())
-    print "APT.CONF IS: " + utils.which_apt_conf_file()
 
-    Arguments = [('d',"debug","Ziyi::Options::Debug", "IntVal"),
-                 ('h',"help","Ziyi::Options::Help"),
-                 ('v',"version","Ziyi::Options::Version")]
+    Arguments = [('h',"help","Ziyi::Options::Help")];
+    for i in [ "help" ]:
+        Cnf["Ziyi::Options::%s" % (i)] = "";
 
     suites = apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv)
+    Options = Cnf.SubTree("Ziyi::Options")
+
+    if Options["Help"]:
+       usage();
 
     if suites == []:
         suites = Cnf.SubTree("Suite").List()
@@ -116,6 +129,12 @@ def main ():
        label = SuiteBlock.get("Label", origin)
        version = SuiteBlock.get("Version", "")
        codename = SuiteBlock.get("CodeName", "")
+
+       if SuiteBlock.has_key("NotAutomatic"):
+           notautomatic = "yes"
+       else:
+           notautomatic = ""
+
        if SuiteBlock.has_key("Components"):
            components = SuiteBlock.SubTree("Components").List()
        else:
@@ -146,6 +165,8 @@ def main ():
        if codename != "":
            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 notautomatic != "":
+           out.write("NotAutomatic: %s\n" % (notautomatic))
        out.write("Architectures: %s\n" % (string.join(filter(real_arch, SuiteBlock.SubTree("Architectures").List()))))
        if components != []:
             out.write("Components: %s\n" % (string.join(components)))
@@ -179,6 +200,8 @@ def main ():
                                    release.write("Component: %s\n" % (sec))
                                release.write("Origin: %s\n" % (origin))
                                release.write("Label: %s\n" % (label))
+                               if notautomatic != "":
+                                   release.write("NotAutomatic: %s\n" % (notautomatic))
                                release.write("Architecture: %s\n" % (arch))
                                release.close()
                            files.append("%s/binary-%s/Release" % (sec,arch))
@@ -221,7 +244,7 @@ def main ():
            dest = Cnf["Dir::RootDir"] + tree + "/Release.gpg"
            if os.path.exists(dest):
                 os.unlink(dest)
-           os.system("gpg --secret-keyring \"%s\" --no-options --batch --no-tty --armour --detach-sign <%s --output=%s" % (Cnf["Dinstall::SigningKeyring"], 
+           os.system("gpg --secret-keyring \"%s\" --no-options --batch --no-tty --armour --detach-sign <%s --output=%s" % (Cnf["Dinstall::SigningKeyring"],
                Cnf["Dir::RootDir"] + tree + "/Release", dest))
 
 #######################################################################################