- originosuite = None
- originremark = ""
- try:
- originosuite = Cnf["Check-Overrides::OverrideSuites::%s::OriginSuite" % osuite]
- originosuite = originosuite.lower()
- originremark = " taking missing from %s" % originosuite
- except KeyError:
- pass
-
- 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].lower()
- suites = []
- for suite in Cnf.SubTree("Suite").List():
- if ocodename == Cnf["Suite::%s::OverrideCodeName" % suite].lower():
- suites.append(suite)
-
- q = projectB.query("SELECT id FROM suite WHERE suite_name in (%s)" \
- % ", ".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)
-
- for component in Cnf.SubTree("Component").List():
- if component == "mixed":
- continue; # Ick
+ # Get a list of all suites that use the override file of 'suite.suite_name' as
+ # well as the suite
+ ocodename = suite.codename
+ suiteids = [x.suite_id for x in session.query(Suite).filter(Suite.overridecodename == ocodename).all()]
+ if suite.suite_id not in suiteids:
+ suiteids.append(suite.suite_id)
+
+ if len(suiteids) < 1:
+ utils.fubar("Couldn't find id's of all suites: %s" % suiteids)
+
+ for component in session.query(Component).all():