From: Ansgar Burchardt Date: Sat, 26 Mar 2011 22:49:17 +0000 (+0000) Subject: generate-packages-sources2: respect overridesuite X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=5e69dde072f82a87d56b3040a62a4a0f7f142df1;p=dak.git generate-packages-sources2: respect overridesuite Signed-off-by: Ansgar Burchardt --- diff --git a/dak/generate_packages_sources2.py b/dak/generate_packages_sources2.py index c23ede9b..f055aa56 100755 --- a/dak/generate_packages_sources2.py +++ b/dak/generate_packages_sources2.py @@ -89,7 +89,7 @@ JOIN priority pri ON o.priority = pri.id WHERE sa.suite = :suite - AND o.suite = :suite AND o.component = :component AND o.type = :dsc_type + AND o.suite = :overridesuite AND o.component = :component AND o.type = :dsc_type ORDER BY s.source, s.version @@ -104,11 +104,13 @@ def generate_sources(suite_id, component_id): suite = session.query(Suite).get(suite_id) component = session.query(Component).get(component_id) + overridesuite_id = suite.get_overridesuite().suite_id + writer = SourcesFileWriter(suite=suite.suite_name, component=component.component_name) output = writer.open() # run query and write Sources - r = session.execute(_sources_query, {"suite": suite_id, "component": component_id, "dsc_type": dsc_type}) + r = session.execute(_sources_query, {"suite": suite_id, "component": component_id, "dsc_type": dsc_type, "overridesuite": overridesuite_id}) for (stanza,) in r: print >>output, stanza print >>output, "" @@ -188,7 +190,7 @@ WHERE (architecture = :arch_all AND source NOT IN (SELECT DISTINCT source FROM tmp WHERE architecture <> :arch_all)) ) AND - o.type = :type_id AND o.suite = :suite AND o.component = :component + o.type = :type_id AND o.suite = :overridesuite AND o.component = :component ORDER BY tmp.package, tmp.version """ @@ -204,12 +206,15 @@ def generate_packages(suite_id, component_id, architecture_id, type_name): component = session.query(Component).get(component_id) architecture = session.query(Architecture).get(architecture_id) + overridesuite_id = suite.get_overridesuite().suite_id + writer = PackagesFileWriter(suite=suite.suite_name, component=component.component_name, architecture=architecture.arch_string, debtype=type_name) output = writer.open() r = session.execute(_packages_query, {"suite": suite_id, "component": component_id, - "arch": architecture_id, "type_id": type_id, "type_name": type_name, "arch_all": arch_all_id}) + "arch": architecture_id, "type_id": type_id, "type_name": type_name, "arch_all": arch_all_id, + "overridesuite": overridesuite_id}) for (stanza,) in r: print >>output, stanza print >>output, "" diff --git a/daklib/dbconn.py b/daklib/dbconn.py index 482ec471..d39f8c58 100755 --- a/daklib/dbconn.py +++ b/daklib/dbconn.py @@ -2872,6 +2872,12 @@ class Suite(ORMObject): return session.query(DBSource).filter_by(source = source). \ with_parent(self) + def get_overridesuite(self): + if self.overridesuite is None: + return self + else: + return object_session(self).query(Suite).filter_by(suite_name=self.overridesuite).one() + __all__.append('Suite') @session_wrapper