missing arg will end up in calling die() before /etc/init.d/functions.sh
has been sourced.
svn path=/trunk/gentoolkit/; revision=735
+2010-31-01: Christian Ruppert <idl0r@gentoo.org>
+ * revdep-rebuild: Check for eerror in die() since an invalid option(long) or
+ missing arg will end up in calling die() before /etc/init.d/functions.sh
+ has been sourced.
+
2009-01-11: Paul Varner <fuzzyray@gentoo.org>
* revdep-rebuild: Set environment using 'portageq -v' (Bug 300229)
die() {
local status=$1
shift
- eerror "$@"
+
+ # Check if eerror has been loaded.
+ # Its loaded _after_ opt parsing but not before due to RC_NOCOLOR.
+ type eerror &> /dev/null
+
+ if [[ $? -eq 0 ]];
+ then
+ eerror "$@"
+ else
+ echo " * ${@}" >> /dev/stderr
+ fi
exit $status
}
##