X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=jenna;h=73fdf0cfd437e63a1ac82d354bd9485023b09c3e;hb=d49cf540b71eb561ae369bc861971c43e1cbb779;hp=0854de6c5920394699f20008e7cd9eed63c4e6a8;hpb=255afc6897de5182050ff49f9dde28bbba4902e8;p=dak.git diff --git a/jenna b/jenna index 0854de6c..73fdf0cf 100755 --- a/jenna +++ b/jenna @@ -2,7 +2,7 @@ # Generate file list which is then fed to apt-ftparchive to generate Packages and Sources files # Copyright (C) 2000, 2001 James Troup -# $Id: jenna,v 1.13 2001-08-21 15:47:47 troup Exp $ +# $Id: jenna,v 1.15 2001-11-18 19:57:58 rmurray 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 @@ -18,22 +18,41 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -####################################################################################### +################################################################################ # BTAF: "GOD *DAMMIT*!! What the FUCK happened to my free will??" # # -- http://www.angryflower.com/timelo.gif -####################################################################################### +################################################################################ import pg, string, os, sys import apt_pkg import db_access, utils, claire, logging +################################################################################ + projectB = None Cnf = None Logger = None; +################################################################################ + +def usage (exit_code=0): + print """Usage: jenna [OPTION] +Write out file lists suitable for use with apt-ftparchive. + + -a, --architecture=ARCH only write file lists for this architecture + -c, --component=COMPONENT only write file lists for this component + -s, --suite=SUITE only write file lists for this suite + -h, --help show this help and exit + +ARCH, COMPONENT and SUITE can be space seperated lists, e.g. + --architecture=\"m68k i386\"""" + sys.exit(exit_code) + +################################################################################ + def generate_src_list(suite, component, output, dislocated_files): sources = {} @@ -198,28 +217,30 @@ def main(): global Cnf, projectB, Logger; dislocated_files = {}; - apt_pkg.init(); - - Cnf = apt_pkg.newConfiguration(); - apt_pkg.ReadConfigFileISC(Cnf,utils.which_conf_file()); + Cnf = utils.get_conf() Arguments = [('a',"architecture","Jenna::Options::Architecture", "HasArg"), ('c',"component","Jenna::Options::Component", "HasArg"), - ('d',"debug","Jenna::Options::Debug", "IntVal"), ('h',"help","Jenna::Options::Help"), - ('s',"suite", "Jenna::Options::Suite", "HasArg"), - ('v',"verbose","Jenna::Options::Verbose"), - ('V',"version","Jenna::Options::Version")]; + ('s',"suite", "Jenna::Options::Suite", "HasArg")]; + + for i in ["architecture", "component", "help", "suite" ]: + if not Cnf.has_key("Jenna::Options::%s" % (i)): + Cnf["Jenna::Options::%s" % (i)] = ""; apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv); + Options = Cnf.SubTree("Jenna::Options"); + + if Options["Help"]: + usage(); projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"])); db_access.init(Cnf, projectB); Logger = logging.Logger(Cnf, "jenna"); - if Cnf["Jenna::Options::Suite"] == "": - Cnf["Jenna::Options::Suite"] = string.join(Cnf.SubTree("Suite").List()); - for suite in string.split(Cnf["Jenna::Options::Suite"]): + if Options["Suite"] == "": + Options["Suite"] = string.join(Cnf.SubTree("Suite").List()); + for suite in string.split(Options["Suite"]): suite = string.lower(suite); if suite == 'stable': dislocated_files = claire.find_dislocated_stable(Cnf, projectB); @@ -227,14 +248,14 @@ def main(): dislocated_files = {}; clean_suite(suite); clean_duplicate_packages(suite) - components = Cnf["Jenna::Options::Component"]; + components = Options["Component"]; if not Cnf.has_key("Suite::%s::Components" % (suite)): components = "-"; if components == "": components = string.join(Cnf.SubTree("Suite::%s::Components" % (suite)).List()); for component in string.split(components): component = string.lower(component) - architectures = Cnf["Jenna::Options::Architecture"]; + architectures = Options["Architecture"]; if architectures == "": architectures = string.join(Cnf.SubTree("Suite::%s::Architectures" % (suite)).List()); for architecture in string.split(architectures): @@ -251,7 +272,7 @@ def main(): output = utils.open_file("%s/%s_%s_binary-%s.list" % (Cnf["Dir::ListsDir"], suite, component, architecture), "w"); generate_bin_list(suite, component, architecture, output, "deb", dislocated_files); output.close(); - if component == "main" and (suite == "unstable" or suite == "testing"): # FIXME: must be a cleaner way to say debian-installer is main only? + if component == "main" and (suite == "unstable" or suite == "testing") and Cnf.has_key("Section::debian-installer"): # FIXME: must be a cleaner way to say debian-installer is main only? Logger.log(["Processing dists/%s/%s/debian-installer/binary-%s..." % (suite,component, architecture)]); output = utils.open_file("%s/%s_%s_debian-installer_binary-%s.list" % (Cnf["Dir::ListsDir"], suite, component, architecture), "w"); generate_bin_list(suite, component, architecture, output, "udeb", dislocated_files);