X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=katie.py;h=e898c2f01a41dff16726f4fa47ba41b440c67942;hb=a8d77c16b228febaed8f4cd0a85dc010a61d382c;hp=d191904487942918ade08979a21b58df7fb82fcc;hpb=f2f237c936b5d5727c2b70be85cdacd2903c05b2;p=dak.git diff --git a/katie.py b/katie.py index d1919044..e898c2f0 100644 --- a/katie.py +++ b/katie.py @@ -2,7 +2,7 @@ # Utility functions for katie # Copyright (C) 2001, 2002, 2003, 2004 James Troup -# $Id: katie.py,v 1.46 2004-04-03 02:49:46 troup Exp $ +# $Id: katie.py,v 1.51 2004-11-27 18:02:22 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 @@ -30,9 +30,9 @@ from types import *; re_isanum = re.compile (r"^\d+$"); re_default_answer = re.compile(r"\[(.*)\]"); -re_fdnic = re.compile("\n\n"); -re_bin_only_nmu_of_mu = re.compile("\.\d+\.\d+$"); -re_bin_only_nmu_of_nmu = re.compile("\.\d+$"); +re_fdnic = re.compile(r"\n\n"); +re_bin_only_nmu_of_mu = re.compile(r"\.\d+\.\d+$"); +re_bin_only_nmu_of_nmu = re.compile(r"\.\d+$"); ############################################################################### @@ -705,7 +705,7 @@ distribution."""; return okay ################################################################################ - + def in_override_p (self, package, component, suite, binary_type, file): files = self.pkg.files; @@ -726,7 +726,7 @@ distribution."""; type_id = db_access.get_override_type_id(type); # FIXME: nasty non-US speficic hack - if component[:7].lower() == "non-us/": + if component.lower().startswith("non-us/"): component = component[7:]; q = self.projectB.query("SELECT s.section, p.priority FROM override o, section s, priority p WHERE package = '%s' AND suite = %s AND component = %s AND type = %s AND o.section = s.id AND o.priority = p.id" @@ -775,10 +775,10 @@ distribution."""; existent_version = entry[0]; suite = entry[1]; if suite in must_be_newer_than and \ - apt_pkg.VersionCompare(new_version, existent_version) != 1: + apt_pkg.VersionCompare(new_version, existent_version) < 1: self.reject("%s: old version (%s) in %s >= new version (%s) targeted at %s." % (file, existent_version, suite, new_version, target_suite)); if suite in must_be_older_than and \ - apt_pkg.VersionCompare(new_version, existent_version) != -1: + apt_pkg.VersionCompare(new_version, existent_version) > -1: self.reject("%s: old version (%s) in %s <= new version (%s) targeted at %s." % (file, existent_version, suite, new_version, target_suite)); ################################################################################ @@ -851,12 +851,11 @@ SELECT s.version, su.suite_name FROM source s, src_associations sa, suite su actual_size = int(files[dsc_file]["size"]); found = "%s in incoming" % (dsc_file) # Check the file does not already exist in the archive - q = self.projectB.query("SELECT size, md5sum, filename FROM files WHERE filename LIKE '%%%s%%'" % (dsc_file)); - + q = self.projectB.query("SELECT f.size, f.md5sum, l.path, f.filename FROM files f, location l WHERE f.filename LIKE '%%%s%%' AND l.id = f.location" % (dsc_file)); ql = q.getresult(); # Strip out anything that isn't '%s' or '/%s$' for i in ql: - if i[2] != dsc_file and i[2][-(len(dsc_file)+1):] != '/'+dsc_file: + if i[3] != dsc_file and i[3][-(len(dsc_file)+1):] != '/'+dsc_file: ql.remove(i); # "[katie] has not broken them. [katie] has fixed a @@ -878,6 +877,7 @@ SELECT s.version, su.suite_name FROM source s, src_associations sa, suite su files[dsc_file]["md5sum"] == i[1]: self.reject("ignoring %s, since it's already in the archive." % (dsc_file), "Warning: "); del files[dsc_file]; + self.pkg.orig_tar_gz = i[2] + i[3]; match = 1; if not match: