#!/usr/bin/env python
-# General purpose archive tool for ftpmaster
+# General purpose package removal tool for ftpmaster
# Copyright (C) 2000, 2001 James Troup <james@nocrew.org>
-# $Id: melanie,v 1.16 2001-09-26 03:15:16 troup Exp $
+# $Id: melanie,v 1.17 2001-09-27 01:23:41 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
################################################################################
-def usage (exit_code):
- print """Usage: melanie [OPTIONS] package[...]
- -D, --debug=VALUE turn on debugging
- -h, --help show this help and exit
+def usage (exit_code=0):
+ print """Usage: melanie [OPTIONS] PACKAGE[...]
+Remove PACKAGE(s) from suite(s).
+
-a, --architecture=ARCH only act on this architecture
-b, --binary remove binaries only
-c, --component=COMPONENT act on this component
-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"""
+ -S, --source-only remove source only
+ -h, --help show this help and exit
+
+ARCH, BUG#, COMPONENT and SUITE can be space seperated lists, e.g.
+ --architecture=\"m68k i386\""""
+
sys.exit(exit_code)
################################################################################
Cnf = apt_pkg.newConfiguration();
apt_pkg.ReadConfigFileISC(Cnf,utils.which_conf_file());
- Arguments = [('D',"debug","Melanie::Options::Debug", "IntVal"),
- ('h',"help","Melanie::Options::Help"),
- ('V',"version","Melanie::Options::Version"),
+ Arguments = [('h',"help","Melanie::Options::Help"),
('a',"architecture","Melanie::Options::Architecture", "HasArg"),
('b',"binary", "Melanie::Options::Binary-Only"),
('c',"component", "Melanie::Options::Component", "HasArg"),
('S',"source-only", "Melanie::Options::Source-Only"),
];
+ for i in ["help", "architecture", "binary", "component", "carbon-copy", "done", "reason", "no-action", "partial", "source-only" ]:
+ Cnf["Melanie::Options::%s" % (i)] = "";
+ Cnf["Melanie::Options::Suite"] = "unstable";
+
arguments = apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv);
Options = Cnf.SubTree("Melanie::Options")
if Options["Help"]:
- usage(0)
+ usage();
projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"]));
db_access.init(Cnf, projectB);
else:
bcc = "Bcc: " + bcc;
Subst["__BCC__"] = bcc[:-2];
- Subst["__CC__"] = "X-Melanie: $Revision: 1.16 $\n" + carbon_copy[:-1];
+ Subst["__CC__"] = "X-Melanie: $Revision: 1.17 $\n" + carbon_copy[:-1];
Subst["__SUITE_LIST__"] = suites_list;
Subst["__SUMMARY__"] = summary;
Subst["__ADMIN_ADDRESS__"] = Cnf["Dinstall::MyAdminAddress"];