summaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--meta/classes/buildhistory.bbclass6
-rw-r--r--meta/classes/cml1.bbclass2
-rw-r--r--meta/classes/license.bbclass6
-rw-r--r--meta/classes/package_deb.bbclass2
-rw-r--r--meta/classes/package_ipk.bbclass2
-rw-r--r--meta/classes/package_rpm.bbclass6
-rw-r--r--meta/classes/populate_sdk_base.bbclass8
-rw-r--r--meta/recipes-core/base-files/base-files_3.0.14.bb8
-rw-r--r--meta/recipes-extended/libzypp/libzypp_git.bb4
-rw-r--r--meta/recipes-extended/lsb/lsb_4.1.bb6
-rwxr-xr-xscripts/contrib/ddimage2
11 files changed, 26 insertions, 26 deletions
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index e121088d59..49f2ea5b7c 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -293,13 +293,13 @@ buildhistory_get_image_installed() {
293 # Change delimiter from pipe to -> and set style for recommend lines 293 # Change delimiter from pipe to -> and set style for recommend lines
294 sed -i -e 's:|: -> :' -e 's:\[REC\]:[style=dotted]:' -e 's:$:;:' ${BUILDHISTORY_DIR_IMAGE}/depends.tmp 294 sed -i -e 's:|: -> :' -e 's:\[REC\]:[style=dotted]:' -e 's:$:;:' ${BUILDHISTORY_DIR_IMAGE}/depends.tmp
295 # Add header, sorted and de-duped contents and footer and then delete the temp file 295 # Add header, sorted and de-duped contents and footer and then delete the temp file
296 echo -e "digraph depends {\n node [shape=plaintext]" > ${BUILDHISTORY_DIR_IMAGE}/depends.dot 296 printf "digraph depends {\n node [shape=plaintext]\n" > ${BUILDHISTORY_DIR_IMAGE}/depends.dot
297 cat ${BUILDHISTORY_DIR_IMAGE}/depends.tmp | sort | uniq >> ${BUILDHISTORY_DIR_IMAGE}/depends.dot 297 cat ${BUILDHISTORY_DIR_IMAGE}/depends.tmp | sort | uniq >> ${BUILDHISTORY_DIR_IMAGE}/depends.dot
298 echo "}" >> ${BUILDHISTORY_DIR_IMAGE}/depends.dot 298 echo "}" >> ${BUILDHISTORY_DIR_IMAGE}/depends.dot
299 rm ${BUILDHISTORY_DIR_IMAGE}/depends.tmp 299 rm ${BUILDHISTORY_DIR_IMAGE}/depends.tmp
300 300
301 # Produce installed package sizes list 301 # Produce installed package sizes list
302 echo -n > ${BUILDHISTORY_DIR_IMAGE}/installed-package-sizes.tmp 302 printf "" > ${BUILDHISTORY_DIR_IMAGE}/installed-package-sizes.tmp
303 cat $pkgcache | while read pkg pkgfile 303 cat $pkgcache | while read pkg pkgfile
304 do 304 do
305 if [ -f $pkgfile ] ; then 305 if [ -f $pkgfile ] ; then
@@ -330,7 +330,7 @@ buildhistory_get_imageinfo() {
330 ( cd ${IMAGE_ROOTFS} && find . -ls | awk '{ if ( $7 ~ /[0-9]/ ) printf "%s %10-s %10-s %10s %s %s %s\n", $3, $5, $6, $7, $11, $12, $13 ; else printf "%s %10-s %10-s %10s %s %s %s\n", $3, $5, $6, 0, $10, $11, $12 }' | sort -k5 > ${BUILDHISTORY_DIR_IMAGE}/files-in-image.txt ) 330 ( cd ${IMAGE_ROOTFS} && find . -ls | awk '{ if ( $7 ~ /[0-9]/ ) printf "%s %10-s %10-s %10s %s %s %s\n", $3, $5, $6, $7, $11, $12, $13 ; else printf "%s %10-s %10-s %10s %s %s %s\n", $3, $5, $6, 0, $10, $11, $12 }' | sort -k5 > ${BUILDHISTORY_DIR_IMAGE}/files-in-image.txt )
331 331
332 # Record some machine-readable meta-information about the image 332 # Record some machine-readable meta-information about the image
333 echo -n > ${BUILDHISTORY_DIR_IMAGE}/image-info.txt 333 printf "" > ${BUILDHISTORY_DIR_IMAGE}/image-info.txt
334 cat >> ${BUILDHISTORY_DIR_IMAGE}/image-info.txt <<END 334 cat >> ${BUILDHISTORY_DIR_IMAGE}/image-info.txt <<END
335${@buildhistory_get_imagevars(d)} 335${@buildhistory_get_imagevars(d)}
336END 336END
diff --git a/meta/classes/cml1.bbclass b/meta/classes/cml1.bbclass
index 67f17ad77e..37ed792b7c 100644
--- a/meta/classes/cml1.bbclass
+++ b/meta/classes/cml1.bbclass
@@ -20,7 +20,7 @@ python do_menuconfig() {
20 except OSError: 20 except OSError:
21 mtime = 0 21 mtime = 0
22 22
23 oe_terminal("${SHELL} -c \"make menuconfig; if [ $? -ne 0 ]; then echo 'Command failed.'; echo -n 'Press any key to continue... '; read r; fi\"", '${PN} Configuration', d) 23 oe_terminal("${SHELL} -c \"make menuconfig; if [ $? -ne 0 ]; then echo 'Command failed.'; printf 'Press any key to continue... '; read r; fi\"", '${PN} Configuration', d)
24 24
25 # FIXME this check can be removed when the minimum bitbake version has been bumped 25 # FIXME this check can be removed when the minimum bitbake version has been bumped
26 if hasattr(bb.build, 'write_taint'): 26 if hasattr(bb.build, 'write_taint'):
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:
diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass
index 48511dfe90..3b42d3b194 100644
--- a/meta/classes/package_deb.bbclass
+++ b/meta/classes/package_deb.bbclass
@@ -192,7 +192,7 @@ deb_log_check() {
192 if (echo "$lf_txt" | grep -v log_check | grep "$keyword_die") >/dev/null 2>&1 192 if (echo "$lf_txt" | grep -v log_check | grep "$keyword_die") >/dev/null 2>&1
193 then 193 then
194 echo "log_check: There were error messages in the logfile" 194 echo "log_check: There were error messages in the logfile"
195 echo -e "log_check: Matched keyword: [$keyword_die]\n" 195 printf "log_check: Matched keyword: [$keyword_die]\n\n"
196 echo "$lf_txt" | grep -v log_check | grep -C 5 -i "$keyword_die" 196 echo "$lf_txt" | grep -v log_check | grep -C 5 -i "$keyword_die"
197 echo "" 197 echo ""
198 do_exit=1 198 do_exit=1
diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index e94586e6ca..efe299eec8 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -181,7 +181,7 @@ ipk_log_check() {
181 if (echo "$lf_txt" | grep -v log_check | grep "$keyword_die") >/dev/null 2>&1 181 if (echo "$lf_txt" | grep -v log_check | grep "$keyword_die") >/dev/null 2>&1
182 then 182 then
183 echo "log_check: There were error messages in the logfile" 183 echo "log_check: There were error messages in the logfile"
184 echo -e "log_check: Matched keyword: [$keyword_die]\n" 184 printf "log_check: Matched keyword: [$keyword_die]\n\n"
185 echo "$lf_txt" | grep -v log_check | grep -C 5 -i "$keyword_die" 185 echo "$lf_txt" | grep -v log_check | grep -C 5 -i "$keyword_die"
186 echo "" 186 echo ""
187 do_exit=1 187 do_exit=1
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 61f0117216..64689d8d72 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -110,7 +110,7 @@ rpm_log_check() {
110 if (echo "$lf_txt" | grep -v log_check | grep "$keyword_die") >/dev/null 2>&1 110 if (echo "$lf_txt" | grep -v log_check | grep "$keyword_die") >/dev/null 2>&1
111 then 111 then
112 echo "log_check: There were error messages in the logfile" 112 echo "log_check: There were error messages in the logfile"
113 echo -e "log_check: Matched keyword: [$keyword_die]\n" 113 printf "log_check: Matched keyword: [$keyword_die]\n\n"
114 echo "$lf_txt" | grep -v log_check | grep -C 5 -i "$keyword_die" 114 echo "$lf_txt" | grep -v log_check | grep -C 5 -i "$keyword_die"
115 echo "" 115 echo ""
116 do_exit=1 116 do_exit=1
@@ -211,8 +211,8 @@ process_pkg_list_rpm() {
211 pkgs="$@" 211 pkgs="$@"
212 local confbase=${INSTALL_CONFBASE_RPM} 212 local confbase=${INSTALL_CONFBASE_RPM}
213 213
214 echo -n > ${target_rootfs}/install/base_archs.pkglist 214 printf "" > ${target_rootfs}/install/base_archs.pkglist
215 echo -n > ${target_rootfs}/install/ml_archs.pkglist 215 printf "" > ${target_rootfs}/install/ml_archs.pkglist
216 216
217 for pkg in $pkgs; do 217 for pkg in $pkgs; do
218 echo "Processing $pkg..." 218 echo "Processing $pkg..."
diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass
index 1c151d7186..2bff41f9e6 100644
--- a/meta/classes/populate_sdk_base.bbclass
+++ b/meta/classes/populate_sdk_base.bbclass
@@ -118,7 +118,7 @@ fakeroot create_shar() {
118 118
119DEFAULT_INSTALL_DIR="${SDKPATH}" 119DEFAULT_INSTALL_DIR="${SDKPATH}"
120 120
121echo -n "Enter target directory for Poky SDK (default: $DEFAULT_INSTALL_DIR): " 121printf "Enter target directory for Poky SDK (default: $DEFAULT_INSTALL_DIR): "
122read target_sdk_dir 122read target_sdk_dir
123 123
124if [ "$target_sdk_dir" = "" ]; then 124if [ "$target_sdk_dir" = "" ]; then
@@ -128,7 +128,7 @@ fi
128eval target_sdk_dir=$target_sdk_dir 128eval target_sdk_dir=$target_sdk_dir
129target_sdk_dir=$(readlink -m $target_sdk_dir) 129target_sdk_dir=$(readlink -m $target_sdk_dir)
130 130
131echo -n "You are about to install Poky SDK to \"$target_sdk_dir\". Proceed[Y/n]?" 131printf "You are about to install Poky SDK to \"$target_sdk_dir\". Proceed[Y/n]?"
132read answer 132read answer
133 133
134if [ "$answer" = "" ]; then 134if [ "$answer" = "" ]; then
@@ -148,11 +148,11 @@ fi
148 148
149payload_offset=$(($(grep -na -m1 "^MARKER:$" $(basename $0)|cut -d':' -f1) + 1)) 149payload_offset=$(($(grep -na -m1 "^MARKER:$" $(basename $0)|cut -d':' -f1) + 1))
150 150
151echo -n "Extracting SDK..." 151printf "Extracting SDK..."
152tail -n +$payload_offset $(basename $0) | tar xj --strip-components=4 -C $target_sdk_dir 152tail -n +$payload_offset $(basename $0) | tar xj --strip-components=4 -C $target_sdk_dir
153echo "done" 153echo "done"
154 154
155echo -n "Setting it up..." 155printf "Setting it up..."
156# fix environment paths 156# fix environment paths
157env_setup_script=$(find $target_sdk_dir -name "environment-setup-${REAL_MULTIMACH_TARGET_SYS}") 157env_setup_script=$(find $target_sdk_dir -name "environment-setup-${REAL_MULTIMACH_TARGET_SYS}")
158sed -e "s:$DEFAULT_INSTALL_DIR:$target_sdk_dir:g" -i $env_setup_script 158sed -e "s:$DEFAULT_INSTALL_DIR:$target_sdk_dir:g" -i $env_setup_script
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 () {
117 117
118 install -m 644 ${WORKDIR}/issue* ${D}${sysconfdir} 118 install -m 644 ${WORKDIR}/issue* ${D}${sysconfdir}
119 if [ -n "${DISTRO_NAME}" ]; then 119 if [ -n "${DISTRO_NAME}" ]; then
120 echo -n "${DISTRO_NAME} " >> ${D}${sysconfdir}/issue 120 printf "${DISTRO_NAME} " >> ${D}${sysconfdir}/issue
121 echo -n "${DISTRO_NAME} " >> ${D}${sysconfdir}/issue.net 121 printf "${DISTRO_NAME} " >> ${D}${sysconfdir}/issue.net
122 if [ -n "${DISTRO_VERSION}" ]; then 122 if [ -n "${DISTRO_VERSION}" ]; then
123 echo -n "${DISTRO_VERSION} " >> ${D}${sysconfdir}/issue 123 printf "${DISTRO_VERSION} " >> ${D}${sysconfdir}/issue
124 echo -n "${DISTRO_VERSION} " >> ${D}${sysconfdir}/issue.net 124 printf "${DISTRO_VERSION} " >> ${D}${sysconfdir}/issue.net
125 fi 125 fi
126 echo "\n \l" >> ${D}${sysconfdir}/issue 126 echo "\n \l" >> ${D}${sysconfdir}/issue
127 echo >> ${D}${sysconfdir}/issue 127 echo >> ${D}${sysconfdir}/issue
diff --git a/meta/recipes-extended/libzypp/libzypp_git.bb b/meta/recipes-extended/libzypp/libzypp_git.bb
index 3a323e7e15..1729c78a20 100644
--- a/meta/recipes-extended/libzypp/libzypp_git.bb
+++ b/meta/recipes-extended/libzypp/libzypp_git.bb
@@ -106,10 +106,10 @@ do_archgen () {
106 continue;; 106 continue;;
107 esac 107 esac
108 if [ "${AVOID_CONSTRUCTOR}" != "true" ]; then 108 if [ "${AVOID_CONSTRUCTOR}" != "true" ]; then
109 echo -n " const Arch Arch_${each_arch} " | tr - _ >> zypp/oe-arch.h 109 printf " const Arch Arch_${each_arch} " | tr - _ >> zypp/oe-arch.h
110 echo "(_${each_arch});" | tr - _ >> zypp/oe-arch.h 110 echo "(_${each_arch});" | tr - _ >> zypp/oe-arch.h
111 else 111 else
112 echo -n " const Arch Arch_${each_arch} " | tr - _ >> zypp/oe-arch.h 112 printf " const Arch Arch_${each_arch} " | tr - _ >> zypp/oe-arch.h
113 echo "( IdString ( \"${each_arch}\" ) );" | tr - _ >> zypp/oe-arch.h 113 echo "( IdString ( \"${each_arch}\" ) );" | tr - _ >> zypp/oe-arch.h
114 fi 114 fi
115 done 115 done
diff --git a/meta/recipes-extended/lsb/lsb_4.1.bb b/meta/recipes-extended/lsb/lsb_4.1.bb
index a3242db708..55ea241783 100644
--- a/meta/recipes-extended/lsb/lsb_4.1.bb
+++ b/meta/recipes-extended/lsb/lsb_4.1.bb
@@ -31,12 +31,12 @@ do_install(){
31 mkdir -p ${D}${base_bindir} 31 mkdir -p ${D}${base_bindir}
32 mkdir -p ${D}/${baselib} 32 mkdir -p ${D}/${baselib}
33 mkdir -p ${D}${sysconfdir}/lsb-release.d 33 mkdir -p ${D}${sysconfdir}/lsb-release.d
34 echo -n "LSB_VERSION=\"core-4.1-noarch:" > ${D}${sysconfdir}/lsb-release 34 printf "LSB_VERSION=\"core-4.1-noarch:" > ${D}${sysconfdir}/lsb-release
35 35
36 if [ "${TARGET_ARCH}" = "i586" ];then 36 if [ "${TARGET_ARCH}" = "i586" ];then
37 echo -n "core-4.1-ia32" >> ${D}${sysconfdir}/lsb-release 37 printf "core-4.1-ia32" >> ${D}${sysconfdir}/lsb-release
38 else 38 else
39 echo -n "core-4.1-${TARGET_ARCH}" >> ${D}${sysconfdir}/lsb-release 39 printf "core-4.1-${TARGET_ARCH}" >> ${D}${sysconfdir}/lsb-release
40 fi 40 fi
41 echo "\"" >> ${D}${sysconfdir}/lsb-release 41 echo "\"" >> ${D}${sysconfdir}/lsb-release
42 echo "DISTRIB_ID=${DISTRO}" >> ${D}${sysconfdir}/lsb-release 42 echo "DISTRIB_ID=${DISTRO}" >> ${D}${sysconfdir}/lsb-release
diff --git a/scripts/contrib/ddimage b/scripts/contrib/ddimage
index 2cba9b28f1..956699c05d 100755
--- a/scripts/contrib/ddimage
+++ b/scripts/contrib/ddimage
@@ -75,7 +75,7 @@ fi
75image_details $IMAGE 75image_details $IMAGE
76device_details $(basename $DEVICE) 76device_details $(basename $DEVICE)
77 77
78echo -n "Write $IMAGE to $DEVICE [y/N]? " 78printf "Write $IMAGE to $DEVICE [y/N]? "
79read RESPONSE 79read RESPONSE
80if [ "$RESPONSE" != "y" ]; then 80if [ "$RESPONSE" != "y" ]; then
81 echo "Write aborted" 81 echo "Write aborted"