]> git.decadent.org.uk Git - dak.git/blobdiff - dak/check_overrides.py
Merge branch 'typofix'
[dak.git] / dak / check_overrides.py
index 5cccfb6bbf07a6a69e2026db1f330d1b25d8a86b..75ba5a0e2171b880cc412108f2abf1b0869d9eba 100755 (executable)
@@ -77,11 +77,6 @@ Check for cruft in overrides.
 
 ################################################################################
 
-def gen_blacklist(dir):
-    for entry in os.listdir(dir):
-        entry = entry.split('_')[0]
-        blacklist[entry] = 1
-
 def process(osuite, affected_suites, originosuite, component, otype, session):
     global Logger, Options, sections, priorities
 
@@ -288,7 +283,7 @@ SELECT s.source FROM source s, src_associations sa, files f, location l,
                 # we can copy
                 packages[package] = 1
                 Logger.log(["copying missing override", osuite, component,
-                    type, package, priorities[i[1]], sections[i[2]], i[3]])
+                    otype, package, priorities[i[1]], sections[i[2]], i[3]])
                 if not Options["No-Action"]:
                     session.execute("""INSERT INTO override (package, suite, component,
                                                              priority, section, type, maintainer)
@@ -342,8 +337,6 @@ def main ():
     else:
         Logger = daklog.Logger(cnf, "check-overrides", 1)
 
-    gen_blacklist(cnf["Dir::Queue::Accepted"])
-
     for osuite in cnf.SubTree("Check-Overrides::OverrideSuites").List():
         if "1" != cnf["Check-Overrides::OverrideSuites::%s::Process" % osuite]:
             continue
@@ -360,19 +353,13 @@ def main ():
             pass
 
         print "Processing %s%s..." % (osuite, originremark)
+        suiteobj = get_suite(osuite)
         # Get a list of all suites that use the override file of 'osuite'
-        ocodename = cnf["Suite::%s::codename" % osuite].lower()
-        suites = []
-        suiteids = []
-        for suite in cnf.SubTree("Suite").List():
-            if ocodename == cnf["Suite::%s::OverrideCodeName" % suite].lower():
-                suites.append(suite)
-                s = get_suite(suite.lower(), session)
-                if s is not None:
-                    suiteids.append(s.suite_id)
-
-        if len(suiteids) != len(suites) or len(suiteids) < 1:
-            utils.fubar("Couldn't find id's of all suites: %s" % suites)
+        ocodename = suiteobj.codename
+        suiteids = [x.suite_id for x in session.query(Suite).filter(Suite.overridecodename == ocodename).all()]
+
+        if len(suiteids) < 1:
+            utils.fubar("Couldn't find id's of all suites: %s" % suiteids)
 
         for component in cnf.SubTree("Component").List():
             # It is crucial for the dsc override creation based on binary
@@ -381,8 +368,8 @@ def main ():
             otypes.remove("dsc")
             otypes = ["dsc"] + otypes
             for otype in otypes:
-                print "Processing %s [%s - %s] using %s..." \
-                    % (osuite, component, otype, suites)
+                print "Processing %s [%s - %s]" \
+                    % (osuite, component, otype)
                 sys.stdout.flush()
                 process(osuite, suiteids, originosuite, component, otype, session)