]> err.no Git - dak/commitdiff
Make generate-filelist more readable.
authorTorsten Werner <twerner@debian.org>
Sun, 16 Jan 2011 21:02:19 +0000 (22:02 +0100)
committerTorsten Werner <twerner@debian.org>
Sun, 16 Jan 2011 21:02:19 +0000 (22:02 +0100)
Signed-off-by: Torsten Werner <twerner@debian.org>
dak/generate_filelist.py

index d90338a59d6913c016caf7fdbee8b1b50e0d6a5d..c8d51a54632f326eeeb68fa1e00190a772728fae 100755 (executable)
@@ -213,20 +213,21 @@ def main():
     if Options['Help']:
         usage()
     threadpool = ThreadPool()
-    for suite_name in utils.split_args(Options['Suite']):
-        suite = query_suites.filter_by(suite_name = suite_name).one()
-        for component_name in utils.split_args(Options['Component']):
-            component = session.query(Component).\
-                filter_by(component_name = component_name).one()
-            for arch_string in utils.split_args(Options['Architecture']):
-                architecture = query_architectures.\
-                    filter_by(arch_string = arch_string).one()
+    query_suites = query_suites. \
+        filter(Suite.suite_name.in_(utils.split_args(Options['Suite'])))
+    query_components = query_components. \
+        filter(Component.component_name.in_(utils.split_args(Options['Component'])))
+    query_architectures = query_architectures. \
+        filter(Architecture.arch_string.in_(utils.split_args(Options['Architecture'])))
+    for suite in query_suites:
+        for component in query_components:
+            for architecture in query_architectures:
                 if architecture not in suite.architectures:
                     pass
-                elif arch_string == 'source':
+                elif architecture.arch_string == 'source':
                     threadpool.queueTask(writeSourceList,
                         (suite, component, Options['Incremental']))
-                elif arch_string != 'all':
+                elif architecture.arch_string != 'all':
                     threadpool.queueTask(writeBinaryList,
                         (suite, component, architecture, 'deb',
                             Options['Incremental']))