Patchwork [13/30] lrzsz: use new update-alternatives

login
register
mail settings
Submitter Mark Hatle
Date May 22, 2012, 7:30 p.m.
Message ID <bfd0dd2db21a502b11842c0a692b89f6d110bc08.1337714416.git.mark.hatle@windriver.com>
Download mbox | patch
Permalink /patch/28281/
State New
Headers show

Comments

Mark Hatle - May 22, 2012, 7:30 p.m.
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
 meta/recipes-bsp/lrzsz/lrzsz_0.12.20.bb |   30 +++++++++++++-----------------
 1 files changed, 13 insertions(+), 17 deletions(-)

Patch

diff --git a/meta/recipes-bsp/lrzsz/lrzsz_0.12.20.bb b/meta/recipes-bsp/lrzsz/lrzsz_0.12.20.bb
index 7f86157..12ac5ff 100644
--- a/meta/recipes-bsp/lrzsz/lrzsz_0.12.20.bb
+++ b/meta/recipes-bsp/lrzsz/lrzsz_0.12.20.bb
@@ -10,7 +10,7 @@  LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
 			file://src/lrz.c;beginline=1;endline=10;md5=5276956373ff7d8758837f6399a1045f"
 SECTION = "console/network"
 DEPENDS = ""
-PR = "r4"
+PR = "r5"
 
 SRC_URI = "http://www.ohse.de/uwe/releases/lrzsz-${PV}.tar.gz \
 	   file://autotools.patch \
@@ -27,20 +27,16 @@  do_install() {
 	install -m 0755 src/lrz src/lsz ${D}${bindir}/
 }
 
-pkg_postinst_${PN}() {
-	for util in rz rx rb; do
-		update-alternatives --install ${bindir}/$util $util lrz 100
-	done
-	for util in sz sx sb; do
-		update-alternatives --install ${bindir}/$util $util lsz 100
-	done
-}
+inherit update-alternatives
 
-pkg_postrm_${PN}() {
-	for util in rz rx rb; do
-		update-alternatives --remove $util ${bindir}/lrz
-	done
-	for util sz sx sb; do
-		update-alternatives --remove $util ${bindir}/lsz
-	done
-}
+ALTERNATIVE_PRIORITY = "100"
+
+ALTERNATIVE_${PN} = "rz rx rb sz sx sb"
+
+ALTERNATIVE_TARGET[rz] = "${bindir}/lrz"
+ALTERNATIVE_TARGET[rx] = "${bindir}/lrz"
+ALTERNATIVE_TARGET[rb] = "${bindir}/lrz"
+
+ALTERNATIVE_TARGET[sz] = "${bindir}/lsz"
+ALTERNATIVE_TARGET[sx] = "${bindir}/lsz"
+ALTERNATIVE_TARGET[sb] = "${bindir}/lsz"