]> git.decadent.org.uk Git - dak.git/blobdiff - cindy
* vars: external-overrides variable added* cron.daily: Update testing/unstable Task...
[dak.git] / cindy
diff --git a/cindy b/cindy
index fe2e7272c99921f4f251cd709f5ca55d00de4d6c..420f92279d586d1f2547101b9d61c2989757b6aa 100755 (executable)
--- 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 <james@nocrew.org>
-# $Id: cindy,v 1.9 2002-05-14 15:28:53 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
 
 ################################################################################
 
-# 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);
@@ -110,7 +135,7 @@ def main ():
                 print "Processing %s [%s - %s]..." % (suite, component, type);
                process(suite, component, type);
 
-#######################################################################################
+################################################################################
 
 if __name__ == '__main__':
     main()