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

makepkg: disable extglob when sourcing BUILDSCRIPT

PKGBUILDs are advertised as being pure bash so it would be expected
that the default bash options are in effect when sourcing it.

This inadvertantly "fixes" FS#27780 where enabling extglob causes
the bash parser to error on non-valid bash function names like
package_libxml++(). Note that these function names are unsupported
in bash and could break again even with this "fix" in future bash
releases.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Allan McRae 2012-02-11 14:15:38 +10:00 committed by Dan McGee
parent 9b1ab3d767
commit 31432edcbe

View File

@ -2106,7 +2106,9 @@ if [[ ! -f $BUILDFILE ]]; then
else
# PKGBUILD passed through a pipe
BUILDFILE=/dev/stdin
shopt -u extglob
source "$BUILDFILE"
shopt -s extglob
fi
else
crlftest=$(file "$BUILDFILE" | grep -F 'CRLF' || true)
@ -2118,7 +2120,9 @@ else
if [[ ${BUILDFILE:0:1} != "/" ]]; then
BUILDFILE="$startdir/$BUILDFILE"
fi
shopt -u extglob
source "$BUILDFILE"
shopt -s extglob
fi
# set defaults if they weren't specified in buildfile