Gentoo Archives: gentoo-commits

From: "Christian Ruppert (idl0r)" <idl0r@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoolkit r735 - in trunk/gentoolkit: . bin
Date: Sun, 31 Jan 2010 11:48:07
Message-Id: E1NbYHd-00070H-PB@stork.gentoo.org
1 Author: idl0r
2 Date: 2010-01-31 11:48:05 +0000 (Sun, 31 Jan 2010)
3 New Revision: 735
4
5 Modified:
6 trunk/gentoolkit/ChangeLog
7 trunk/gentoolkit/bin/revdep-rebuild
8 Log:
9 Check for eerror in die() since an invalid option(long) or
10 missing arg will end up in calling die() before /etc/init.d/functions.sh
11 has been sourced.
12
13
14 Modified: trunk/gentoolkit/ChangeLog
15 ===================================================================
16 --- trunk/gentoolkit/ChangeLog 2010-01-11 16:36:38 UTC (rev 734)
17 +++ trunk/gentoolkit/ChangeLog 2010-01-31 11:48:05 UTC (rev 735)
18 @@ -1,3 +1,8 @@
19 +2010-31-01: Christian Ruppert <idl0r@g.o>
20 + * revdep-rebuild: Check for eerror in die() since an invalid option(long) or
21 + missing arg will end up in calling die() before /etc/init.d/functions.sh
22 + has been sourced.
23 +
24 2009-01-11: Paul Varner <fuzzyray@g.o>
25 * revdep-rebuild: Set environment using 'portageq -v' (Bug 300229)
26
27
28 Modified: trunk/gentoolkit/bin/revdep-rebuild
29 ===================================================================
30 --- trunk/gentoolkit/bin/revdep-rebuild 2010-01-11 16:36:38 UTC (rev 734)
31 +++ trunk/gentoolkit/bin/revdep-rebuild 2010-01-31 11:48:05 UTC (rev 735)
32 @@ -241,7 +241,17 @@
33 die() {
34 local status=$1
35 shift
36 - eerror "$@"
37 +
38 + # Check if eerror has been loaded.
39 + # Its loaded _after_ opt parsing but not before due to RC_NOCOLOR.
40 + type eerror &> /dev/null
41 +
42 + if [[ $? -eq 0 ]];
43 + then
44 + eerror "$@"
45 + else
46 + echo " * ${@}" >> /dev/stderr
47 + fi
48 exit $status
49 }
50 ##