1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-08-13 17:03:46 -04:00

makepkg: enforce decimal format for pkgrel

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
This commit is contained in:
Dave Reisner 2012-02-15 00:01:45 -05:00 committed by Dan McGee
parent 82abe079ab
commit 708a227578

View File

@ -1481,8 +1481,8 @@ check_sanity() {
awk -F'=' '$1 ~ /^[[:space:]]*pkgrel$/' "$BUILDFILE" | sed "s/[[:space:]]*#.*//" |
while IFS='=' read -r _ i; do
eval i=\"$(sed 's/^\(['\''"]\)\(.*\)\1$/\2/' <<< "${i%%+([[:space:]])}")\"
if [[ $i = *[[:space:]-]* ]]; then
error "$(gettext "%s is not allowed to contain hyphens or whitespace.")" "pkgrel"
if [[ $i != +([0-9])?(.+([0-9])) ]]; then
error "$(gettext "%s must be a decimal.")" "pkgrel"
return 1
fi
done || ret=1