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:
parent
e70d540501
commit
619c3629ca
1 changed files with 2 additions and 1 deletions
|
@ -1530,7 +1530,8 @@ check_sanity() {
|
||||||
sed -e "s/optdepends=/optdepends_list+=/" -e "s/#.*//" -e 's/\\$//')
|
sed -e "s/optdepends=/optdepends_list+=/" -e "s/#.*//" -e 's/\\$//')
|
||||||
for i in "${optdepends_list[@]}"; do
|
for i in "${optdepends_list[@]}"; do
|
||||||
local pkg=${i%%:[[:space:]]*}
|
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"
|
error "$(gettext "Invalid syntax for %s : '%s'")" "optdepend" "$i"
|
||||||
ret=1
|
ret=1
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue