X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=scripts%2Fdebian%2Fdep11-basic-validate.py;h=03cd80c0c2b2845756483043fdb91b5f6ac1348b;hb=4f3c7874fd19d380b106a9d4bbab0403ed089359;hp=6f46e14b08c526e4ac97ed42bb4fba9f64aec882;hpb=dacd1b7a65dedbfbedfc3ef2a8e9393e198ff806;p=dak.git diff --git a/scripts/debian/dep11-basic-validate.py b/scripts/debian/dep11-basic-validate.py index 6f46e14b..03cd80c0 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 @@ -27,8 +28,8 @@ schema_header = Schema({ Required('Origin'): All(str, Length(min=1)), Required('Version'): All(str, Match(r'(\d+\.?)+$'), msg="Must be a valid version number"), Required('MediaBaseUrl'): All(str, Url()), - 'Time': All(str, str), - 'Priority': All(str, int), + 'Time': All(str), + 'Priority': All(int), }) schema_translated = Schema({ @@ -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