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:59:19 +0100 |
| commit | 312cc0f21afe3a8e7a8100f241a10c24026ef6d8 (patch) | |
| tree | d6a9e3d026ea39b740582211272c7b2a3ec8ef6f | |
| parent | be860ac5bc83571d017127d4a11aa77207af09ac (diff) | |
| download | poky-312cc0f21afe3a8e7a8100f241a10c24026ef6d8.tar.gz | |
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.
(From OE-Core rev: c3f93357e2d3ece910ff0e2d18eba3fb94fb5c3c)
Signed-off-by: Ming Liu <ming.liu@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -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" | |||
| 17 | 17 | ||
| 18 | export AUTOHEADER = "true" | 18 | export AUTOHEADER = "true" |
| 19 | 19 | ||
| 20 | RDEPENDS_${PN} += "base-files" | ||
| 21 | RDEPENDS_${PN}_class-nativesdk = "" | ||
| 20 | RDEPENDS_${PN}-ptest += "make" | 22 | RDEPENDS_${PN}-ptest += "make" |
| 21 | 23 | ||
| 22 | do_configure_prepend () { | 24 | do_configure_prepend () { |
| @@ -44,7 +46,9 @@ do_install_ptest () { | |||
| 44 | } | 46 | } |
| 45 | 47 | ||
| 46 | pkg_postinst_${PN} () { | 48 | pkg_postinst_${PN} () { |
| 47 | touch $D${sysconfdir}/shells | 49 | grep -q "^${base_bindir}/bash$" $D${sysconfdir}/shells || echo ${base_bindir}/bash >> $D${sysconfdir}/shells |
| 48 | grep -q "bin/bash" $D${sysconfdir}/shells || echo /bin/bash >> $D${sysconfdir}/shells | 50 | } |
| 49 | grep -q "bin/sh" $D${sysconfdir}/shells || echo /bin/sh >> $D${sysconfdir}/shells | 51 | |
| 52 | pkg_postrm_${PN} () { | ||
| 53 | printf "$(grep -v "^${base_bindir}/bash$" $D${sysconfdir}/shells)\n" > $D${sysconfdir}/shells | ||
| 50 | } | 54 | } |
