]> git.decadent.org.uk Git - dak.git/commitdiff
Only publish components in suites where they exist.
authorTollef Fog Heen <tfheen@varnish-software.com>
Wed, 9 Jan 2013 13:17:23 +0000 (14:17 +0100)
committerTollef Fog Heen <tfheen@err.no>
Tue, 10 Sep 2013 11:18:11 +0000 (13:18 +0200)
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 <tfheen@varnish-software.com>
dak/generate_packages_sources2.py
dak/generate_releases.py
daklib/dbconn.py

index d941d98487d782996b4fafcf2006b2aeb32890c9..2c69afce73c60108914a454ba197bd0ff921287c 100755 (executable)
@@ -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)
index c80e0d9ec7bb04b0339906d177953610658b5bb3..a86c33ce33090def79074f93bbd80135030f0f43 100755 (executable)
@@ -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)))
 
index b5d1ea87b5ec7276f2e080052ad2027d45a7d896..e611d47df2106e9a084d0951b9e9b3b44710e57b 100644 (file)
@@ -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,