summaryrefslogtreecommitdiffstats
path: root/meta/classes/license.bbclass
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/classes/license.bbclass
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/classes/license.bbclass')
-rw-r--r--meta/classes/license.bbclass6
1 files changed, 3 insertions, 3 deletions
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() {
112 echo "PACKAGE NAME:" ${pkg} >> ${LICENSE_MANIFEST} 112 echo "PACKAGE NAME:" ${pkg} >> ${LICENSE_MANIFEST}
113 echo "PACKAGE VERSION:" ${pkged_pv} >> ${LICENSE_MANIFEST} 113 echo "PACKAGE VERSION:" ${pkged_pv} >> ${LICENSE_MANIFEST}
114 echo "RECIPE NAME:" ${pkged_pn} >> ${LICENSE_MANIFEST} 114 echo "RECIPE NAME:" ${pkged_pn} >> ${LICENSE_MANIFEST}
115 echo -n "LICENSE:" >> ${LICENSE_MANIFEST} 115 printf "LICENSE:" >> ${LICENSE_MANIFEST}
116 for lic in ${pkged_lic}; do 116 for lic in ${pkged_lic}; do
117 # to reference a license file trim trailing + symbol 117 # to reference a license file trim trailing + symbol
118 if [ -e "${LICENSE_DIRECTORY}/${pkged_pn}/generic_${lic%+}" ]; then 118 if [ -e "${LICENSE_DIRECTORY}/${pkged_pn}/generic_${lic%+}" ]; then
119 echo -n " ${lic}" >> ${LICENSE_MANIFEST} 119 printf " ${lic}" >> ${LICENSE_MANIFEST}
120 else 120 else
121 echo "WARNING: The license listed ${lic} was not in the licenses collected for ${pkged_pn}" 121 echo "WARNING: The license listed ${lic} was not in the licenses collected for ${pkged_pn}"
122 fi 122 fi
123 done 123 done
124 echo -e "\n" >> ${LICENSE_MANIFEST} 124 printf "\n\n" >> ${LICENSE_MANIFEST}
125 done 125 done
126 126
127 # Two options here: 127 # Two options here: