makepkg: ensure '-' is last in a character glob

If '-' isn't the last item, it's interpreted as a range and not
literally, causing problematic behavior in parsing optdepends.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
This commit is contained in:
Dave Reisner 2011-09-27 11:27:54 -04:00
parent e70d540501
commit 619c3629ca
1 changed files with 2 additions and 1 deletions

View File

@ -1530,7 +1530,8 @@ check_sanity() {
sed -e "s/optdepends=/optdepends_list+=/" -e "s/#.*//" -e 's/\\$//')
for i in "${optdepends_list[@]}"; do
local pkg=${i%%:[[:space:]]*}
if [[ $pkg != +([[:alnum:]><=.+_-:]) ]]; then
# the '-' character _must_ be first or last in the character range
if [[ $pkg != +([-[:alnum:]><=.+_:]) ]]; then
error "$(gettext "Invalid syntax for %s : '%s'")" "optdepend" "$i"
ret=1
fi