summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core
diff options
context:
space:
mode:
authorAndrei Gherzan <andrei@gherzan.ro>2012-09-20 12:56:59 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-09-20 13:33:50 +0100
commit42d91a7db404bacc50541e1813c537d9c260ffb4 (patch)
tree5ffa8dd4259197731192f3e6b2d47fc93b3c2f62 /meta/recipes-core
parent82a08d42ffddc4d955706ebe2e0078134574a6ba (diff)
downloadpoky-42d91a7db404bacc50541e1813c537d9c260ffb4.tar.gz
Replace "echo -e" with "printf" to have the same behavior in dash or bash
oe-core removed the prerequisite to have sh as bash. POSIX doesn't define any options and furthermore allows 'echo -e' to be the default behavior. This means that in dash 'echo -e' will actually print '-e' and interpret backslashes by default. We use instead 'printf' builtin command with or without '\n' to simulate 'echo -e' or 'echo -n'. 'printf' needs format while 'echo' can be used without any arguments. So 'echo >' was replaced by 'printf "" >'. 'echo' without '-n' flag adds a new line by default so to keep the same behavior of two new lines while using 'echo "\n"', 'printf "\n\n"' is used. [YOCTO #3138] (From OE-Core rev: a19880ad10ccb5d7d909dcf9de5c3dc58a0ebcd3) Signed-off-by: Andrei Gherzan <andrei@gherzan.ro> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core')
-rw-r--r--meta/recipes-core/base-files/base-files_3.0.14.bb8
1 files changed, 4 insertions, 4 deletions
diff --git a/meta/recipes-core/base-files/base-files_3.0.14.bb b/meta/recipes-core/base-files/base-files_3.0.14.bb
index e80cff1790..ba355ee07c 100644
--- a/meta/recipes-core/base-files/base-files_3.0.14.bb
+++ b/meta/recipes-core/base-files/base-files_3.0.14.bb
@@ -117,11 +117,11 @@ do_install_basefilesissue () {
117 117
118 install -m 644 ${WORKDIR}/issue* ${D}${sysconfdir} 118 install -m 644 ${WORKDIR}/issue* ${D}${sysconfdir}
119 if [ -n "${DISTRO_NAME}" ]; then 119 if [ -n "${DISTRO_NAME}" ]; then
120 echo -n "${DISTRO_NAME} " >> ${D}${sysconfdir}/issue 120 printf "${DISTRO_NAME} " >> ${D}${sysconfdir}/issue
121 echo -n "${DISTRO_NAME} " >> ${D}${sysconfdir}/issue.net 121 printf "${DISTRO_NAME} " >> ${D}${sysconfdir}/issue.net
122 if [ -n "${DISTRO_VERSION}" ]; then 122 if [ -n "${DISTRO_VERSION}" ]; then
123 echo -n "${DISTRO_VERSION} " >> ${D}${sysconfdir}/issue 123 printf "${DISTRO_VERSION} " >> ${D}${sysconfdir}/issue
124 echo -n "${DISTRO_VERSION} " >> ${D}${sysconfdir}/issue.net 124 printf "${DISTRO_VERSION} " >> ${D}${sysconfdir}/issue.net
125 fi 125 fi
126 echo "\n \l" >> ${D}${sysconfdir}/issue 126 echo "\n \l" >> ${D}${sysconfdir}/issue
127 echo >> ${D}${sysconfdir}/issue 127 echo >> ${D}${sysconfdir}/issue