Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   ArchLinux Pacman Development (http://www.linux-archive.org/archlinux-pacman-development/)
-   -   makepkg: disable extglob when sourcing BUILDSCRIPT (http://www.linux-archive.org/archlinux-pacman-development/631496-makepkg-disable-extglob-when-sourcing-buildscript.html)

Allan McRae 02-11-2012 03:27 AM

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>
---
scripts/makepkg.sh.in | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index a10dc5d..80bb1c9 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -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
--
1.7.9


All times are GMT. The time now is 01:17 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.