[pacman-dev] [PATCH] makepkg: fix abortion after sourcing /etc/profile

Cedric Staniewski cedric at gmx.ca
Thu Nov 5 14:01:38 EST 2009


Cedric Staniewski wrote:
> The source command triggers / could trigger the ERR trap which makes
> makepkg abort right after a successful installation of missing dependencies.
> 
> Signed-off-by: Cedric Staniewski <cedric at gmx.ca>
> ---
> It works, but I'm totally clueless why. I would prefer a more obvious solution
> if we can find one (set +E ... set -E did not work for me).
> 
> scripts/makepkg.sh.in |    7 +++----
>  1 files changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
> index 92b0454..81f20bb 100644
> --- a/scripts/makepkg.sh.in
> +++ b/scripts/makepkg.sh.in
> @@ -371,10 +371,9 @@ handle_deps() {
>  	fi
>  
>  	# we might need the new system environment
> -	# set -e can cause problems during sourcing profile scripts
> -	set +e
> -	source /etc/profile &>/dev/null
> -	set -e
> +	# avoid triggering the ERR trap by running the
> +	# source command in a subshell
> +	$(source /etc/profile &>/dev/null)
>  
>  	return $R_DEPS_SATISFIED
>  }

This one is stupid, sorry. Makepkg does not abort anymore, but the source command is pointless now. So we have to find another way to work around this nice errtrace option.


More information about the pacman-dev mailing list