X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=natalie.py;h=6d4e798f826f3f0b10b88e53085e55eb1a48c946;hb=8a333437306f1112c1b1ca4e96f9000fdd966a00;hp=8206ddfe8715705457f1432def9614a9559fe1e7;hpb=43722e2ebdfdcc25098483f3fa05b7ee857b1466;p=dak.git diff --git a/natalie.py b/natalie.py index 8206ddfe..6d4e798f 100755 --- a/natalie.py +++ b/natalie.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # Manipulate override files -# Copyright (C) 2000 James Troup -# $Id: natalie.py,v 1.1 2001-01-10 05:58:26 troup Exp $ +# Copyright (C) 2000, 2001 James Troup +# $Id: natalie.py,v 1.4 2001-03-21 01:03:28 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 @@ -31,10 +31,29 @@ projectB = None; ################################################################################ +def usage (exit_code): + print """Usage: natalie.py [OPTIONS] + -D, --debug=VALUE debug + -h, --help this help + -V, --version retrieve version + -c, --component=CMPT list/set overrides by component + (contrib,*main,non-free) + -s, --suite=SUITE list/set overrides by suite + (experimental,stable,testing,*unstable) + -t, --type=TYPE list/set overrides by type + (*deb,dsc,udeb) + -S, --set set overrides from stdin + -l, --list list overrides on stdout + + starred (*) values are default""" + sys.exit(exit_code) + +################################################################################ + def init(): global projectB; - projectB = pg.connect('projectb', 'localhost'); + projectB = pg.connect('projectb', None); db_access.init(Cnf, projectB); def process_file (file, suite, component, type, action): @@ -194,6 +213,9 @@ def main (): ('t',"type","Natalie::Options::Type", "HasArg")]; file_list = apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv); + if Cnf["Natalie::Options::Help"]: + usage(0); + init(); action = None;