diff options
author | Andrei Gherzan <andrei@gherzan.ro> | 2012-09-20 12:56:59 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-09-20 13:33:50 +0100 |
commit | 42d91a7db404bacc50541e1813c537d9c260ffb4 (patch) | |
tree | 5ffa8dd4259197731192f3e6b2d47fc93b3c2f62 /meta/classes/package_rpm.bbclass | |
parent | 82a08d42ffddc4d955706ebe2e0078134574a6ba (diff) | |
download | poky-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/package_rpm.bbclass')
-rw-r--r-- | meta/classes/package_rpm.bbclass | 6 |
1 files changed, 3 insertions, 3 deletions
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..." |