[oe-commits] Andrei Gherzan : Replace "echo -e" with "printf" to have the same behavior in dash or bash

git at git.openembedded.org git at git.openembedded.org
Thu Sep 20 12:41:07 UTC 2012


Module: openembedded-core.git
Branch: master
Commit: a19880ad10ccb5d7d909dcf9de5c3dc58a0ebcd3
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=a19880ad10ccb5d7d909dcf9de5c3dc58a0ebcd3

Author: Andrei Gherzan <andrei at gherzan.ro>
Date:   Thu Sep 20 12:56:59 2012 +0300

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 <andrei at gherzan.ro>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/classes/buildhistory.bbclass                 |    6 +++---
 meta/classes/cml1.bbclass                         |    2 +-
 meta/classes/license.bbclass                      |    6 +++---
 meta/classes/package_deb.bbclass                  |    2 +-
 meta/classes/package_ipk.bbclass                  |    2 +-
 meta/classes/package_rpm.bbclass                  |    6 +++---
 meta/classes/populate_sdk_base.bbclass            |    8 ++++----
 meta/recipes-core/base-files/base-files_3.0.14.bb |    8 ++++----
 meta/recipes-extended/libzypp/libzypp_git.bb      |    4 ++--
 meta/recipes-extended/lsb/lsb_4.1.bb              |    6 +++---
 scripts/contrib/ddimage                           |    2 +-
 11 files changed, 26 insertions(+), 26 deletions(-)

Diff:   http://git.openembedded.org/?p=openembedded-core.git/?a=commitdiff;h=a19880ad10ccb5d7d909dcf9de5c3dc58a0ebcd3




More information about the Openembedded-commits mailing list