]> code.ossystems Code Review - openembedded-core.git/commitdiff
which (GPLv3): inherit update-alternatives to handle install priority
authorDongxiao Xu <dongxiao.xu@intel.com>
Wed, 1 Sep 2010 04:56:24 +0000 (12:56 +0800)
committerRichard Purdie <rpurdie@linux.intel.com>
Thu, 2 Sep 2010 08:50:50 +0000 (09:50 +0100)
inherit the update-alternatives class to handle install priority issue,
which is recommended by poky.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
meta/recipes-extended/which/which_2.20.bb

index b7730de3b316ad7158e3459abd097866acbc56c1..6efb24fcd88824684478c16614a3897cfa163b55 100644 (file)
@@ -6,9 +6,9 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\
 HOMEPAGE = "http://ftp.gnu.org/gnu/which/"
 DEPENDS     = "cwautomacros-native"
 
-inherit autotools
+inherit autotools update-alternatives
 
-PR = "r0"
+PR = "r1"
 
 SRC_URI = "http://ftp.gnu.org/gnu/which/which-${PV}.tar.gz \
            file://remove-declaration.patch"
@@ -22,14 +22,6 @@ do_install() {
        mv ${D}${bindir}/which ${D}${bindir}/which.${PN}
 }
 
-pkg_postinst_${PN} () {
-        if [ "${PN}" = "${BPN}" ] ; then
-                update-alternatives --install ${bindir}/which which which.${PN} 100
-        fi
-}
-
-pkg_prerm_${PN} () {
-       if [ "${PN}" = "${BPN}" ] ; then
-               update-alternatives --remove which which.${PN}
-       fi
-}
+ALTERNATIVE_NAME = "which"
+ALTERNATIVE_PATH = "which.${PN}"
+ALTERNATIVE_PRIORITY = "100"