X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=scripts%2Fdebian%2Fdep11-basic-validate.py;h=6ee3042b11f096a88b6268e12c50a6ec69decaa1;hb=HEAD;hp=467b4e21c4abc8f93d56e1893088a5c1d79ed860;hpb=7452ea84e72920178f3af1a717e7f034b5164449;p=dak.git diff --git a/scripts/debian/dep11-basic-validate.py b/scripts/debian/dep11-basic-validate.py index 467b4e21..6ee3042b 100755 --- a/scripts/debian/dep11-basic-validate.py +++ b/scripts/debian/dep11-basic-validate.py @@ -28,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({ @@ -169,9 +169,13 @@ def validate_dir(dirname): ret = True for root, subfolders, files in os.walk(dirname): for fname in files: - if fname.endswith(".yml.gz") or fname.endswith(".yml.xz"): - if not validate_file(os.path.join(root, fname)): - ret = False + fpath = os.path.join(root, fname) + if os.path.islink(fpath): + add_issue("FATAL: Symlinks are not allowed") + return False + if fname.endswith(".yml.gz") or fname.endswith(".yml.xz"): + if not validate_file(fpath): + ret = False return ret @@ -187,6 +191,9 @@ def main(): if os.path.isdir(fname): ret = validate_dir(fname) + elif os.path.islink(fname): + add_issue("FATAL: Symlinks are not allowed") + ret = False else: ret = validate_file(fname) if ret: