Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r12056 - main/branches/2.1.6/bin
Date: Sun, 23 Nov 2008 21:09:55
Message-Id: E1L4MDI-0002Et-Fu@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-11-23 21:09:52 +0000 (Sun, 23 Nov 2008)
3 New Revision: 12056
4
5 Modified:
6 main/branches/2.1.6/bin/etc-update
7 Log:
8 Fix SIGINT and SIGTERM trap handling so the temp dir always cleaned up when
9 killed. (trunk r12055)
10
11
12 Modified: main/branches/2.1.6/bin/etc-update
13 ===================================================================
14 --- main/branches/2.1.6/bin/etc-update 2008-11-23 21:02:45 UTC (rev 12055)
15 +++ main/branches/2.1.6/bin/etc-update 2008-11-23 21:09:52 UTC (rev 12056)
16 @@ -446,10 +446,9 @@
17 }
18
19 die() {
20 - trap "" TERM
21 - trap "" KILL
22 + trap SIGTERM SIGINT
23
24 - if [ ${2} -eq 0 ]; then
25 + if [ "$2" -eq 0 ]; then
26 echo "Exiting: ${1}"
27 scan > /dev/null
28 [ ${count} -gt 0 ] && echo "NOTE: ${count} updates remaining"
29 @@ -500,7 +499,8 @@
30 export PORTAGE_TMPDIR
31
32 TMP="${PORTAGE_TMPDIR}/etc-update-$$"
33 -trap die term
34 +trap "die terminated 1" SIGTERM
35 +trap "die interrupted 1" SIGINT
36
37 [ -w ${PORTAGE_CONFIGROOT}etc ] || die "Need write access to ${PORTAGE_CONFIGROOT}etc" 1
38 #echo $PORTAGE_TMPDIR