Close #865: Check line endings in APKBUILDs (#868)

This commit is contained in:
Oliver Smith 2017-11-04 16:12:33 +00:00 committed by GitHub
parent 7ff0568d6f
commit 50faf5fe22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -96,8 +96,11 @@ def apkbuild(args, path):
if path in args.cache["apkbuild"]:
return args.cache["apkbuild"][path]
# Read the file and check line endings
with open(path, encoding="utf-8") as handle:
lines = handle.readlines()
if handle.newlines != '\n':
raise RuntimeError("Wrong line endings in APKBUILD: " + path)
# Parse all attributes from the config
ret = {}