makepkg: use more awk'ish syntax in sanity checks
This simplifies the flow a bit, making the pipeline a little easier to grok. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
This commit is contained in:
parent
4ed12aec30
commit
905ae640cf
1 changed files with 6 additions and 6 deletions
|
@ -1448,8 +1448,8 @@ check_sanity() {
|
||||||
ret=1
|
ret=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
awk -F'=' '/^[[:space:]]*pkgver=/ { $1=""; print $0 }' "$BUILDFILE" |
|
awk -F'=' '$1 ~ /^[[:space:]]*pkgver$/' "$BUILDFILE" |
|
||||||
while read -r i; do
|
while IFS='=' read -r _ i; do
|
||||||
eval i=\"$(sed 's/^\(['\''"]\)\(.*\)\1$/\2/' <<< "$i")\"
|
eval i=\"$(sed 's/^\(['\''"]\)\(.*\)\1$/\2/' <<< "$i")\"
|
||||||
if [[ $i = *[[:space:]:-]* ]]; then
|
if [[ $i = *[[:space:]:-]* ]]; then
|
||||||
error "$(gettext "%s is not allowed to contain colons, hyphens or whitespace.")" "pkgver"
|
error "$(gettext "%s is not allowed to contain colons, hyphens or whitespace.")" "pkgver"
|
||||||
|
@ -1457,8 +1457,8 @@ check_sanity() {
|
||||||
fi
|
fi
|
||||||
done || ret=1
|
done || ret=1
|
||||||
|
|
||||||
awk -F'=' '/^[[:space:]]*pkgrel=/ { $1=""; print $0 }' "$BUILDFILE" |
|
awk -F'=' '$1 ~ /^[[:space:]]*pkgrel$/' "$BUILDFILE" |
|
||||||
while read -r i; do
|
while IFS='=' read -r _ i; do
|
||||||
eval i=\"$(sed 's/^\(['\''"]\)\(.*\)\1$/\2/' <<< "$i")\"
|
eval i=\"$(sed 's/^\(['\''"]\)\(.*\)\1$/\2/' <<< "$i")\"
|
||||||
if [[ $i = *[[:space:]-]* ]]; then
|
if [[ $i = *[[:space:]-]* ]]; then
|
||||||
error "$(gettext "%s is not allowed to contain hyphens or whitespace.")" "pkgrel"
|
error "$(gettext "%s is not allowed to contain hyphens or whitespace.")" "pkgrel"
|
||||||
|
@ -1466,8 +1466,8 @@ check_sanity() {
|
||||||
fi
|
fi
|
||||||
done || ret=1
|
done || ret=1
|
||||||
|
|
||||||
awk -F'=' '/^[[:space:]]*epoch=/ { $1=""; print $0 }' "$BUILDFILE" |
|
awk -F'=' '$1 ~ /^[[:space:]]*epoch$/' "$BUILDFILE" |
|
||||||
while read -r i; do
|
while IFS='=' read -r _ i; do
|
||||||
eval i=\"$(sed 's/^\(['\''"]\)\(.*\)\1$/\2/' <<< "$i")\"
|
eval i=\"$(sed 's/^\(['\''"]\)\(.*\)\1$/\2/' <<< "$i")\"
|
||||||
if [[ $i != *([[:digit:]]) ]]; then
|
if [[ $i != *([[:digit:]]) ]]; then
|
||||||
error "$(gettext "%s must be an integer.")" "epoch"
|
error "$(gettext "%s must be an integer.")" "epoch"
|
||||||
|
|
Loading…
Add table
Reference in a new issue