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/classes/license.bbclass | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'meta/classes/license.bbclass') diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass index 29fe93843f..ffcaf93c53 100644 --- a/meta/classes/license.bbclass +++ b/meta/classes/license.bbclass @@ -112,16 +112,16 @@ license_create_manifest() { echo "PACKAGE NAME:" ${pkg} >> ${LICENSE_MANIFEST} echo "PACKAGE VERSION:" ${pkged_pv} >> ${LICENSE_MANIFEST} echo "RECIPE NAME:" ${pkged_pn} >> ${LICENSE_MANIFEST} - echo -n "LICENSE:" >> ${LICENSE_MANIFEST} + printf "LICENSE:" >> ${LICENSE_MANIFEST} for lic in ${pkged_lic}; do # to reference a license file trim trailing + symbol if [ -e "${LICENSE_DIRECTORY}/${pkged_pn}/generic_${lic%+}" ]; then - echo -n " ${lic}" >> ${LICENSE_MANIFEST} + printf " ${lic}" >> ${LICENSE_MANIFEST} else echo "WARNING: The license listed ${lic} was not in the licenses collected for ${pkged_pn}" fi done - echo -e "\n" >> ${LICENSE_MANIFEST} + printf "\n\n" >> ${LICENSE_MANIFEST} done # Two options here: -- cgit 1.2.3-korg