]> git.decadent.org.uk Git - dak.git/blobdiff - ziyi
Add new top level directories
[dak.git] / ziyi
diff --git a/ziyi b/ziyi
index 16e1ba163b81c4259f7243c8995583549946b08f..49a19fb77a48bfc417f17d5b49b5ea3f93b3f09d 100755 (executable)
--- a/ziyi
+++ b/ziyi
@@ -3,7 +3,7 @@
 # Create all the Release files
 
 # Copyright (C) 2001, 2002  Anthony Towns <ajt@debian.org>
-# $Id: ziyi,v 1.24 2002-12-08 17:25:00 troup Exp $
+# $Id: ziyi,v 1.27 2005-11-15 09:50:32 ajt 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
@@ -37,15 +37,24 @@ AptCnf = None
 ################################################################################
 
 def usage (exit_code=0):
-    print """Usage: ziyi [OPTION]
-Generate Release files.
+    print """Usage: ziyi [OPTION]... [SUITE]...
+Generate Release files (for SUITE).
 
-  -h, --help                 show this help and exit"""
+  -h, --help                 show this help and exit
+
+If no SUITE is given Release files are generated for all suites."""
 
     sys.exit(exit_code)
 
 ################################################################################
 
+def add_tiffani (files, path, indexstem):
+    index = "%s.diff/Index" % (indexstem)
+    filepath = "%s/%s" % (path, index)
+    if os.path.exists(filepath):
+        #print "ALERT: there was a tiffani file %s" % (filepath)
+        files.append(index)
+
 def compressnames (tree,type,file):
     compress = AptCnf.get("%s::%s::Compress" % (tree,type), AptCnf.get("Default::%s::Compress" % (type), ". gzip"))
     result = []
@@ -118,9 +127,6 @@ def main ():
 
     Cnf = utils.get_conf()
 
-    AptCnf = apt_pkg.newConfiguration()
-    apt_pkg.ReadConfigFileISC(AptCnf,utils.which_apt_conf_file())
-
     Arguments = [('h',"help","Ziyi::Options::Help")];
     for i in [ "help" ]:
        if not Cnf.has_key("Ziyi::Options::%s" % (i)):
@@ -132,6 +138,9 @@ def main ():
     if Options["Help"]:
        usage();
 
+    AptCnf = apt_pkg.newConfiguration()
+    apt_pkg.ReadConfigFileISC(AptCnf,utils.which_apt_conf_file())
+
     if not suites:
         suites = Cnf.SubTree("Suite").List()
 
@@ -202,8 +211,10 @@ def main ():
            for sec in AptCnf["tree::%s::Sections" % (tree)].split():
                for arch in AptCnf["tree::%s::Architectures" % (tree)].split():
                    if arch == "source":
-                       for file in compressnames("tree::%s" % (tree), "Sources", "%s/%s/Sources" % (sec, arch)):
+                       filepath = "%s/%s/Sources" % (sec, arch)
+                       for file in compressnames("tree::%s" % (tree), "Sources", filepath):
                            files.append(file)
+                       add_tiffani(files, Cnf["Dir::Root"] + tree, filepath)
                    else:
                        disks = "%s/disks-%s" % (sec, arch)
                        diskspath = Cnf["Dir::Root"]+tree+"/"+disks
@@ -212,8 +223,10 @@ def main ():
                                if os.path.exists("%s/%s/md5sum.txt" % (diskspath, dir)):
                                    files.append("%s/%s/md5sum.txt" % (disks, dir))
 
-                       for file in compressnames("tree::%s" % (tree), "Packages", "%s/binary-%s/Packages" % (sec, arch)):
+                       filepath = "%s/binary-%s/Packages" % (sec, arch)
+                       for file in compressnames("tree::%s" % (tree), "Packages", filepath):
                            files.append(file)
+                       add_tiffani(files, Cnf["Dir::Root"] + tree, filepath)
 
                    if arch == "source":
                        rel = "%s/%s/Release" % (sec, arch)
@@ -251,6 +264,16 @@ def main ():
                    if arch != "source":  # always true
                        for file in compressnames("tree::%s/main" % (tree), "Packages", "main/%s/binary-%s/Packages" % (sec, arch)):
                            files.append(file)
+           elif AptCnf.has_key("tree::%s::FakeDI" % (tree)):
+               usetree = AptCnf["tree::%s::FakeDI" % (tree)]
+               sec = AptCnf["tree::%s/main::Sections" % (usetree)].split()[0]
+               if sec != "debian-installer":
+                   print "ALERT: weird non debian-installer section in %s" % (usetree)
+               for arch in AptCnf["tree::%s/main::Architectures" % (usetree)].split():
+                   if arch != "source":  # always true
+                       for file in compressnames("tree::%s/main" % (usetree), "Packages", "main/%s/binary-%s/Packages" % (sec, arch)):
+                           files.append(file)
 
        elif AptCnf.has_key("bindirectory::%s" % (tree)):
            for file in compressnames("bindirectory::%s" % (tree), "Packages", AptCnf["bindirectory::%s::Packages" % (tree)]):