Initialize ${TMP} before registering the die trap so that
authorZac Medico <zmedico@gentoo.org>
Wed, 26 Sep 2007 04:39:03 +0000 (04:39 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 26 Sep 2007 04:39:03 +0000 (04:39 -0000)
we're sure which directory die will clean up. (trunk r7802)

svn path=/main/branches/2.1.2/; revision=7830

bin/etc-update

index 26818567600ffafe925d8f8d52d6a66ac664e862..3ca5a52b1e36d5ed0339a5cae23f5605f4c0529f 100755 (executable)
@@ -456,6 +456,7 @@ function die() {
 #
 scriptname=$(basename $0)
 
+TMP="${PORTAGE_TMPDIR}/etc-update-$$"
 trap die term
 
 type portageq > /dev/null || exit $?
@@ -469,7 +470,6 @@ export PORTAGE_TMPDIR
 #echo $CONFIG_PROTECT_MASK
 #export PORTAGE_TMPDIR=$(/usr/lib/portage/bin/portageq envvar PORTAGE_TMPDIR)
 
-TMP="${PORTAGE_TMPDIR}/etc-update-$$"
 rm -rf "${TMP}" 2> /dev/null
 mkdir "${TMP}" || die "failed to create temp dir" 1
 # make sure we have a secure directory to work in