]> git.decadent.org.uk Git - dak.git/commitdiff
Pass compression methods to FileWriter.
authorAnsgar Burchardt <ansgar@debian.org>
Sun, 19 Feb 2012 14:06:04 +0000 (14:06 +0000)
committerAnsgar Burchardt <ansgar@debian.org>
Sun, 27 Oct 2013 15:15:34 +0000 (16:15 +0100)
dak/generate_packages_sources2.py

index f0e08654525c5debb9e2a86bc650f5c2c46de95c..8b4773d8528152f4b6c32a19a38730eb4ae8eba4 100755 (executable)
@@ -103,7 +103,13 @@ def generate_sources(suite_id, component_id):
 
     overridesuite_id = suite.get_overridesuite().suite_id
 
-    writer = SourcesFileWriter(suite=suite.suite_name, component=component.component_name)
+    writer_args = {
+            'suite': suite.suite_name,
+            'component': component.component_name
+    }
+    if suite.indices_compression is not None:
+        writer_args['compression'] = suite.indices_compression
+    writer = SourcesFileWriter(**writer_args)
     output = writer.open()
 
     # run query and write Sources
@@ -226,8 +232,15 @@ def generate_packages(suite_id, component_id, architecture_id, type_name):
     if include_long_description:
         metadata_skip.append("Description-md5")
 
-    writer = PackagesFileWriter(suite=suite.suite_name, component=component.component_name,
-            architecture=architecture.arch_string, debtype=type_name)
+    writer_args = {
+            'suite': suite.suite_name,
+            'component': component.component_name,
+            'architecture': architecture.arch_string,
+            'debtype': type_name
+    }
+    if suite.indices_compression is not None:
+        writer_args['compression'] = suite.indices_compression
+    writer = PackagesFileWriter(**writer_args)
     output = writer.open()
 
     r = session.execute(_packages_query, {"suite": suite_id, "component": component_id,
@@ -287,7 +300,14 @@ def generate_translations(suite_id, component_id):
     suite = session.query(Suite).get(suite_id)
     component = session.query(Component).get(component_id)
 
-    writer = TranslationFileWriter(suite=suite.suite_name, component=component.component_name, language="en")
+    writer_args = {
+            'suite': suite.suite_name,
+            'component': component.component_name,
+            'language': 'en',
+    }
+    if suite.i18n_compression is not None:
+        writer_args['compression'] = suite.i18n_compression
+    writer = TranslationFileWriter(**writer_args)
     output = writer.open()
 
     r = session.execute(_translations_query, {"suite": suite_id, "component": component_id})