diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-11-23 21:02:45 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-11-23 21:02:45 +0000 |
commit | 0762cea8d53bacc739fba8e20d1ed6905bc0b59e (patch) | |
tree | de7099d948c76f1c1ffe3205e4f87963f0932334 | |
parent | 1399e02fdc79f9e365724f001f4bcbf59ca35ae3 (diff) | |
download | portage-0762cea8d53bacc739fba8e20d1ed6905bc0b59e.tar.gz portage-0762cea8d53bacc739fba8e20d1ed6905bc0b59e.tar.bz2 portage-0762cea8d53bacc739fba8e20d1ed6905bc0b59e.zip |
Fix SIGINT and SIGTERM trap handling so the temp dir always cleaned up when
killed.
svn path=/main/trunk/; revision=12055
-rwxr-xr-x | bin/etc-update | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bin/etc-update b/bin/etc-update index af200f6b4..35456525d 100755 --- a/bin/etc-update +++ b/bin/etc-update @@ -446,10 +446,9 @@ Please select from the menu above (-1 to exit, losing this merge): " } die() { - trap "" TERM - trap "" KILL + trap SIGTERM SIGINT - if [ ${2} -eq 0 ]; then + if [ "$2" -eq 0 ]; then echo "Exiting: ${1}" scan > /dev/null [ ${count} -gt 0 ] && echo "NOTE: ${count} updates remaining" @@ -500,7 +499,8 @@ eval $(portageq envvar -v CONFIG_PROTECT \ export PORTAGE_TMPDIR TMP="${PORTAGE_TMPDIR}/etc-update-$$" -trap die term +trap "die terminated 1" SIGTERM +trap "die interrupted 1" SIGINT [ -w ${PORTAGE_CONFIGROOT}etc ] || die "Need write access to ${PORTAGE_CONFIGROOT}etc" 1 #echo $PORTAGE_TMPDIR |