[pacman-dev] [PATCH] repo-add: Fix error messages on SIGHUP/SIGQUIT

Lukas Fleischer archlinux at cryptocrack.de
Tue Oct 11 13:00:11 EDT 2011

Instead of always showing "==> ERROR: TERM signal caught. Exiting...",
replace "TERM" with whatever signal is actually caught.

Signed-off-by: Lukas Fleischer <archlinux at cryptocrack.de>
 scripts/repo-add.sh.in |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in
index 753200b..7fc8637 100644
--- a/scripts/repo-add.sh.in
+++ b/scripts/repo-add.sh.in
@@ -569,7 +569,9 @@ tmpdir=$(mktemp -d /tmp/repo-tools.XXXXXXXXXX) || (\
 mkdir $tmpdir/tree
 trap 'clean_up' EXIT
-trap 'trap_exit "$(gettext "TERM signal caught. Exiting...")"' TERM HUP QUIT
+for signal in TERM HUP QUIT; do
+	trap 'trap_exit "$(gettext "'"$signal"' signal caught. Exiting...")"' "$signal"
 trap 'trap_exit "$(gettext "Aborted by user! Exiting...")"' INT
 trap 'trap_exit "$(gettext "An unknown error has occured. Exiting...")"' ERR

More information about the pacman-dev mailing list