summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-06-17 03:31:43 +0000
committerZac Medico <zmedico@gentoo.org>2008-06-17 03:31:43 +0000
commit466ea463005845f1fcc3760407ad2a4d9f75393b (patch)
treee21a77a1795fa65272488b2de67b44ed851c46dc /bin/isolated-functions.sh
parentFix typo. (diff)
downloadportage-multirepo-466ea463005845f1fcc3760407ad2a4d9f75393b.tar.gz
portage-multirepo-466ea463005845f1fcc3760407ad2a4d9f75393b.tar.bz2
portage-multirepo-466ea463005845f1fcc3760407ad2a4d9f75393b.zip
Add support for an new "eblank" elog function that shows a blank line.
Consecutive eblank calls are all collapsed into a single blank line. Thanks to Joe Peterson <lavajoe@g.o> for this patch. svn path=/main/trunk/; revision=10675
Diffstat (limited to 'bin/isolated-functions.sh')
-rwxr-xr-xbin/isolated-functions.sh18
1 files changed, 17 insertions, 1 deletions
diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 42f3d5ac..dd157129 100755
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -161,7 +161,7 @@ elog_base() {
local messagetype
[ -z "${1}" -o -z "${T}" -o ! -d "${T}/logging" ] && return 1
case "${1}" in
- INFO|WARN|ERROR|LOG|QA)
+ BLANK|INFO|WARN|ERROR|LOG|QA)
messagetype="${1}"
shift
;;
@@ -174,15 +174,28 @@ elog_base() {
return 0
}
+eblank() {
+ [[ ${LAST_E_CMD} == "eblank" ]] && return 0
+ elog_base BLANK
+ [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo
+ echo -e " ${NEUTRAL}*${NORMAL}"
+ LAST_E_CMD="eblank"
+ return 0
+}
+
eqawarn() {
elog_base QA "$*"
+ [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo
vecho -e " ${WARN}*${NORMAL} $*" >&2
+ LAST_E_CMD="eqawarn"
return 0
}
elog() {
elog_base LOG "$*"
+ [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo
echo -e " ${GOOD}*${NORMAL} $*"
+ LAST_E_CMD="elog"
return 0
}
@@ -281,6 +294,7 @@ eend() {
_eend ${retval} eerror "$*"
+ LAST_E_CMD="eend"
return ${retval}
}
@@ -339,6 +353,7 @@ unset_colors() {
COLS="25 80"
ENDCOL=
+ NEUTRAL=
GOOD=
WARN=
BAD=
@@ -361,6 +376,7 @@ set_colors() {
if [ -n "${PORTAGE_COLORMAP}" ] ; then
eval ${PORTAGE_COLORMAP}
else
+ NEUTRAL=$'\e[37m'
GOOD=$'\e[32;01m'
WARN=$'\e[33;01m'
BAD=$'\e[31;01m'