[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH 2/2] cruft-report: Prefer .xz files over .gz



We are getting rid of .gz Packages and Sources, which are
already gone from experimental, and that causes the cruft
report to fail there. So look for the xz-compressed files
first, and fall-back to the gzip-compressed ones if the
former don't exist (e.g. for oldstable).

Signed-off-by: Emilio Pozuelo Monfort <pochu@debian.org>
---
 dak/cruft_report.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/dak/cruft_report.py b/dak/cruft_report.py
index 238409e..2170d2a 100755
--- a/dak/cruft_report.py
+++ b/dak/cruft_report.py
@@ -578,7 +578,9 @@ def main ():
     # Checks based on the Sources files
     components = get_component_names(session)
     for component in components:
-        filename = "%s/dists/%s/%s/source/Sources.gz" % (suite.archive.path, suite_name, component)
+        filename = "%s/dists/%s/%s/source/Sources.xz" % (suite.archive.path, suite_name, component)
+        if not os.path.exists(filename):
+            filename = "%s/dists/%s/%s/source/Sources.gz" % (suite.archive.path, suite_name, component)
         Sources = apt_pkg.TagFile(filename)
         while Sources.step():
             source = Sources.section.find('Package')
@@ -622,7 +624,9 @@ def main ():
                 nfu_packages.setdefault(architecture,[])
                 nfu_entries = parse_nfu(architecture)
 
-            filename = "%s/dists/%s/%s/binary-%s/Packages.gz" % (suite.archive.path, suite_name, component, architecture)
+            filename = "%s/dists/%s/%s/binary-%s/Packages.xz" % (suite.archive.path, suite_name, component, architecture)
+            if not os.path.exists(filename):
+                filename = "%s/dists/%s/%s/binary-%s/Packages.gz" % (suite.archive.path, suite_name, component, architecture)
             Packages = apt_pkg.TagFile(filename)
             while Packages.step():
                 package = Packages.section.find('Package')
-- 
2.9.3


Reply to: