]> code.ossystems Code Review - openembedded-core.git/commitdiff
stat: use update-alt for stat
authorSaul Wold <sgw@linux.intel.com>
Fri, 13 Jun 2014 17:48:13 +0000 (10:48 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 14 Jun 2014 07:41:53 +0000 (08:41 +0100)
Three different recipes provide the stat program, busybox, coreutils and stat.
Ensure that they are installed to the same place and use update-alternative
with the correct priorities to have the correct binary installed.

[YOCTO #6415]

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-extended/stat/stat_3.3.bb

index c9edb1de5b0f6b8efdba4580c426d9068ce95771..6754fb8cbd2448d357d23c9f27bccb93099ed64e 100644 (file)
@@ -12,10 +12,17 @@ SRC_URI[md5sum] = "37e247e8e400ad9205f1b0500b728fd3"
 SRC_URI[sha256sum] = "7071f0384a423a938dd542c1f08547a02824f6359acd3ef3f944b2c4c2d1ee09"
 
 do_install() {
-       install -d ${D}${bindir} ${D}${mandir}/man1
-       install -m 755 stat ${D}${bindir}
+       install -d ${D}${base_bindir} ${D}${mandir}/man1
+       install -m 755 stat ${D}${base_bindir}/stat.stat
        install -m 644 stat.1 ${D}${mandir}/man1
 }
 
+inherit update-alternatives
+
+ALTERNATIVE_${PN} = "stat"
+ALTERNATIVE_PRIORITY[stat] = "200"
+ALTERNATIVE_LINK_NAME[stat] = "${base_bindir}/stat"
+ALTERNATIVE_TARGET[stat] = "${base_bindir}/stat.stat"
+
 BBCLASSEXTEND = "native"