summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2011-09-27 11:27:54 -0400
committerDave Reisner <dreisner@archlinux.org>2011-09-27 11:35:17 -0400
commit619c3629ca61cea2c182fcb0197f9b84ba4209c3 (patch)
tree336af4dc3ec14ac4c7012c9fa62efc4a5c52517d
parente70d540501d718583a8e4b91ca5989af3f3db77d (diff)
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>
-rw-r--r--scripts/makepkg.sh.in3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 2703177b..86e74a68 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -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