From 7452ea84e72920178f3af1a717e7f034b5164449 Mon Sep 17 00:00:00 2001 From: Matthias Klumpp Date: Wed, 18 May 2016 22:11:20 +0200 Subject: [PATCH] dep11: Validate .xz compressed files as well --- scripts/debian/dep11-basic-validate.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/debian/dep11-basic-validate.py b/scripts/debian/dep11-basic-validate.py index 6f46e14b..467b4e21 100755 --- a/scripts/debian/dep11-basic-validate.py +++ b/scripts/debian/dep11-basic-validate.py @@ -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 -- 2.39.5