diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-09-25 18:58:38 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-09-25 18:58:38 +0000 |
commit | 266fb9da720a3148e183d68daa9d51379e75e686 (patch) | |
tree | 2d2493e3e336f9c63761dfaa65e5537a7ce256a8 | |
parent | af4f9aa42157b8851737541c142a47b9793f2571 (diff) | |
download | portage-266fb9da720a3148e183d68daa9d51379e75e686.tar.gz portage-266fb9da720a3148e183d68daa9d51379e75e686.tar.bz2 portage-266fb9da720a3148e183d68daa9d51379e75e686.zip |
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
-rwxr-xr-x | bin/isolated-functions.sh | 12 |
1 files 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" |