aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-11-03 22:47:37 +0000
committerZac Medico <zmedico@gentoo.org>2007-11-03 22:47:37 +0000
commit0437e79e58ae33acde15c7a999f7c20204fed593 (patch)
tree56c3f832b955b8f19bb5bc1ecb43cee39ead39e6 /bin/etc-update
parentBug #197965 - Make fetch() bail out after 5 checksum (diff)
downloadportage-0437e79e58ae33acde15c7a999f7c20204fed593.tar.gz
portage-0437e79e58ae33acde15c7a999f7c20204fed593.tar.bz2
portage-0437e79e58ae33acde15c7a999f7c20204fed593.zip
Call die() so that the $TMP directory is always properly
cleaned up. svn path=/main/trunk/; revision=8405
Diffstat (limited to 'bin/etc-update')
-rwxr-xr-xbin/etc-update13
1 files changed, 6 insertions, 7 deletions
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