summaryrefslogtreecommitdiffstats
path: root/meta/classes/buildhistory.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/buildhistory.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/buildhistory.bbclass')
-rw-r--r--meta/classes/buildhistory.bbclass6
1 files changed, 3 insertions, 3 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