Make elog functions use read -r when splitting lines, so that backslashes
authorZac Medico <zmedico@gentoo.org>
Fri, 1 May 2009 21:43:50 +0000 (21:43 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 1 May 2009 21:43:50 +0000 (21:43 -0000)
intended for display will not be eaten. (trunk r13582)

svn path=/main/branches/2.1.6/; revision=13583

bin/isolated-functions.sh

index 0d046cbda86a43452a014b6aa1569eca2bc8f38b..8a7f899b9535d76d447f35db378fd17dd232d36b 100755 (executable)
@@ -182,7 +182,7 @@ elog_base() {
                        return 1
                        ;;
        esac
-       echo -e "$@" | while read ; do
+       echo -e "$@" | while read -r ; do
                echo "$messagetype $REPLY" >> \
                        "${T}/logging/${EBUILD_PHASE:-other}"
        done
@@ -192,8 +192,8 @@ elog_base() {
 eqawarn() {
        elog_base QA "$*"
        [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo
-       echo -e "$@" | while read ; do
-               vecho -e " $WARN*$NORMAL $REPLY" >&2
+       echo -e "$@" | while read -r ; do
+               vecho " $WARN*$NORMAL $REPLY" >&2
        done
        LAST_E_CMD="eqawarn"
        return 0
@@ -202,8 +202,8 @@ eqawarn() {
 elog() {
        elog_base LOG "$*"
        [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo
-       echo -e "$@" | while read ; do
-               echo -e " $GOOD*$NORMAL $REPLY"
+       echo -e "$@" | while read -r ; do
+               echo " $GOOD*$NORMAL $REPLY"
        done
        LAST_E_CMD="elog"
        return 0
@@ -230,8 +230,8 @@ esyslog() {
 einfo() {
        elog_base INFO "$*"
        [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo
-       echo -e "$@" | while read ; do
-               echo -e " $GOOD*$NORMAL $REPLY"
+       echo -e "$@" | while read -r ; do
+               echo " $GOOD*$NORMAL $REPLY"
        done
        LAST_E_CMD="einfo"
        return 0
@@ -248,8 +248,8 @@ einfon() {
 ewarn() {
        elog_base WARN "$*"
        [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo
-       echo -e "$@" | while read ; do
-               echo -e " $WARN*$NORMAL $RC_INDENTATION$REPLY" >&2
+       echo -e "$@" | while read -r ; do
+               echo " $WARN*$NORMAL $RC_INDENTATION$REPLY" >&2
        done
        LAST_E_CMD="ewarn"
        return 0
@@ -258,8 +258,8 @@ ewarn() {
 eerror() {
        elog_base ERROR "$*"
        [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo
-       echo -e "$@" | while read ; do
-               echo -e " $BAD*$NORMAL $RC_INDENTATION$REPLY" >&2
+       echo -e "$@" | while read -r ; do
+               echo " $BAD*$NORMAL $RC_INDENTATION$REPLY" >&2
        done
        LAST_E_CMD="eerror"
        return 0