From a19880ad10ccb5d7d909dcf9de5c3dc58a0ebcd3 Mon Sep 17 00:00:00 2001 From: Andrei Gherzan Date: Thu, 20 Sep 2012 12:56:59 +0300 Subject: 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] Signed-off-by: Andrei Gherzan Signed-off-by: Richard Purdie --- meta/recipes-core/base-files/base-files_3.0.14.bb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'meta/recipes-core/base-files') 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 () { install -m 644 ${WORKDIR}/issue* ${D}${sysconfdir} if [ -n "${DISTRO_NAME}" ]; then - echo -n "${DISTRO_NAME} " >> ${D}${sysconfdir}/issue - echo -n "${DISTRO_NAME} " >> ${D}${sysconfdir}/issue.net + printf "${DISTRO_NAME} " >> ${D}${sysconfdir}/issue + printf "${DISTRO_NAME} " >> ${D}${sysconfdir}/issue.net if [ -n "${DISTRO_VERSION}" ]; then - echo -n "${DISTRO_VERSION} " >> ${D}${sysconfdir}/issue - echo -n "${DISTRO_VERSION} " >> ${D}${sysconfdir}/issue.net + printf "${DISTRO_VERSION} " >> ${D}${sysconfdir}/issue + printf "${DISTRO_VERSION} " >> ${D}${sysconfdir}/issue.net fi echo "\n \l" >> ${D}${sysconfdir}/issue echo >> ${D}${sysconfdir}/issue -- cgit 1.2.3-korg