summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/grep
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2012-05-21 16:17:55 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-05-30 10:45:33 +0100
commitca478f563575ff2262741821ec35d4dfbf9f4487 (patch)
tree0697ce4f4da7811ae4abdfa2cc7f95e1ae268b4e /meta/recipes-extended/grep
parent6dee3050a4a0c4f3cc9fec23a0bc02155d680863 (diff)
downloadopenembedded-core-ca478f563575ff2262741821ec35d4dfbf9f4487.tar.gz
openembedded-core-ca478f563575ff2262741821ec35d4dfbf9f4487.tar.bz2
openembedded-core-ca478f563575ff2262741821ec35d4dfbf9f4487.zip
grep: use new update-alternatives
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Diffstat (limited to 'meta/recipes-extended/grep')
-rw-r--r--meta/recipes-extended/grep/grep_2.5.1a.bb23
-rw-r--r--meta/recipes-extended/grep/grep_2.9.bb26
2 files changed, 22 insertions, 27 deletions
diff --git a/meta/recipes-extended/grep/grep_2.5.1a.bb b/meta/recipes-extended/grep/grep_2.5.1a.bb
index 5aecf17cf0..3a8bcbfdb7 100644
--- a/meta/recipes-extended/grep/grep_2.5.1a.bb
+++ b/meta/recipes-extended/grep/grep_2.5.1a.bb
@@ -27,20 +27,17 @@ do_configure_prepend () {
do_install () {
autotools_do_install
install -d ${D}${base_bindir}
- mv ${D}${bindir}/grep ${D}${base_bindir}/grep.${PN}
- mv ${D}${bindir}/egrep ${D}${base_bindir}/egrep.${PN}
- mv ${D}${bindir}/fgrep ${D}${base_bindir}/fgrep.${PN}
+ mv ${D}${bindir}/grep ${D}${base_bindir}/grep
+ mv ${D}${bindir}/egrep ${D}${base_bindir}/egrep
+ mv ${D}${bindir}/fgrep ${D}${base_bindir}/fgrep
rmdir ${D}${bindir}/
}
-pkg_postinst_${PN} () {
- update-alternatives --install ${base_bindir}/grep grep grep.${PN} 100
- update-alternatives --install ${base_bindir}/egrep egrep egrep.${PN} 100
- update-alternatives --install ${base_bindir}/fgrep fgrep fgrep.${PN} 100
-}
+inherit update-alternatives
-pkg_prerm_${PN} () {
- update-alternatives --remove grep grep.${PN}
- update-alternatives --remove egrep egrep.${PN}
- update-alternatives --remove fgrep fgrep.${PN}
-}
+ALTERNATIVE_PRIORITY = "100"
+
+ALTERNATIVE_${PN} = "grep egrep fgrep"
+ALTERNATIVE_LINK_NAME[grep] = "${base_bindir}/grep"
+ALTERNATIVE_LINK_NAME[egrep] = "${base_bindir}/egrep"
+ALTERNATIVE_LINK_NAME[fgrep] = "${base_bindir}/fgrep"
diff --git a/meta/recipes-extended/grep/grep_2.9.bb b/meta/recipes-extended/grep/grep_2.9.bb
index 1bc79f21c9..f936611062 100644
--- a/meta/recipes-extended/grep/grep_2.9.bb
+++ b/meta/recipes-extended/grep/grep_2.9.bb
@@ -6,7 +6,7 @@ SECTION = "console/utils"
LICENSE = "GPLv3"
LIC_FILES_CHKSUM = "file://COPYING;md5=8006d9c814277c1bfc4ca22af94b59ee"
-PR = "r1"
+PR = "r2"
SRC_URI = "${GNU_MIRROR}/grep/grep-${PV}.tar.gz"
@@ -24,20 +24,18 @@ do_configure_prepend () {
do_install () {
autotools_do_install
install -d ${D}${base_bindir}
- mv ${D}${bindir}/grep ${D}${base_bindir}/grep.${PN}
- mv ${D}${bindir}/egrep ${D}${base_bindir}/egrep.${PN}
- mv ${D}${bindir}/fgrep ${D}${base_bindir}/fgrep.${PN}
+ mv ${D}${bindir}/grep ${D}${base_bindir}/grep
+ mv ${D}${bindir}/egrep ${D}${base_bindir}/egrep
+ mv ${D}${bindir}/fgrep ${D}${base_bindir}/fgrep
rmdir ${D}${bindir}/
}
-pkg_postinst_${PN} () {
- update-alternatives --install ${base_bindir}/grep grep grep.${PN} 100
- update-alternatives --install ${base_bindir}/egrep egrep egrep.${PN} 100
- update-alternatives --install ${base_bindir}/fgrep fgrep fgrep.${PN} 100
-}
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+
+ALTERNATIVE_${PN} = "grep egrep fgrep"
+ALTERNATIVE_LINK_NAME[grep] = "${base_bindir}/grep"
+ALTERNATIVE_LINK_NAME[egrep] = "${base_bindir}/egrep"
+ALTERNATIVE_LINK_NAME[fgrep] = "${base_bindir}/fgrep"
-pkg_prerm_${PN} () {
- update-alternatives --remove grep grep.${PN}
- update-alternatives --remove egrep egrep.${PN}
- update-alternatives --remove fgrep fgrep.${PN}
-}