X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=melanie;h=3dfae76da5459d55beaac90277fc5c135b602fcb;hb=20ef2ddf06d0c75fd3786fae338ccc3161868f7e;hp=91288a82d616062fc07766decb81fdfc20f95750;hpb=6ada259d555e36a1546789c280edc3f944b7de7f;p=dak.git diff --git a/melanie b/melanie index 91288a82..3dfae76d 100755 --- a/melanie +++ b/melanie @@ -2,7 +2,7 @@ # General purpose archive tool for ftpmaster # Copyright (C) 2000, 2001 James Troup -# $Id: melanie,v 1.14 2001-06-22 22:53:14 troup Exp $ +# $Id: melanie,v 1.16 2001-09-26 03:15:16 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 @@ -37,6 +37,24 @@ projectB = None; ################################################################################ +def usage (exit_code): + print """Usage: melanie [OPTIONS] package[...] + -D, --debug=VALUE turn on debugging + -h, --help show this help and exit + -a, --architecture=ARCH only act on this architecture + -b, --binary remove binaries only + -c, --component=COMPONENT act on this component + -C, --carbon-copy=EMAIL send a CC of removal message to EMAIL + -d, --done=BUG# send removal message as closure to bug# + -m, --reason=MSG reason for removal + -n, --no-action don't do anything + -p, --partial don't affect override files + -s, --suite=SUITE act on this suite + -S, --source-only remove source only""" + sys.exit(exit_code) + +################################################################################ + # "That's just fucking great! Game over, man! What the fuck are we # going to do now?" @@ -53,7 +71,7 @@ def main (): global Cnf, projectB; apt_pkg.init(); - + Cnf = apt_pkg.newConfiguration(); apt_pkg.ReadConfigFileISC(Cnf,utils.which_conf_file()); @@ -74,6 +92,10 @@ def main (): arguments = apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv); Options = Cnf.SubTree("Melanie::Options") + + if Options["Help"]: + usage(0) + projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"])); db_access.init(Cnf, projectB); @@ -127,7 +149,7 @@ def main (): suite_ids_list = []; con_suites = "AND ("; for suite in string.split(Options["Suite"]): - + if not Options["No-Action"] and suite == "stable": print "**WARNING** About to remove from the stable suite!" print "This should only be done just prior to a (point) release and not at" @@ -138,7 +160,7 @@ def main (): print "There's no need to do this normally as removals from unstable will" print "propogate to testing automagically." game_over(); - + suite_id = db_access.get_suite_id(suite); if suite_id == -1: utils.warn("suite '%s' not recognised." % (suite)); @@ -163,7 +185,7 @@ def main (): con_components = con_components[:-3] + ")" over_con_components = over_con_components[:-3] + ")"; else: - con_components = ""; + con_components = ""; over_con_components = ""; if Options["Architecture"]: @@ -297,7 +319,7 @@ def main (): # If -n/--no-action, drop out here if Options["No-Action"]: sys.exit(0); - + game_over(); whoami = utils.whoami(); @@ -313,10 +335,10 @@ def main (): logfile.write("\n------------------- Reason -------------------\n%s\n" % (Options["Reason"])); logfile.write("----------------------------------------------\n"); logfile.flush(); - + dsc_type_id = db_access.get_override_type_id('dsc'); deb_type_id = db_access.get_override_type_id('deb'); - + # Do the actual deletion print "Deleting...", sys.stdout.flush(); @@ -357,7 +379,7 @@ def main (): else: bcc = "Bcc: " + bcc; Subst["__BCC__"] = bcc[:-2]; - Subst["__CC__"] = "X-Melanie: $Revision: 1.14 $\n" + carbon_copy[:-1]; + Subst["__CC__"] = "X-Melanie: $Revision: 1.16 $\n" + carbon_copy[:-1]; Subst["__SUITE_LIST__"] = suites_list; Subst["__SUMMARY__"] = summary; Subst["__ADMIN_ADDRESS__"] = Cnf["Dinstall::MyAdminAddress"]; @@ -371,7 +393,7 @@ def main (): Subst["__BUG_NUMBER__"] = bug; mail_message = utils.TemplateSubst(Subst,open(Cnf["Dir::TemplatesDir"]+"/melanie.bug-close","r").read()); utils.send_mail (mail_message, "") - + logfile.write("=========================================================================\n"); logfile.close();