From 819f6750047cbdb7ecb7fa4724f90e532cd73446 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Fri, 22 Jul 2011 16:30:41 +1000 Subject: makepkg: check overrides for pkgrel and pkgver Enforce syntax checking for pkgrel and pkgver overrides in package functions. Signed-off-by: Allan McRae Signed-off-by: Dan McGee --- scripts/makepkg.sh.in | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 96fe4004..da1cec85 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -1344,15 +1344,21 @@ check_sanity() { ret=1 fi - if [[ $pkgver =~ [[:space:]:-] ]]; then - error "$(gettext "%s is not allowed to contain colons, hyphens or whitespace.")" "pkgver" - ret=1 - fi + awk -F'=' '/^[[:space:]]*pkgver=/ { $1=""; print $0 }' "$BUILDFILE" | + while read i _; do + if [[ $i =~ [[:space:]:-] ]]; then + error "$(gettext "%s is not allowed to contain colons, hyphens or whitespace.")" "pkgver" + return 1 + fi + done || ret=1 - if [[ $pkgrel =~ [[:space:]-] ]]; then - error "$(gettext "%s is not allowed to contain hyphens or whitespace.")" "pkgrel" - ret=1 - fi + awk -F'=' '/^[[:space:]]*pkgrel=/ { $1=""; print $0 }' "$BUILDFILE" | + while read i _; do + if [[ $i =~ [[:space:]-] ]]; then + error "$(gettext "%s is not allowed to contain hyphens or whitespace.")" "pkgrel" + return 1 + fi + done || ret=1 if [[ ! $epoch =~ ^[0-9]*$ ]]; then error "$(gettext "%s must be an integer.")" "epoch" -- cgit v1.2.3-24-g4f1b