gawk 3.1.4: Use the update-alternatives class rather than manually
authorJamie Lenehan <lenehan@twibble.org>
Sun, 10 Sep 2006 04:21:58 +0000 (04:21 +0000)
committerJamie Lenehan <lenehan@twibble.org>
Sun, 10 Sep 2006 04:21:58 +0000 (04:21 +0000)
performing the update-alternatives actions.

packages/gawk/gawk_3.1.4.bb

index 9594127..5af890e 100644 (file)
@@ -8,7 +8,7 @@ PR = "r3"
 
 SRC_URI = "${GNU_MIRROR}/gawk/gawk-${PV}.tar.gz"
 
-inherit autotools
+inherit autotools update-alternatives
 
 do_configure_prepend () {
         grep -E '^AC_DEFUN' m4/*.m4|grep -E '\(\[?(AM|AC)_'|xargs rm -f
@@ -21,9 +21,7 @@ FILES_gawk-common += "${datadir}/awk/* ${libexecdir}/awk/*"
 FILES_pgawk = "${bindir}/pgawk*"
 FILES_${PN}-dbg += "${libexecdir}/awk/.debug"
 
-pkg_postinst_${PN} () {
-        update-alternatives --install ${bindir}/awk awk gawk 100
-}
-pkg_prerm_${PN} () {
-        update-alternatives --remove awk gawk
-}
+ALTERNATIVE_NAME = "awk"
+ALTERNATIVE_PATH = "gawk"
+ALTERNATIVE_LINK = "${bindir}/awk"
+ALTERNATIVE_PRIORITY = "100"