X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fcruft_report.py;h=0f1125f81bc3c8f7eba5dcf9b170a81449ee0a9e;hb=bd78bbf9170cc8ee2dda06a7f060fd3370fea2bd;hp=8640ea6163e02581f86885717ce1742d61520763;hpb=430daaea3b7a870b4828cccb22a15b8ead3ba965;p=dak.git diff --git a/dak/cruft_report.py b/dak/cruft_report.py index 8640ea61..0f1125f8 100755 --- a/dak/cruft_report.py +++ b/dak/cruft_report.py @@ -182,8 +182,8 @@ SELECT s.source, s.version AS experimental, s2.version AS unstable FROM src_associations sa, source s, source s2, src_associations sa2 WHERE sa.suite = %s AND sa2.suite = %d AND sa.source = s.id AND sa2.source = s2.id AND s.source = s2.source - AND versioncmp(s.version, s2.version) < 0""" % (experimental_id, - database.get_suite_id("unstable"))) + AND s.version < s2.version""" % (experimental_id, + database.get_suite_id("unstable"))) ql = q.getresult() if ql: nviu_to_remove = [] @@ -377,7 +377,7 @@ def main (): for component in components: filename = "%s/dists/%s/%s/source/Sources.gz" % (Cnf["Dir::Root"], suite, 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)) @@ -429,7 +429,7 @@ def main (): for architecture in architectures: filename = "%s/dists/%s/%s/binary-%s/Packages.gz" % (Cnf["Dir::Root"], suite, component, architecture) # apt_pkg.ParseTagFile needs a real file handle - 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)) @@ -472,9 +472,10 @@ def main (): duplicate_bins.setdefault(key, []) if package not in duplicate_bins[key]: duplicate_bins[key].append(package) - if package in nfu_entries and \ - version != source_versions[source]: # only suggest to remove out-of-date packages - nfu_packages[architecture].append((package,version,source_versions[source])) + if "nfu" in checks: + if package in nfu_entries and \ + version != source_versions[source]: # only suggest to remove out-of-date packages + nfu_packages[architecture].append((package,version,source_versions[source])) packages.close() os.unlink(temp_filename)