[pacman-dev] [PATCH] makepkg: fix abortion after sourcing /etc/profile
Cedric Staniewski
cedric at gmx.ca
Tue Nov 10 14:47:09 EST 2009
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 at gmail.com> for finding this
solution.
Signed-off-by: Cedric Staniewski <cedric at gmx.ca>
---
scripts/makepkg.sh.in | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 92b0454..185f606 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -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
}
--
1.6.5.2
More information about the pacman-dev
mailing list