diff options
author | Ming Liu <ming.liu@windriver.com> | 2013-10-22 11:12:00 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-10-26 15:53:25 +0100 |
commit | c3f93357e2d3ece910ff0e2d18eba3fb94fb5c3c (patch) | |
tree | b8de3f304c7e676db328042d031dae78382be15f /meta/recipes-extended | |
parent | a1d6b55bfa5daa9ba5fa9a7a99dd8872284b6ad8 (diff) | |
download | openembedded-core-c3f93357e2d3ece910ff0e2d18eba3fb94fb5c3c.tar.gz openembedded-core-c3f93357e2d3ece910ff0e2d18eba3fb94fb5c3c.tar.bz2 openembedded-core-c3f93357e2d3ece910ff0e2d18eba3fb94fb5c3c.zip |
bash: dynamically add or remove a entry to/from /etc/shells
1 Add base-files to RDEPENDS.
2 Use ${base_bindir} in regex to match bash path.
3 Add pkg_postrm to remove the entry from /etc/shells that added by
pkg_postinst.
Signed-off-by: Ming Liu <ming.liu@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Diffstat (limited to 'meta/recipes-extended')
-rw-r--r-- | meta/recipes-extended/bash/bash.inc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/meta/recipes-extended/bash/bash.inc b/meta/recipes-extended/bash/bash.inc index 64b476f4fb..99875bfc75 100644 --- a/meta/recipes-extended/bash/bash.inc +++ b/meta/recipes-extended/bash/bash.inc @@ -17,6 +17,8 @@ ALTERNATIVE_PRIORITY = "100" export AUTOHEADER = "true" +RDEPENDS_${PN} += "base-files" +RDEPENDS_${PN}_class-nativesdk = "" RDEPENDS_${PN}-ptest += "make" do_configure_prepend () { @@ -44,7 +46,9 @@ do_install_ptest () { } pkg_postinst_${PN} () { - touch $D${sysconfdir}/shells - grep -q "bin/bash" $D${sysconfdir}/shells || echo /bin/bash >> $D${sysconfdir}/shells - grep -q "bin/sh" $D${sysconfdir}/shells || echo /bin/sh >> $D${sysconfdir}/shells + grep -q "^${base_bindir}/bash$" $D${sysconfdir}/shells || echo ${base_bindir}/bash >> $D${sysconfdir}/shells +} + +pkg_postrm_${PN} () { + printf "$(grep -v "^${base_bindir}/bash$" $D${sysconfdir}/shells)\n" > $D${sysconfdir}/shells } |