From 266fb9da720a3148e183d68daa9d51379e75e686 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 25 Sep 2008 18:58:38 +0000 Subject: [PATCH] Use echo -e when splitting lines in e* functions, for compatibility with previous behavior wrt \e escape codes such as `elog "\e[31m***\e[0m"` for example. Thanks to Arfrever for finding this solution. svn path=/main/trunk/; revision=11545 --- bin/isolated-functions.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh index b39155eec..74692c8a7 100755 --- a/bin/isolated-functions.sh +++ b/bin/isolated-functions.sh @@ -174,7 +174,7 @@ elog_base() { # not entirely safe to use it as a delimiter in the log file since # there can still be escaped newlines that will be expanded due to # the echo -e parameter. - echo "$@" | while read line ; do + echo -e "$@" | while read line ; do echo -ne "${messagetype} ${line}\n\0" >> \ "${T}/logging/${EBUILD_PHASE:-other}" done @@ -184,7 +184,7 @@ elog_base() { eqawarn() { elog_base QA "$*" [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo - echo "$@" | while read line ; do + echo -e "$@" | while read line ; do vecho -e " ${WARN}*${NORMAL} ${line}" >&2 done LAST_E_CMD="eqawarn" @@ -194,7 +194,7 @@ eqawarn() { elog() { elog_base LOG "$*" [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo - echo "$@" | while read line ; do + echo -e "$@" | while read line ; do echo -e " ${GOOD}*${NORMAL} ${line}" done LAST_E_CMD="elog" @@ -222,7 +222,7 @@ esyslog() { einfo() { elog_base INFO "$*" [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo - echo "$@" | while read line ; do + echo -e "$@" | while read line ; do echo -e " ${GOOD}*${NORMAL} ${line}" done LAST_E_CMD="einfo" @@ -240,7 +240,7 @@ einfon() { ewarn() { elog_base WARN "$*" [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo - echo "$@" | while read line ; do + echo -e "$@" | while read line ; do echo -e " ${WARN}*${NORMAL} ${RC_INDENTATION}${line}" >&2 done LAST_E_CMD="ewarn" @@ -250,7 +250,7 @@ ewarn() { eerror() { elog_base ERROR "$*" [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo - echo "$@" | while read line ; do + echo -e "$@" | while read line ; do echo -e " ${BAD}*${NORMAL} ${RC_INDENTATION}${line}" >&2 done LAST_E_CMD="eerror" -- 2.26.2