X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fcruft_report.py;h=cc5aa4b8520d946341ff61703c2aceb70a66cb9e;hb=1d79ca7f4979f4b1d1b7741b4d2ab8af8db7c347;hp=238cdd497463dbea6824437b4faa994940619eb5;hpb=9678ddd39550f29a651ca1065dc0b4444e16d636;p=dak.git diff --git a/dak/cruft_report.py b/dak/cruft_report.py index 238cdd49..cc5aa4b8 100755 --- a/dak/cruft_report.py +++ b/dak/cruft_report.py @@ -242,6 +242,20 @@ def do_obsolete_source(duplicate_bins, bin2source): print " dak rm -S -p -m \"[auto-cruft] obsolete source package\" %s" % (" ".join(to_remove)) print +def get_suite_binaries(): + # Initalize a large hash table of all binary packages + binaries = {} + before = time.time() + + sys.stderr.write("[Getting a list of binary packages in %s..." % (suite)) + q = projectB.query("SELECT distinct b.package FROM binaries b, bin_associations ba WHERE ba.suite = %s AND ba.bin = b.id" % (suite_id)) + ql = q.getresult() + sys.stderr.write("done. (%d seconds)]\n" % (int(time.time()-before))) + for i in ql: + binaries[i[0]] = "" + + return binaries + ################################################################################ def main (): @@ -294,14 +308,7 @@ def main (): bin_not_built = {} if "bnb" in checks: - # Initalize a large hash table of all binary packages - before = time.time() - sys.stderr.write("[Getting a list of binary packages in %s..." % (suite)) - q = projectB.query("SELECT distinct b.package FROM binaries b, bin_associations ba WHERE ba.suite = %s AND ba.bin = b.id" % (suite_id)) - ql = q.getresult() - sys.stderr.write("done. (%d seconds)]\n" % (int(time.time()-before))) - for i in ql: - bins_in_suite[i[0]] = "" + bins_in_suite = get_suite_binaries() # Checks based on the Sources files components = Cnf.ValueList("Suite::%s::Components" % (suite))