From cf1f0143935fe62ebb568202ff83ba2de0815995 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Tue, 30 Aug 2011 11:01:37 -0400 Subject: makepkg: fix sanity checking in versioning Read the entire variable, respecting escapes, which are necessary to retain for the successive eval. Signed-off-by: Dave Reisner Signed-off-by: Dan McGee --- scripts/makepkg.sh.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index a9daea4b..e74e5c81 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -1449,7 +1449,7 @@ check_sanity() { fi awk -F'=' '/^[[:space:]]*pkgver=/ { $1=""; print $0 }' "$BUILDFILE" | - while read i _; do + while read -r i; do eval i=\"$(sed 's/^\(['\''"]\)\(.*\)\1$/\2/' <<< "$i")\" if [[ $i =~ [[:space:]:-] ]]; then error "$(gettext "%s is not allowed to contain colons, hyphens or whitespace.")" "pkgver" @@ -1458,7 +1458,7 @@ check_sanity() { done || ret=1 awk -F'=' '/^[[:space:]]*pkgrel=/ { $1=""; print $0 }' "$BUILDFILE" | - while read i _; do + while read -r i; do eval i=\"$(sed 's/^\(['\''"]\)\(.*\)\1$/\2/' <<< "$i")\" if [[ $i =~ [[:space:]-] ]]; then error "$(gettext "%s is not allowed to contain hyphens or whitespace.")" "pkgrel" @@ -1467,7 +1467,7 @@ check_sanity() { done || ret=1 awk -F'=' '/^[[:space:]]*epoch=/ { $1=""; print $0 }' "$BUILDFILE" | - while read i _; do + while read -r i; do eval i=\"$(sed 's/^\(['\''"]\)\(.*\)\1$/\2/' <<< "$i")\" if [[ ! $i =~ ^[0-9]*$ ]]; then error "$(gettext "%s must be an integer.")" "epoch" -- cgit v1.2.3-24-g4f1b