makepkg: Clear ERR trap before trying to restore it

$restoretrap is empty if the trap was not set. This caused the trap
handler to remain and override later exit codes.

Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Jan Alexander Steffens (heftig) 2018-05-31 18:24:54 +02:00 committed by Allan McRae
parent de8c5e78bb
commit f78914cc6e

View file

@ -432,6 +432,7 @@ run_function_safe() {
run_function "$1"
trap - ERR
eval "$restoretrap"
eval "$restoreset"
eval "$restoreshopt"