From c736a12e86b826f3079f3cccde86d497528f85f3 Mon Sep 17 00:00:00 2001
From: Dave Reisner <dreisner@archlinux.org>
Date: Sat, 10 Sep 2011 23:21:22 -0400
Subject: makepkg: unset errexit when sourcing /etc/profile

This is a fix for a bash3 specific bug, where a file sourced by
/etc/profile would exit non-zero and make its way back up to makepkg,
forcing it to exit after package installation. Along with unsetting the
ERR handler, temporarily unset errexit to avoid this.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
---
 scripts/makepkg.sh.in | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'scripts')

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 5981603b..b678f7e5 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -474,11 +474,13 @@ handle_deps() {
 	fi
 
 	# we might need the new system environment
-	# avoid triggering the ERR trap
+	# avoid triggering the ERR trap and exiting
+	set +e
 	local restoretrap=$(trap -p ERR)
 	trap - ERR
 	source /etc/profile &>/dev/null
 	eval $restoretrap
+	set -e
 
 	return $R_DEPS_SATISFIED
 }
-- 
cgit v1.2.3-2-g168b