From 9aefbb6cced5e071a628dd46f6fffc3afdf84305 Mon Sep 17 00:00:00 2001 From: idl0r Date: Sun, 31 Jan 2010 11:48:05 +0000 Subject: 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. svn path=/trunk/gentoolkit/; revision=735 --- bin/revdep-rebuild | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/revdep-rebuild b/bin/revdep-rebuild index ce9e61c..6726c7e 100755 --- a/bin/revdep-rebuild +++ b/bin/revdep-rebuild @@ -241,7 +241,17 @@ clean_var() { 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 } ## -- cgit v1.2.3