Replace "echo -e" with "printf" to have the same behavior in dash or bash
authorAndrei Gherzan <andrei@gherzan.ro>
Thu, 20 Sep 2012 09:56:59 +0000 (12:56 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 20 Sep 2012 12:33:50 +0000 (13:33 +0100)
commit6d434df7ed3126b852bc4a1679963914d54d1da5
tree20b612c5df2b237eee80cdcfe2508b84bb2c4295
parentd5c6565d6dea2542df9655fcb65b49f0db294f11
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>
meta/classes/buildhistory.bbclass
meta/classes/cml1.bbclass
meta/classes/license.bbclass
meta/classes/package_deb.bbclass
meta/classes/package_ipk.bbclass
meta/classes/package_rpm.bbclass
meta/classes/populate_sdk_base.bbclass
meta/recipes-core/base-files/base-files_3.0.14.bb
meta/recipes-extended/libzypp/libzypp_git.bb
meta/recipes-extended/lsb/lsb_4.1.bb
scripts/contrib/ddimage