cpio: use new update-alternatives
(From OE-Core rev: 6dee3050a4a0c4f3cc9fec23a0bc02155d680863) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
8a4a7a2619
commit
2851d751a8
|
@ -3,7 +3,7 @@ include cpio_v2.inc
|
|||
LICENSE = "GPLv3"
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949"
|
||||
|
||||
PR = "r1"
|
||||
PR = "r2"
|
||||
|
||||
SRC_URI[md5sum] = "1112bb6c45863468b5496ba128792f6c"
|
||||
SRC_URI[sha256sum] = "601b1d774cd6e4cd39416203c91ec59dbd65dd27d79d75e1a9b89497ea643978"
|
||||
|
|
|
@ -3,7 +3,7 @@ require cpio_v2.inc
|
|||
LICENSE = "GPLv2"
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=b7f772ea3a2489231cb4872656cac34b"
|
||||
|
||||
PR = "r1"
|
||||
PR = "r2"
|
||||
|
||||
SRC_URI += "file://m4extensions.patch \
|
||||
file://avoid_heap_overflow.patch \
|
||||
|
|
|
@ -17,26 +17,17 @@ S = "${WORKDIR}/cpio-${PV}"
|
|||
do_install () {
|
||||
autotools_do_install
|
||||
install -d ${D}${base_bindir}/
|
||||
mv "${D}${bindir}/cpio" "${D}${base_bindir}/cpio.${PN}"
|
||||
mv "${D}${bindir}/cpio" "${D}${base_bindir}/cpio"
|
||||
rmdir ${D}${bindir}/
|
||||
case ${TARGET_OS} in
|
||||
*-uclibc*) ;;
|
||||
*) mv "${D}${libexecdir}/rmt" "${D}${libexecdir}/rmt.${PN}" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
pkg_postinst_${PN} () {
|
||||
update-alternatives --install ${base_bindir}/cpio cpio cpio.${PN} 100
|
||||
if [ -f ${libexecdir}/rmt.${PN} ]
|
||||
then
|
||||
update-alternatives --install ${libexecdir}/rmt rmt rmt.${PN} 50
|
||||
fi
|
||||
}
|
||||
inherit update-alternatives
|
||||
|
||||
pkg_prerm_${PN} () {
|
||||
update-alternatives --remove cpio cpio.${PN}
|
||||
if [ -f ${libexecdir}/rmt.${PN} ]
|
||||
then
|
||||
update-alternatives --remove rmt rmt.${PN}
|
||||
fi
|
||||
}
|
||||
ALTERNATIVE_PRIORITY = "100"
|
||||
|
||||
ALTERNATIVE_${PN} = "cpio rmt"
|
||||
|
||||
ALTERNATIVE_LINK_NAME[cpio] = "${base_bindir}/cpio"
|
||||
|
||||
ALTERNATIVE_PRIORITY[rmt] = "50"
|
||||
ALTERNATIVE_LINK_NAME[rmt] = "${libexecdir}/rmt"
|
||||
|
|
Loading…
Reference in New Issue