1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-23 00:08:50 -05:00

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>
This commit is contained in:
Dave Reisner 2011-09-10 23:21:22 -04:00 committed by Allan McRae
parent 7f1235ccbc
commit c736a12e86

View File

@ -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
}