]> code.ossystems Code Review - openembedded-core.git/commitdiff
which (GPLv2): inherit update-alternatives
authorDexuan Cui <dexuan.cui@intel.com>
Fri, 27 Aug 2010 08:36:58 +0000 (16:36 +0800)
committerRichard Purdie <rpurdie@linux.intel.com>
Tue, 31 Aug 2010 16:22:19 +0000 (17:22 +0100)
by this, we can avoid the pkg_postinst/postrm in the recipe file.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
meta/recipes-extended/which/which_2.18.bb

index b177949788976f03365de89638c4a4ab53611015..7eeb320a756f828d22314342ef315f48aeec401e 100644 (file)
@@ -8,14 +8,14 @@ BUGTRACKER = "n/a"
 LICENSE = "GPLv2+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
 
-PR = "r0"
+PR = "r1"
 
 SRC_URI = "http://www.xs4all.nl/~carlo17/which/which-${PV}.tar.gz \
            file://fix_name_conflict_group_member.patch"
 
 DEPENDS = "cwautomacros-native"
 
-inherit autotools
+inherit autotools update-alternatives
 
 do_configure_prepend() {
        OLD="@ACLOCAL_CWFLAGS@"
@@ -26,15 +26,7 @@ do_install_append() {
        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"