]> code.ossystems Code Review - openembedded-core.git/commitdiff
ncurses: use new update-alternatives
authorMark Hatle <mark.hatle@windriver.com>
Tue, 15 May 2012 23:35:04 +0000 (18:35 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 30 May 2012 09:45:17 +0000 (10:45 +0100)
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
meta/recipes-core/ncurses/ncurses.inc

index b0311196eebf3d2164814e24cff1fe5e84633a70..fbfbf0c7353c26f7f8be5b3ecfd2de20a2617981 100644 (file)
@@ -166,12 +166,6 @@ shell_do_install() {
 
         rm -f ${D}${libdir}/terminfo
 
-        if [ "${PN}" = "ncurses" ]; then
-                mv ${D}${bindir}/clear ${D}${bindir}/clear.${PN}
-                mv ${D}${bindir}/reset ${D}${bindir}/reset.${PN}
-        fi
-
-
         # create linker scripts for libcurses.so and libncurses to
         # link against -ltinfo when needed. Some builds might break
         # else when '-Wl,--no-copy-dt-needed-entries' has been set in
@@ -220,19 +214,11 @@ python populate_packages_prepend () {
 }
 
 
-pkg_postinst_ncurses-tools () {
-        if [ "${PN}" = "ncurses" ]; then
-                update-alternatives --install ${bindir}/clear clear clear.${PN} 100
-                update-alternatives --install ${bindir}/reset reset reset.${PN} 100
-        fi
-}
+inherit update-alternatives
 
-pkg_prerm_ncurses-tools () {
-        if [ "${PN}" = "ncurses" ]; then
-                update-alternatives --remove clear clear.${PN}
-                update-alternatives --remove reset reset.${PN}
-        fi
-}
+ALTERNATIVE_PRIORITY = "100"
+
+ALTERNATIVE_ncurses-tools = "clear reset"
 
 BBCLASSEXTEND = "native nativesdk"