diff options
author | Dave Reisner <dreisner@archlinux.org> | 2011-09-27 17:27:54 +0200 |
---|---|---|
committer | Dave Reisner <dreisner@archlinux.org> | 2011-09-27 17:35:17 +0200 |
commit | 619c3629ca61cea2c182fcb0197f9b84ba4209c3 (patch) | |
tree | 336af4dc3ec14ac4c7012c9fa62efc4a5c52517d /scripts/makepkg.sh.in | |
parent | e70d540501d718583a8e4b91ca5989af3f3db77d (diff) | |
download | pacman-619c3629ca61cea2c182fcb0197f9b84ba4209c3.tar.gz pacman-619c3629ca61cea2c182fcb0197f9b84ba4209c3.tar.xz |
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>
Diffstat (limited to 'scripts/makepkg.sh.in')
-rw-r--r-- | scripts/makepkg.sh.in | 3 |
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 |