makepkg: fix abortion after sourcing /etc/profile

The source command triggers / might trigger the ERR trap which makes
makepkg abort right after a successful installation of missing
dependencies.

Thanks to Xavier Chantry <shiningxc@gmail.com> for finding this
solution.

Signed-off-by: Cedric Staniewski <cedric@gmx.ca>
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Cedric Staniewski 2009-11-10 20:47:09 +01:00 committed by Dan McGee
parent 0199a7ee71
commit 77e84bea71

View file

@ -371,10 +371,11 @@ handle_deps() {
fi
# we might need the new system environment
# set -e can cause problems during sourcing profile scripts
set +e
# avoid triggering the ERR trap
local restoretrap=$(trap -p ERR)
trap - ERR
source /etc/profile &>/dev/null
set -e
eval $restoretrap
return $R_DEPS_SATISFIED
}