On Tue, Oct 11, 2011 at 12:19:42PM -0500, Dan McGee wrote:
Instead of always showing "==> ERROR: TERM signal caught. Exiting...", replace "TERM" with whatever signal is actually caught.
Signed-off-by: Lukas Fleischer <archlinux@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" You need to use '%s' in the gettext string, and then pass $signal to
On Tue, Oct 11, 2011 at 12:00 PM, Lukas Fleischer <archlinux@cryptocrack.de> wrote: the trap_exit invocation; e.g. trap 'trap_exit "$(gettext "'%s' signal caught. Exiting...")" $signal' $signal
Right, I missed the gettext part... :/ Note that we use the same code in makepkg. I'll fix both repo-add and makepkg when resubmitting the patch.
+done trap 'trap_exit "$(gettext "Aborted by user! Exiting...")"' INT trap 'trap_exit "$(gettext "An unknown error has occured. Exiting...")"' ERR We should also correct this spelling mistake- ouch. s/occured/occurred/ here.
Will do.
-- 1.7.7