X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fcheck_overrides.py;h=ff01306d828e1e542f7a0c2735c7e51555885941;hb=cd5b29ddfd8de263c085f494b9573d683913f6f3;hp=9caeef4a88bd2ab6ab9fe3cbbff986041d810e5f;hpb=7aaaad3135c9164390af5897925660842368660b;p=dak.git diff --git a/dak/check_overrides.py b/dak/check_overrides.py index 9caeef4a..ff01306d 100755 --- a/dak/check_overrides.py +++ b/dak/check_overrides.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -# Cruft checker and hole filler for overrides +""" Cruft checker and hole filler for overrides """ # Copyright (C) 2000, 2001, 2002, 2004, 2006 James Troup # Copyright (C) 2005 Jeroen van Wolffelaar @@ -50,9 +50,9 @@ import pg, sys, os import apt_pkg -import dak.lib.database as database -import dak.lib.logging as logging -import dak.lib.utils as utils +from daklib import database +from daklib import logging +from daklib import utils ################################################################################ @@ -101,7 +101,6 @@ def process(osuite, affected_suites, originosuite, component, type): if type_id == -1: utils.fubar("Type '%s' not recognised. (Valid types are deb, udeb and dsc)" % (type)) dsc_type_id = database.get_override_type_id("dsc") - deb_type_id = database.get_override_type_id("deb") source_priority_id = database.get_priority_id("source") @@ -112,7 +111,7 @@ SELECT b.package FROM binaries b, bin_associations ba, files f, location l, component c WHERE b.type = '%s' AND b.id = ba.bin AND f.id = b.file AND l.id = f.location AND c.id = l.component AND ba.suite IN (%s) AND c.id = %s -""" % (type, ",".join(map(str,affected_suites)), component_id)) +""" % (type, ",".join([ str(i) for i in affected_suites ]), component_id)) for i in q.getresult(): packages[i[0]] = 0 @@ -122,7 +121,7 @@ SELECT s.source FROM source s, src_associations sa, files f, location l, component c WHERE s.id = sa.source AND f.id = s.file AND l.id = f.location AND c.id = l.component AND sa.suite IN (%s) AND c.id = %s -""" % (",".join(map(str,affected_suites)), component_id)) +""" % (",".join([ str(i) for i in affected_suites]), component_id)) for i in q.getresult(): src_packages[i[0]] = 0 @@ -156,7 +155,7 @@ SELECT s.source FROM source s, src_associations sa, files f, location l, if not src_packages.has_key(package) or src_packages[package]: continue src_packages[package] = 1 - + Logger.log(["add missing override", osuite, component, type, package, "source", sections[i[2]], i[3]]) if not Options["No-Action"]: @@ -315,19 +314,19 @@ def main (): print "Processing %s%s..." % (osuite, originremark) # Get a list of all suites that use the override file of 'osuite' - ocodename = Cnf["Suite::%s::codename" % osuite] + ocodename = Cnf["Suite::%s::codename" % osuite].lower() suites = [] for suite in Cnf.SubTree("Suite").List(): - if ocodename == Cnf["Suite::%s::OverrideCodeName" % suite]: + if ocodename == Cnf["Suite::%s::OverrideCodeName" % suite].lower(): suites.append(suite) q = projectB.query("SELECT id FROM suite WHERE suite_name in (%s)" \ - % ", ".join(map(repr, suites)).lower()) + % ", ".join([ repr(i) for i in suites ]).lower()) suiteids = [] for i in q.getresult(): suiteids.append(i[0]) - + if len(suiteids) != len(suites) or len(suiteids) < 1: utils.fubar("Couldn't find id's of all suites: %s" % suites) @@ -351,4 +350,3 @@ def main (): if __name__ == '__main__': main() -