]> code.ossystems Code Review - openembedded-core.git/commitdiff
rpm: remove bashisms: [ x == x ] -> [ x = x ]
authorOlof Johansson <olof.johansson@axis.com>
Tue, 19 Jan 2016 13:45:32 +0000 (14:45 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 19 Jan 2016 17:39:50 +0000 (17:39 +0000)
The postinst and postrm of rpm contained a bashism, that could in some
situations potentially cause ldconfig not be triggered when it should
be. If you use dash on host, test would fail because of syntax errors.
But on host, it should fail because of the comparison. On target, you
often use busybox ash, and it supports == as an alias for =. So in
practice, only if you use a shell like dash on target, you'll run into
issues with this.

Signed-off-by: Olof Johansson <olofjn@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/rpm/rpm_4.11.2.bb

index a48852f87580fcf56286c829ebc40999b0e11b21..3683971cd52b7d3b17165c3c4b2435da1767e8a0 100644 (file)
@@ -101,8 +101,7 @@ do_install_append() {
 }
 
 pkg_postinst_${PN}() {
-
-    [ "x\$D" == "x" ] && ldconfig
+    [ "x\$D" = "x" ] && ldconfig
     test -f ${localstatedir}/lib/rpm/Packages || rpm --initdb
     rm -f ${localstatedir}/lib/rpm/Filemd5s \
           ${localstatedir}/lib/rpm/Filedigests \
@@ -112,7 +111,7 @@ pkg_postinst_${PN}() {
 }
 
 pkg_postrm_${PN}() {
-    [ "x\$D" == "x" ] && ldconfig
+    [ "x\$D" = "x" ] && ldconfig
 
 }