[pacman-dev] [PATCH 09/10] makepkg: Clear ERR trap before trying to restore it
Allan McRae
allan at archlinux.org
Mon Jun 4 07:59:26 UTC 2018
On 01/06/18 02:24, Jan Alexander Steffens (heftig) wrote:
> $restoretrap is empty if the trap was not set. This caused the trap
> handler to remain and override later exit codes.
How is this ever unset? We set the error trap early in makepkg:
trap 'trap_exit USR1 "$(gettext "An unknown error has occurred.
Exiting...")"' ERR
> ---
> scripts/makepkg.sh.in | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
> index ed0ceaec..3a3f4c30 100644
> --- a/scripts/makepkg.sh.in
> +++ b/scripts/makepkg.sh.in
> @@ -432,6 +432,7 @@ run_function_safe() {
>
> run_function "$1"
>
> + trap - ERR
> eval "$restoretrap"
> eval "$restoreset"
> eval "$restoreshopt"
>
More information about the pacman-dev
mailing list