The bash source command looks in the users PATH for the file to source
before the local directory. This causes issues when someone has a
PKGBUILD somewhere in their path (for unknown some reason...).
Fixes FS#14727.

Signed-off-by: Allan McRae <[email protected]>
---
 scripts/makepkg.sh.in |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index fefcc73..f94f925 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1527,6 +1527,7 @@ if [ ! -f "$BUILDSCRIPT" ]; then
        else
                # PKGBUILD passed through a pipe
                BUILDSCRIPT=/dev/stdin
+               source "$BUILDSCRIPT"
        fi
 else
        crlftest=$(file $BUILDSCRIPT | grep -F 'CRLF' || true)
@@ -1534,9 +1535,9 @@ else
                error "$(gettext "%s contains CRLF characters and cannot be 
sourced.")" "$BUILDSCRIPT"
                exit 1
        fi
-fi
 
-source "$BUILDSCRIPT"
+       source ./"$BUILDSCRIPT"
+fi
 
 if [ "$GENINTEG" -eq 1 ]; then
        mkdir -p "$srcdir"
-- 
1.6.3.1

_______________________________________________
pacman-dev mailing list
[email protected]
http://www.archlinux.org/mailman/listinfo/pacman-dev

Reply via email to