X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fauto_decruft.py;h=62996e2b33a179b97b6fc3033883a865d549d4a0;hb=03a86547e5d9b209016cc0b23f825d3baea92f8c;hp=6157a4f3c9a7f9f74de35849627ff592013977ab;hpb=e33a5a490c854741c13a8666c583970c8befebed;p=dak.git diff --git a/dak/auto_decruft.py b/dak/auto_decruft.py index 6157a4f3..62996e2b 100644 --- a/dak/auto_decruft.py +++ b/dak/auto_decruft.py @@ -358,20 +358,17 @@ def sources2removals(source_list, suite_id, session): params = {"suite_id": suite_id, "sources": tuple(source_list)} q = session.execute(""" SELECT s.source, s.version, 'source', s.id - FROM source s, + FROM source s JOIN src_associations sa ON sa.source = s.id - JOIN suite su ON sa.suite = su.id - WHERE su.id = :suite_id AND s.source IN :sources""", params) + WHERE sa.suite = :suite_id AND s.source IN :sources""", params) to_remove.extend(q) q = session.execute(""" SELECT b.package, b.version, a.arch_string, b.id FROM binaries b JOIN bin_associations ba ON b.id = ba.bin JOIN architecture a ON b.architecture = a.id - JOIN suite su ON ba.suite = su.id JOIN source s ON b.source = s.id - JOIN src_associations sa ON s.id = sa.source AND sa.suite = su.id - WHERE su.id = :suite_id AND s.source IN :sources""", params) + WHERE ba.suite = :suite_id AND s.source IN :sources""", params) to_remove.extend(q) return to_remove @@ -416,8 +413,9 @@ def main (): ('n',"dry-run","Auto-Decruft::Options::Dry-Run"), ('d',"debug","Auto-Decruft::Options::Debug"), ('s',"suite","Auto-Decruft::Options::Suite","HasArg"), - ('z','if-newer-version-in',"Auto-Decruft::Options::OtherSuite", "HasArg"), - ('Z','if-newer-version-in-rm-msg',"Auto-Decruft::Options::OtherSuiteRMMsg", "HasArg")] + # The "\0" seems to be the only way to disable short options. + ("\0",'if-newer-version-in',"Auto-Decruft::Options::OtherSuite", "HasArg"), + ("\0",'if-newer-version-in-rm-msg',"Auto-Decruft::Options::OtherSuiteRMMsg", "HasArg")] for i in ["help", "Dry-Run", "Debug", "OtherSuite", "OtherSuiteRMMsg"]: if not cnf.has_key("Auto-Decruft::Options::%s" % (i)): cnf["Auto-Decruft::Options::%s" % (i)] = ""