]> git.decadent.org.uk Git - dak.git/commitdiff
dep11: Validate .xz compressed files as well
authorMatthias Klumpp <matthias@tenstral.net>
Wed, 18 May 2016 20:11:20 +0000 (22:11 +0200)
committerAnsgar Burchardt <ansgar@debian.org>
Fri, 20 May 2016 07:03:32 +0000 (09:03 +0200)
scripts/debian/dep11-basic-validate.py

index 6f46e14b08c526e4ac97ed42bb4fba9f64aec882..467b4e21c4abc8f93d56e1893088a5c1d79ed860 100755 (executable)
@@ -19,6 +19,7 @@ import os
 import sys
 import yaml
 import gzip
+import lzma
 from voluptuous import Schema, Required, All, Any, Length, Range, Match, Url
 from optparse import OptionParser
 
@@ -154,6 +155,8 @@ def validate_file(fname):
     f = None
     if fname.endswith(".gz"):
         f = gzip.open(fname, 'r')
+    elif fname.endswith(".xz"):
+        f = lzma.open(fname, 'r')
     else:
         f = open(fname, 'r')
 
@@ -166,7 +169,7 @@ def validate_dir(dirname):
     ret = True
     for root, subfolders, files in os.walk(dirname):
         for fname in files:
-             if fname.endswith(".yml.gz"):
+             if fname.endswith(".yml.gz") or fname.endswith(".yml.xz"):
                  if not validate_file(os.path.join(root, fname)):
                      ret = False