From 0437e79e58ae33acde15c7a999f7c20204fed593 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 3 Nov 2007 22:47:37 +0000 Subject: Call die() so that the $TMP directory is always properly cleaned up. svn path=/main/trunk/; revision=8405 --- bin/etc-update | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'bin') diff --git a/bin/etc-update b/bin/etc-update index bb1160a31..e8ba989c5 100755 --- a/bin/etc-update +++ b/bin/etc-update @@ -444,11 +444,13 @@ Please select from the menu above (-1 to exit, losing this merge): " die() { trap "" TERM trap "" KILL - echo "Exiting: ${1}" if [ ${2} -eq 0 ]; then + echo "Exiting: ${1}" scan > /dev/null [ ${count} -gt 0 ] && echo "NOTE: ${count} updates remaining" + else + echo "ERROR: ${1}" fi rm -rf "${TMP}" @@ -531,20 +533,17 @@ if [ "${using_editor}" == 0 ]; then echo > "${TMP}"/.diff-test-2 if ! diff_command "${TMP}"/.diff-test-1 "${TMP}"/.diff-test-2 ; then - echo "ERROR: '${diff_command}' does not seem to work, aborting" - exit 1 + die "'${diff_command}' does not seem to work, aborting" 1 fi else if ! type ${diff_command%% *} >/dev/null; then - echo "ERROR: '${diff_command}' does not seem to work, aborting" - exit 1 + die "'${diff_command}' does not seem to work, aborting" 1 fi fi if [[ ${mode} == "1" ]] ; then if ! type dialog >/dev/null || ! dialog --help >/dev/null ; then - echo "ERROR: mode=1 and 'dialog' not found or not executable, aborting" - exit 1 + die "mode=1 and 'dialog' not found or not executable, aborting" 1 fi fi -- cgit v1.2.3-1-g7c22