]> err.no Git - dak/commitdiff
Remove class SuiteAchitecture completely.
authorTorsten Werner <twerner@debian.org>
Sun, 16 Jan 2011 20:47:00 +0000 (21:47 +0100)
committerTorsten Werner <twerner@debian.org>
Sun, 16 Jan 2011 20:50:31 +0000 (21:50 +0100)
Signed-off-by: Torsten Werner <twerner@debian.org>
dak/generate_filelist.py
daklib/dbconn.py

index a4aba326f1e4c8d14d862b3f91515c364ec54280..d90338a59d6913c016caf7fdbee8b1b50e0d6a5d 100755 (executable)
@@ -212,31 +212,27 @@ def main():
     Options = cnf.SubTree("Filelist::Options")
     if Options['Help']:
         usage()
-    suite_arch = session.query(SuiteArchitecture)
     threadpool = ThreadPool()
     for suite_name in utils.split_args(Options['Suite']):
         suite = query_suites.filter_by(suite_name = suite_name).one()
-        join = suite_arch.filter_by(suite_id = suite.suite_id)
         for component_name in utils.split_args(Options['Component']):
             component = session.query(Component).\
                 filter_by(component_name = component_name).one()
-            for architecture_name in utils.split_args(Options['Architecture']):
+            for arch_string in utils.split_args(Options['Architecture']):
                 architecture = query_architectures.\
-                    filter_by(arch_string = architecture_name).one()
-                try:
-                    join.filter_by(arch_id = architecture.arch_id).one()
-                    if architecture_name == 'source':
-                        threadpool.queueTask(writeSourceList,
-                            (suite, component, Options['Incremental']))
-                    elif architecture_name != 'all':
-                        threadpool.queueTask(writeBinaryList,
-                            (suite, component, architecture, 'deb',
-                                Options['Incremental']))
-                        threadpool.queueTask(writeBinaryList,
-                            (suite, component, architecture, 'udeb',
-                                Options['Incremental']))
-                except:
+                    filter_by(arch_string = arch_string).one()
+                if architecture not in suite.architectures:
                     pass
+                elif arch_string == 'source':
+                    threadpool.queueTask(writeSourceList,
+                        (suite, component, Options['Incremental']))
+                elif arch_string != 'all':
+                    threadpool.queueTask(writeBinaryList,
+                        (suite, component, architecture, 'deb',
+                            Options['Incremental']))
+                    threadpool.queueTask(writeBinaryList,
+                        (suite, component, architecture, 'udeb',
+                            Options['Incremental']))
     threadpool.joinAll()
     # this script doesn't change the database
     session.close()
index d66a64cfda64b036e9c847948227db5384f0bcf3..227a8af130e4b77e8b25ea011f4c87adebf5aa9a 100755 (executable)
@@ -2578,16 +2578,6 @@ __all__.append('get_suite')
 
 ################################################################################
 
-# TODO: remove SuiteArchitecture class
-class SuiteArchitecture(object):
-    def __init__(self, *args, **kwargs):
-        pass
-
-    def __repr__(self):
-        return '<SuiteArchitecture (%s, %s)>' % (self.suite_id, self.arch_id)
-
-__all__.append('SuiteArchitecture')
-
 # TODO: should be removed because the implementation is too trivial
 @session_wrapper
 def get_suite_architectures(suite, skipsrc=False, skipall=False, session=None):
@@ -3097,12 +3087,6 @@ class DBConn(object):
                                  policy_queue = relation(PolicyQueue),
                                  copy_queues = relation(BuildQueue, secondary=self.tbl_suite_build_queue_copy)))
 
-        mapper(SuiteArchitecture, self.tbl_suite_architectures,
-               properties = dict(suite_id = self.tbl_suite_architectures.c.suite,
-                                 suite = relation(Suite, backref='suitearchitectures'),
-                                 arch_id = self.tbl_suite_architectures.c.architecture,
-                                 architecture = relation(Architecture)))
-
         mapper(SuiteSrcFormat, self.tbl_suite_src_formats,
                properties = dict(suite_id = self.tbl_suite_src_formats.c.suite,
                                  suite = relation(Suite, backref='suitesrcformats'),