makepkg: pkgver and pkgrel can not have whitespace

There is always someone who tries to break things (cough *Dave* cough...)

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Allan McRae 2011-07-22 12:37:25 +10:00 committed by Dan McGee
parent 06974ebf2f
commit 00949db191
1 changed files with 6 additions and 4 deletions

View File

@ -1343,12 +1343,14 @@ check_sanity() {
error "$(gettext "%s is not allowed to start with a hyphen.")" "pkgbase"
ret=1
fi
if [[ $pkgver =~ [:-] ]]; then
error "$(gettext "%s is not allowed to contain colons or hyphens.")" "pkgver"
if [[ $pkgver =~ [[:space:]:-] ]]; then
error "$(gettext "%s is not allowed to contain colons, hyphens or whitespace.")" "pkgver"
ret=1
fi
if [[ $pkgrel != ${pkgrel//-/} ]]; then
error "$(gettext "%s is not allowed to contain hyphens.")" "pkgrel"
if [[ $pkgrel =~ [[:space:]-] ]]; then
error "$(gettext "%s is not allowed to contain hyphens or whitespace.")" "pkgrel"
ret=1
fi