From: James Troup Date: Fri, 14 Mar 2003 19:04:36 +0000 (+0000) Subject: Adapt usage for new comma seperated arguments. Use split_args() from utils. Force... X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=3a77466454ce93fd7681968531bd91003250ab2a;p=dak.git Adapt usage for new comma seperated arguments. Use split_args() from utils. Force -C/--carbon-copy if no -d/--done and no [rene] in -m/--reason. --- diff --git a/melanie b/melanie index bbfeba06..81fc9453 100755 --- a/melanie +++ b/melanie @@ -2,7 +2,7 @@ # General purpose package removal tool for ftpmaster # Copyright (C) 2000, 2001, 2002, 2003 James Troup -# $Id: melanie,v 1.36 2003-02-21 19:18:24 troup Exp $ +# $Id: melanie,v 1.37 2003-03-14 19:04:36 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 @@ -71,8 +71,8 @@ Remove PACKAGE(s) from suite(s). -s, --suite=SUITE act on this suite -S, --source-only remove source only -ARCH, BUG#, COMPONENT and SUITE can be space seperated lists, e.g. - --architecture=\"m68k i386\"""" +ARCH, BUG#, COMPONENT and SUITE can be comma (or space) seperated lists, e.g. + --architecture=m68k,i386""" sys.exit(exit_code) @@ -137,6 +137,12 @@ def main (): utils.warn("-a/--architecture implies -p/--partial."); Options["Partial"] = "true"; + # Force the admin to tell someone if we're not doing a rene-led removal + # (or closing a bug, which counts as telling someone). + if not Options["Carbon-Copy"] and not Options["Done"] \ + and Options["Reason"].find("[rene]") == -1: + utils.fubar("Need a -C/--carbon-copy if not closing a bug and not doing a rene-led removal."); + # Process -C/--carbon-copy # # Accept 3 types of arguments (space separated): @@ -145,7 +151,7 @@ def main (): # 3) contains a '@' - assumed to be an email address, used unmofidied # carbon_copy = []; - for copy_to in Options.get("Carbon-Copy").split(): + for copy_to in split_args(Options.get("Carbon-Copy")): if utils.str_isnum(copy_to): carbon_copy.append(copy_to + "@" + Cnf["Dinstall::BugServer"]); elif copy_to == 'package': @@ -169,7 +175,7 @@ def main (): # Additional suite checks suite_ids_list = []; - suites = Options["Suite"].split(); + suites = split_args(Options["Suite"]); suites_list = utils.join_with_commas_and(suites); if not Options["No-Action"]: for suite in suites: @@ -371,7 +377,7 @@ def main (): Subst["__BCC__"] = "Bcc: " + ", ".join(bcc); else: Subst["__BCC__"] = "X-Filler: 42"; - Subst["__CC__"] = "X-Katie: melanie $Revision: 1.36 $"; + Subst["__CC__"] = "X-Katie: melanie $Revision: 1.37 $"; if carbon_copy: Subst["__CC__"] += "\nCc: " + ", ".join(carbon_copy); Subst["__SUITE_LIST__"] = suites_list; @@ -383,10 +389,10 @@ def main (): Archive = Cnf.SubTree("Archive::%s" % (whereami)); Subst["__MASTER_ARCHIVE__"] = Archive["OriginServer"]; Subst["__PRIMARY_MIRROR__"] = Archive["PrimaryMirror"]; - for bug in Options["Done"].split(): + for bug in split_args(Options["Done"]): Subst["__BUG_NUMBER__"] = bug; mail_message = utils.TemplateSubst(Subst,Cnf["Dir::Templates"]+"/melanie.bug-close"); - utils.send_mail (mail_message, "") + utils.send_mail(mail_message); logfile.write("=========================================================================\n"); logfile.close();