X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=cindy;h=420f92279d586d1f2547101b9d61c2989757b6aa;hb=65f7502a0f386b0405b36f1c3dbcb93e0e102980;hp=022a5582431186dcaf10ea74309664d1c2e729ca;hpb=80ba7d5f206f1ddff863968989697d99f6aefde5;p=dak.git diff --git a/cindy b/cindy index 022a5582..420f9227 100755 --- a/cindy +++ b/cindy @@ -1,8 +1,8 @@ #!/usr/bin/env python -# Output override files for apt-ftparchive and indices/ +# Cruft checker for overrides # Copyright (C) 2000, 2001, 2002 James Troup -# $Id: cindy,v 1.8 2002-05-03 16:06:45 troup Exp $ +# $Id: cindy,v 1.11 2003-01-02 18:10:02 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 @@ -20,7 +20,13 @@ ################################################################################ -# X-Listening-To: Sanitarium / Master of the Puppets - Metallica +###################################################################### +# NB: cindy is not a good idea with New Incoming as she doesn't take # +# into account accepted. You can minimize the impact of this by # +# running her immediately after kelly but that's still racy because # +# lisa doesn't lock with kelly. A better long term fix is the evil # +# plan for accepted to be in the DB. # +###################################################################### ################################################################################ @@ -36,6 +42,16 @@ override = {} ################################################################################ +def usage (exit_code=0): + print """Usage: cindy +Check for cruft in overrides. + + -h, --help show this help and exit""" + + sys.exit(exit_code) + +################################################################################ + def process(suite, component, type): global override; @@ -96,7 +112,16 @@ def main (): global Cnf, projectB, override; Cnf = utils.get_conf() - apt_pkg.ParseCommandLine(Cnf,[],sys.argv); + + Arguments = [('h',"help","Cindy::Options::Help")]; + for i in [ "help" ]: + if not Cnf.has_key("Cindy::Options::%s" % (i)): + Cnf["Cindy::Options::%s" % (i)] = ""; + apt_pkg.ParseCommandLine(Cnf, Arguments, sys.argv); + Options = Cnf.SubTree("Cindy::Options") + + if Options["Help"]: + usage(); projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"])); db_access.init(Cnf, projectB); @@ -106,11 +131,11 @@ def main (): for component in Cnf.SubTree("Component").List(): if component == "mixed": continue; # Ick - for type in Cnf.SubTree("OverrideType").List(): + for type in Cnf.ValueList("OverrideType"): print "Processing %s [%s - %s]..." % (suite, component, type); process(suite, component, type); -####################################################################################### +################################################################################ if __name__ == '__main__': main()