]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
sed: test bindir and base_bindir before moving and removing things
authorChen Qi <Qi.Chen@windriver.com>
Thu, 27 Nov 2014 07:53:36 +0000 (02:53 -0500)
committerChen Qi <Qi.Chen@windriver.com>
Fri, 19 Dec 2014 09:05:19 +0000 (17:05 +0800)
It's possible that ${base_bindir} and ${bindir} point to the same directory.
So we need to test it before moving things around or removing things.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
meta/recipes-extended/sed/sed_4.1.2.bb
meta/recipes-extended/sed/sed_4.2.2.bb

index fe242e16bd878234f33ff8d7715a1ed8f01e9b2e..a2bcb7d75a54ee33969365adea35e18988821bc6 100644 (file)
@@ -23,8 +23,10 @@ do_configure_prepend () {
 do_install () {
        autotools_do_install
        install -d ${D}${base_bindir}
-       mv ${D}${bindir}/sed ${D}${base_bindir}/sed
-       rmdir ${D}${bindir}/
+       if [ "${bindir}" != "${base_bindir}" ]; then
+           mv ${D}${bindir}/sed ${D}${base_bindir}/sed
+           rmdir ${D}${bindir}/
+       fi
 }
 
 ALTERNATIVE_${PN} = "sed"
index ea39dae435e6e3a43e73d1d701be7ef36bd16aa0..1c49c129695749c021825a82eac0a1632c396d79 100644 (file)
@@ -22,8 +22,10 @@ EXTRA_OECONF = "--disable-acl \
 do_install () {
        autotools_do_install
        install -d ${D}${base_bindir}
-       mv ${D}${bindir}/sed ${D}${base_bindir}/sed
-       rmdir ${D}${bindir}/
+       if [ "${bindir}" != "${base_bindir}" ]; then
+           mv ${D}${bindir}/sed ${D}${base_bindir}/sed
+           rmdir ${D}${bindir}/
+       fi
 }
 
 ALTERNATIVE_${PN} = "sed"