From: James Troup Date: Sat, 27 Nov 2004 18:12:57 +0000 (+0000) Subject: 2004-11-27 James Troup * utils.py (re_no_epoch): s/\*/+/ as... X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ceeff88ecfd72516aa8f462d05c9e1bf382ed1b;p=dak 2004-11-27 James Troup * utils.py (re_no_epoch): s/\*/+/ as there must be a digit in an epoch. (re_no_revision): don't escape '-', it's not a special character. s/\*/+/ as there must be at least one non-dash character after the dash in a revision. Thanks to Christian Reis for noticing both of these.2004-09-20 James Troup * melanie (reverse_depends_check): retrieve component information too and display it if it's not 'main'. * utils.py (pp_dep): renamed... (pp_deps): ... to this. * jeri (check_dep): update calls to utils.pp_deps(). * melanie (reverse_depends_check): likewise.2004-08-04 James Troup * utils.py (cant_open_exc): correct exception string, s/read/open/, s/.$//.2004-06-20 James Troup * utils.py (changes_compare): if there's no changes["version"] use "0" rather than None. (Avoids a crash on unsigned changes file.) --- diff --git a/jeri b/jeri index 72b2077e..49685b5d 100755 --- a/jeri +++ b/jeri @@ -2,7 +2,7 @@ # Dependency check proposed-updates # Copyright (C) 2001, 2002, 2004 James Troup -# $Id: jeri,v 1.13 2004-06-24 00:41:39 troup Exp $ +# $Id: jeri,v 1.14 2004-11-27 18:12:57 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 @@ -80,7 +80,7 @@ def check_dep (depends, dep_type, check_archs, filename, files): if stable[dep].has_key(arch): if apt_pkg.CheckDep(stable[dep][arch], constraint, version): if Options["debug"]: - print "Found %s as a real package." % (utils.pp_dep(parsed_dep)); + print "Found %s as a real package." % (utils.pp_deps(parsed_dep)); unsat = 0; break; # As a virtual? @@ -88,7 +88,7 @@ def check_dep (depends, dep_type, check_archs, filename, files): if stable_virtual[dep].has_key(arch): if not constraint and not version: if Options["debug"]: - print "Found %s as a virtual package." % (utils.pp_dep(parsed_dep)); + print "Found %s as a virtual package." % (utils.pp_deps(parsed_dep)); unsat = 0; break; # As part of the same .changes? @@ -96,12 +96,12 @@ def check_dep (depends, dep_type, check_archs, filename, files): dep_filename = "%s_%s_%s.deb" % (dep, epochless_version, arch); if files.has_key(dep_filename): if Options["debug"]: - print "Found %s in the same upload." % (utils.pp_dep(parsed_dep)); + print "Found %s in the same upload." % (utils.pp_deps(parsed_dep)); unsat = 0; break; # Not found... # [FIXME: must be a better way ... ] - error = "%s not found. [Real: " % (utils.pp_dep(parsed_dep)) + error = "%s not found. [Real: " % (utils.pp_deps(parsed_dep)) if stable.has_key(dep): if stable[dep].has_key(arch): error += "%s:%s:%s" % (dep, arch, stable[dep][arch]); @@ -126,7 +126,7 @@ def check_dep (depends, dep_type, check_archs, filename, files): unsat.append(error); if unsat: - sys.stderr.write("MWAAP! %s: '%s' %s can not be satisifed:\n" % (filename, utils.pp_dep(parsed_dep), dep_type)); + sys.stderr.write("MWAAP! %s: '%s' %s can not be satisifed:\n" % (filename, utils.pp_deps(parsed_dep), dep_type)); for error in unsat: sys.stderr.write(" %s\n" % (error)); pkg_unsat = 1; diff --git a/melanie b/melanie index 9cf88c99..0ca9abda 100755 --- a/melanie +++ b/melanie @@ -2,7 +2,7 @@ # General purpose package removal tool for ftpmaster # Copyright (C) 2000, 2001, 2002, 2003, 2004 James Troup -# $Id: melanie,v 1.42 2004-11-27 13:28:16 troup Exp $ +# $Id: melanie,v 1.43 2004-11-27 18:12:57 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 @@ -98,11 +98,12 @@ def reverse_depends_check(removals, suites): print "Checking reverse dependencies..." components = Cnf.ValueList("Suite::%s::Components" % suites[0]) dep_problem = 0 + p2c = {}; for architecture in Cnf.ValueList("Suite::%s::Architectures" % suites[0]): if architecture in ["source", "all"]: continue - deps = {} - virtual_packages = {} + deps = {}; + virtual_packages = {}; 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... @@ -132,6 +133,7 @@ def reverse_depends_check(removals, suites): virtual_packages[virtual_pkg] = 0 if package not in removals: virtual_packages[virtual_pkg] += 1 + p2c[package] = component; packages.close() os.unlink(temp_filename); @@ -158,7 +160,12 @@ def reverse_depends_check(removals, suites): if dep_package in removals: unsat += 1 if unsat == len(dep): - print "%s has an unsatisfied dependency on %s: %s" % (package, architecture, utils.pp_dep(dep)) + component = p2c[package]; + if component != "main": + what = "%s/%s" (package, component); + else: + what = "** %s" % (package); + print "%s has an unsatisfied dependency on %s: %s" % (what, architecture, utils.pp_deps(dep)); dep_problem = 1 # Check source dependencies (Build-Depends and Build-Depends-Indep) @@ -191,7 +198,11 @@ def reverse_depends_check(removals, suites): if dep_package in removals: unsat += 1 if unsat == len(dep): - print "%s has an unsatisfied build-dependency: %s" % (source, utils.pp_dep(dep)) + if component != "main": + source = "%s/%s" % (source, component); + else: + source = "** %s" % (source); + print "%s has an unsatisfied build-dependency: %s" % (source, utils.pp_deps(dep)) dep_problem = 1 sources.close() os.unlink(temp_filename) @@ -498,7 +509,7 @@ def main (): Subst["__BCC__"] = "Bcc: " + ", ".join(bcc); else: Subst["__BCC__"] = "X-Filler: 42"; - Subst["__CC__"] = "X-Katie: melanie $Revision: 1.42 $"; + Subst["__CC__"] = "X-Katie: melanie $Revision: 1.43 $"; if carbon_copy: Subst["__CC__"] += "\nCc: " + ", ".join(carbon_copy); Subst["__SUITE_LIST__"] = suites_list; diff --git a/utils.py b/utils.py index 5872117d..ad4293e0 100644 --- a/utils.py +++ b/utils.py @@ -2,7 +2,7 @@ # Utility functions # Copyright (C) 2000, 2001, 2002, 2003, 2004 James Troup -# $Id: utils.py,v 1.71 2004-11-27 16:05:12 troup Exp $ +# $Id: utils.py,v 1.72 2004-11-27 18:12:57 troup Exp $ ################################################################################ @@ -31,8 +31,8 @@ import db_access; ################################################################################ re_comments = re.compile(r"\#.*") -re_no_epoch = re.compile(r"^\d*\:") -re_no_revision = re.compile(r"\-[^-]*$") +re_no_epoch = re.compile(r"^\d+\:") +re_no_revision = re.compile(r"-[^-]+$") re_arch_from_filename = re.compile(r"/binary-[^/]+/") re_extract_src_version = re.compile (r"(\S+)\s*\((.*)\)") re_isadeb = re.compile (r"(.+?)_(.+?)_(.+)\.u?deb$"); @@ -48,7 +48,7 @@ changes_parse_error_exc = "Can't parse line in .changes file"; invalid_dsc_format_exc = "Invalid .dsc file"; nk_format_exc = "Unknown Format: in .changes file"; no_files_exc = "No Files: field in .dsc or .changes file."; -cant_open_exc = "Can't read file."; +cant_open_exc = "Can't open file"; unknown_hostname_exc = "Unknown hostname"; cant_overwrite_exc = "Permission denied; can't overwrite existent file." file_exists_exc = "Destination file exists"; @@ -546,8 +546,8 @@ def changes_compare (a, b): return q; # Sort by source version - a_version = a_changes.get("version"); - b_version = b_changes.get("version"); + a_version = a_changes.get("version", "0"); + b_version = b_changes.get("version", "0"); q = apt_pkg.VersionCompare(a_version, b_version); if q: return q; @@ -654,7 +654,7 @@ def join_with_commas_and(list): ################################################################################ -def pp_dep (deps): +def pp_deps (deps): pp_deps = []; for atom in deps: (pkg, version, constraint) = atom;