]> code.ossystems Code Review - openembedded-core.git/commitdiff
screen: dynamically add or remove a entry to/from /etc/shells
authorMing Liu <ming.liu@windriver.com>
Tue, 22 Oct 2013 03:12:01 +0000 (11:12 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 26 Oct 2013 14:53:25 +0000 (15:53 +0100)
1 Add base-files to RDEPENDS.
2 Add pkg_postinst and pkg_postrm to add and remove a entry in
/etc/shells.

Signed-off-by: Ming Liu <ming.liu@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
meta/recipes-extended/screen/screen_4.0.3.bb

index 1a7eb2031b8d6a46deefec511ac13246987d57e7..be42fb9eec3a9e1deebaf8c484dc8ea4eb592a33 100644 (file)
@@ -12,6 +12,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=0774d66808b0f602e94448108f59448b \
 SECTION = "console/utils"
 DEPENDS = "ncurses \
           ${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
+RDEPENDS_${PN} = "base-files"
+
 PR = "r3"
 
 SRC_URI = "${GNU_MIRROR}/screen/screen-${PV}.tar.gz;name=tarball \
@@ -41,3 +43,11 @@ do_install_append () {
                fi
        done
 }
+
+pkg_postinst_${PN} () {
+       grep -q "^${bindir}/screen$" $D${sysconfdir}/shells || echo ${bindir}/screen >> $D${sysconfdir}/shells
+}
+
+pkg_postrm_${PN} () {
+       printf "$(grep -v "^${bindir}/screen$" $D${sysconfdir}/shells)\n" > $D${sysconfdir}/shells
+}