#!/usr/bin/env python
# General purpose package removal tool for ftpmaster
-# Copyright (C) 2000, 2001, 2002, 2003 James Troup <james@nocrew.org>
-# $Id: melanie,v 1.37 2003-03-14 19:04:36 troup Exp $
+# Copyright (C) 2000, 2001, 2002, 2003, 2004 James Troup <james@nocrew.org>
+# $Id: melanie,v 1.40 2004-04-01 17:13:11 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
################################################################################
-import commands, os, pg, re, sys, tempfile
-import utils, db_access
+import commands, os, pg, re, sys;
+import utils, db_access;
import apt_pkg, apt_inst;
################################################################################
-s, --suite=SUITE act on this suite
-S, --source-only remove source only
-ARCH, BUG#, COMPONENT and SUITE can be comma (or space) seperated lists, e.g.
+ARCH, BUG#, COMPONENT and SUITE can be comma (or space) separated lists, e.g.
--architecture=m68k,i386"""
sys.exit(exit_code)
# 3) contains a '@' - assumed to be an email address, used unmofidied
#
carbon_copy = [];
- for copy_to in split_args(Options.get("Carbon-Copy")):
+ for copy_to in utils.split_args(Options.get("Carbon-Copy")):
if utils.str_isnum(copy_to):
carbon_copy.append(copy_to + "@" + Cnf["Dinstall::BugServer"]);
elif copy_to == 'package':
# Additional suite checks
suite_ids_list = [];
- suites = split_args(Options["Suite"]);
+ suites = utils.split_args(Options["Suite"]);
suites_list = utils.join_with_commas_and(suites);
if not Options["No-Action"]:
for suite in suites:
# If we don't have a reason; spawn an editor so the user can add one
# Write the rejection email out as the <foo>.reason file
if not Options["Reason"] and not Options["No-Action"]:
- temp_filename = tempfile.mktemp();
- fd = os.open(temp_filename, os.O_RDWR|os.O_CREAT|os.O_EXCL, 0700);
- os.close(fd);
+ temp_filename = utils.temp_filename();
editor = os.environ.get("EDITOR","vi")
result = os.system("%s %s" % (editor, temp_filename))
if result != 0:
Subst["__BCC__"] = "Bcc: " + ", ".join(bcc);
else:
Subst["__BCC__"] = "X-Filler: 42";
- Subst["__CC__"] = "X-Katie: melanie $Revision: 1.37 $";
+ Subst["__CC__"] = "X-Katie: melanie $Revision: 1.40 $";
if carbon_copy:
Subst["__CC__"] += "\nCc: " + ", ".join(carbon_copy);
Subst["__SUITE_LIST__"] = suites_list;
Archive = Cnf.SubTree("Archive::%s" % (whereami));
Subst["__MASTER_ARCHIVE__"] = Archive["OriginServer"];
Subst["__PRIMARY_MIRROR__"] = Archive["PrimaryMirror"];
- for bug in split_args(Options["Done"]):
+ for bug in utils.split_args(Options["Done"]):
Subst["__BUG_NUMBER__"] = bug;
mail_message = utils.TemplateSubst(Subst,Cnf["Dir::Templates"]+"/melanie.bug-close");
utils.send_mail(mail_message);