From: Tollef Fog Heen Date: Wed, 9 Jan 2013 13:17:23 +0000 (+0100) Subject: Only publish components in suites where they exist. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=39799e5acc0db0c864ebea1b38fc6c1e1a5cec25;p=dak Only publish components in suites where they exist. When generating the sources and packages file, just generate those that should exist, according to the component_suite mapping. Signed-off-by: Tollef Fog Heen --- diff --git a/dak/generate_packages_sources2.py b/dak/generate_packages_sources2.py index d941d984..2c69afce 100755 --- a/dak/generate_packages_sources2.py +++ b/dak/generate_packages_sources2.py @@ -364,7 +364,6 @@ def main(): force = Options.has_key("Force") and Options["Force"] - component_ids = [ c.component_id for c in session.query(Component).all() ] def parse_results(message): # Split out into (code, msg) @@ -377,6 +376,7 @@ def main(): logger.log(['E: ', msg]) for s in suites: + component_ids = [ c.component_id for c in s.components ] if s.untouchable and not force: import utils utils.fubar("Refusing to touch %s (untouchable and not forced)" % s.suite_name) diff --git a/dak/generate_releases.py b/dak/generate_releases.py index c80e0d9e..a86c33ce 100755 --- a/dak/generate_releases.py +++ b/dak/generate_releases.py @@ -170,7 +170,7 @@ class ReleaseWriter(object): out.write("Architectures: %s\n" % (" ".join([a.arch_string for a in architectures]))) - components = [ c.component_name for c in session.query(Component) ] + components = [ c.component_name for c in suite.components ] out.write("Components: %s\n" % (" ".join(components))) diff --git a/daklib/dbconn.py b/daklib/dbconn.py index b5d1ea87..e611d47d 100644 --- a/daklib/dbconn.py +++ b/daklib/dbconn.py @@ -2560,6 +2560,7 @@ class DBConn(object): 'changelogs_text', 'changes', 'component', + 'component_suite', 'config', 'dsc_files', 'external_overrides', @@ -2835,7 +2836,10 @@ class DBConn(object): srcformats = relation(SrcFormat, secondary=self.tbl_suite_src_formats, backref=backref('suites', lazy='dynamic')), archive = relation(Archive, backref='suites'), - acls = relation(ACL, secondary=self.tbl_suite_acl_map, collection_class=set)), + acls = relation(ACL, secondary=self.tbl_suite_acl_map, collection_class=set), + components = relation(Component, secondary=self.tbl_component_suite, + order_by=self.tbl_component.c.ordering, + backref=backref('suite'))), extension = validator) mapper(Uid, self.tbl_uid,