X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Frm.py;h=903e138e8929e1f6aec25e2518f9f5adde58eb61;hb=c86d96790c95deed79c5ac3727361ac798c39f0f;hp=350cd1ead94be0812d498dc1551f6066632c899b;hpb=8123375b36cc39161fb6338fdd442c3a86582d3b;p=dak.git diff --git a/dak/rm.py b/dak/rm.py index 350cd1ea..903e138e 100755 --- a/dak/rm.py +++ b/dak/rm.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -# General purpose package removal tool for ftpmaster +""" General purpose package removal tool for ftpmaster """ # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2006 James Troup # This program is free software; you can redistribute it and/or modify @@ -44,11 +44,7 @@ import apt_pkg, apt_inst from daklib import database from daklib import utils from daklib.dak_exceptions import * - -################################################################################ - -re_strip_source_version = re.compile (r'\s+.*$') -re_build_dep_arch = re.compile(r"\[[^]]+\]") +from daklib.regexes import re_strip_source_version, re_build_dep_arch ################################################################################ @@ -104,7 +100,7 @@ def reverse_depends_check(removals, suites, arches=None): if arches: all_arches = set(arches) else: - all_arches = set(Cnf.ValueList("Suite::%s::Architectures" % suites[0])) + all_arches = set(database.get_suite_architectures(suites[0])) all_arches -= set(["source", "all"]) for architecture in all_arches: deps = {} @@ -113,7 +109,7 @@ def reverse_depends_check(removals, suites, arches=None): for component in components: filename = "%s/dists/%s/%s/binary-%s/Packages.gz" % (Cnf["Dir::Root"], suites[0], component, architecture) # apt_pkg.ParseTagFile needs a real file handle and can't handle a GzipFile instance... - temp_filename = utils.temp_filename() + (fd, temp_filename) = utils.temp_filename() (result, output) = commands.getstatusoutput("gunzip -c %s > %s" % (filename, temp_filename)) if (result != 0): utils.fubar("Gunzip invocation failed!\n%s\n" % (output), result) @@ -198,7 +194,7 @@ def reverse_depends_check(removals, suites, arches=None): for component in components: filename = "%s/dists/%s/%s/source/Sources.gz" % (Cnf["Dir::Root"], suites[0], component) # apt_pkg.ParseTagFile needs a real file handle and can't handle a GzipFile instance... - temp_filename = utils.temp_filename() + (fd, temp_filename) = utils.temp_filename() result, output = commands.getstatusoutput("gunzip -c %s > %s" % (filename, temp_filename)) if result != 0: sys.stderr.write("Gunzip invocation failed!\n%s\n" % (output)) @@ -425,7 +421,7 @@ def main (): # If we don't have a reason; spawn an editor so the user can add one # Write the rejection email out as the .reason file if not Options["Reason"] and not Options["No-Action"]: - temp_filename = utils.temp_filename() + (fd, temp_filename) = utils.temp_filename() editor = os.environ.get("EDITOR","vi") result = os.system("%s %s" % (editor, temp_filename)) if result != 0: