From 50faf5fe22a023555e99d5830c5d402110207472 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Sat, 4 Nov 2017 16:12:33 +0000 Subject: [PATCH] Close #865: Check line endings in APKBUILDs (#868) --- pmb/parse/apkbuild.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pmb/parse/apkbuild.py b/pmb/parse/apkbuild.py index fc2f71b5..7b733f21 100644 --- a/pmb/parse/apkbuild.py +++ b/pmb/parse/apkbuild.py @@ -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 = {}