which (GPLv3): inherit update-alternatives to handle install priority
inherit the update-alternatives class to handle install priority issue, which is recommended by poky. Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
This commit is contained in:
parent
c4ecd356d1
commit
3f7f13da8c
|
@ -6,9 +6,9 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\
|
||||||
HOMEPAGE = "http://ftp.gnu.org/gnu/which/"
|
HOMEPAGE = "http://ftp.gnu.org/gnu/which/"
|
||||||
DEPENDS = "cwautomacros-native"
|
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 \
|
SRC_URI = "http://ftp.gnu.org/gnu/which/which-${PV}.tar.gz \
|
||||||
file://remove-declaration.patch"
|
file://remove-declaration.patch"
|
||||||
|
@ -22,14 +22,6 @@ do_install() {
|
||||||
mv ${D}${bindir}/which ${D}${bindir}/which.${PN}
|
mv ${D}${bindir}/which ${D}${bindir}/which.${PN}
|
||||||
}
|
}
|
||||||
|
|
||||||
pkg_postinst_${PN} () {
|
ALTERNATIVE_NAME = "which"
|
||||||
if [ "${PN}" = "${BPN}" ] ; then
|
ALTERNATIVE_PATH = "which.${PN}"
|
||||||
update-alternatives --install ${bindir}/which which which.${PN} 100
|
ALTERNATIVE_PRIORITY = "100"
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
pkg_prerm_${PN} () {
|
|
||||||
if [ "${PN}" = "${BPN}" ] ; then
|
|
||||||
update-alternatives --remove which which.${PN}
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue