1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-22 07:48:50 -05:00

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

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