summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-11-23 21:09:52 +0000
committerZac Medico <zmedico@gentoo.org>2008-11-23 21:09:52 +0000
commit3d581fcfd79a385abfd6dbe1ef54b749d58e3597 (patch)
tree0c9c75bbd70376174c9d32f75a67002fce630d26
parenta41448867295199ac9cafcfea9babce014e0e16b (diff)
downloadportage-3d581fcfd79a385abfd6dbe1ef54b749d58e3597.tar.gz
portage-3d581fcfd79a385abfd6dbe1ef54b749d58e3597.tar.bz2
portage-3d581fcfd79a385abfd6dbe1ef54b749d58e3597.zip
Fix SIGINT and SIGTERM trap handling so the temp dir always cleaned up when
killed. (trunk r12055) svn path=/main/branches/2.1.6/; revision=12056
-rwxr-xr-xbin/etc-update8
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