From: Zac Medico Date: Sun, 27 Jul 2008 13:59:29 +0000 (-0000) Subject: Make all the elog functions split lines when displaying output, just like X-Git-Tag: v2.2_rc4~15 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d63d37d512ecba2a61475ea4a6c4e4807524ef7f;p=portage.git Make all the elog functions split lines when displaying output, just like elog_base() does when saving it. svn path=/main/trunk/; revision=11219 --- diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh index 4de6f8503..e0d8fb08a 100755 --- a/bin/isolated-functions.sh +++ b/bin/isolated-functions.sh @@ -183,7 +183,13 @@ elog_base() { eqawarn() { elog_base QA "$*" [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo - vecho -e " ${WARN}*${NORMAL} $*" >&2 + save_IFS + IFS=$'\n' + local line + for line in $* ; do + vecho -e " ${WARN}*${NORMAL} ${line}" >&2 + done + restore_IFS LAST_E_CMD="eqawarn" return 0 } @@ -191,7 +197,13 @@ eqawarn() { elog() { elog_base LOG "$*" [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo - echo -e " ${GOOD}*${NORMAL} $*" + save_IFS + IFS=$'\n' + local line + for line in $* ; do + echo -e " ${GOOD}*${NORMAL} ${line}" + done + restore_IFS LAST_E_CMD="elog" return 0 } @@ -217,7 +229,13 @@ esyslog() { einfo() { elog_base INFO "$*" [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo - echo -e " ${GOOD}*${NORMAL} $*" + save_IFS + IFS=$'\n' + local line + for line in $* ; do + echo -e " ${GOOD}*${NORMAL} ${line}" + done + restore_IFS LAST_E_CMD="einfo" return 0 } @@ -233,7 +251,13 @@ einfon() { ewarn() { elog_base WARN "$*" [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo - echo -e " ${WARN}*${NORMAL} ${RC_INDENTATION}$*" >&2 + save_IFS + IFS=$'\n' + local line + for line in $* ; do + echo -e " ${WARN}*${NORMAL} ${RC_INDENTATION}${line}" >&2 + done + restore_IFS LAST_E_CMD="ewarn" return 0 } @@ -241,7 +265,13 @@ ewarn() { eerror() { elog_base ERROR "$*" [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo - echo -e " ${BAD}*${NORMAL} ${RC_INDENTATION}$*" >&2 + save_IFS + IFS=$'\n' + local line + for line in $* ; do + echo -e " ${BAD}*${NORMAL} ${RC_INDENTATION}${line}" >&2 + done + restore_IFS LAST_E_CMD="eerror" return 0 }