index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dave Reisner <dreisner@archlinux.org> | 2012-03-02 19:25:15 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2012-03-08 18:01:53 -0600 |
commit | 1a8c3e52d70bfa21ba108aa77179adf90401949d (patch) | |
tree | 9ada8dd083b545606fb60449914e8e4194b710bd /scripts | |
parent | 1fe6cabc4d3868510427e32b60c9aa869886acab (diff) |
-rw-r--r-- | scripts/makepkg.sh.in | 13 |
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 7c86b77f..4656ab03 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -118,12 +118,17 @@ error() { # the fakeroot call, the error message will be printed by the main call. ## trap_exit() { + local signal=$1; shift + if (( ! INFAKEROOT )); then echo error "$@" fi [[ -n $srclinks ]] && rm -rf "$srclinks" - exit 1 + + # unset the trap for this signal, and then call the default handler + trap -- "$signal" + kill "-$signal" "$$" } @@ -1964,10 +1969,10 @@ done # setup signal traps trap 'clean_up' 0 for signal in TERM HUP QUIT; do - trap "trap_exit \"$(gettext "%s signal caught. Exiting...")\" \"$signal\"" "$signal" + trap "trap_exit $signal \"$(gettext "%s signal caught. Exiting...")\" \"$signal\"" "$signal" done -trap 'trap_exit "$(gettext "Aborted by user! Exiting...")"' INT -trap 'trap_exit "$(gettext "An unknown error has occurred. Exiting...")"' ERR +trap 'trap_exit INT "$(gettext "Aborted by user! Exiting...")"' INT +trap 'trap_exit USR1 "$(gettext "An unknown error has occurred. Exiting...")"' ERR set -E # preserve environment variables and canonicalize path |