[OE-core] [PATCH V3 3/3] bash: add pkg_postrm to remove the entry in /etc/shells
Phil Blundell
pb at pbcl.net
Fri Oct 18 14:59:36 UTC 2013
On Fri, 2013-10-18 at 19:11 +0800, Ming Liu wrote:
> 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
> + if [ ! -f $D${sysconfdir}/shells ]; then
> + touch $D${sysconfdir}/shells
> + fi
> +
> + grep -q "^${base_bindir}/bash$" $D${sysconfdir}/shells || echo ${base_bindir}/bash >> $D${sysconfdir}/shells
> +}
This patch contains significant changes to the postinst script which
aren't described in the commit message.
p.
> +
> +pkg_postrm_${PN} () {
> + if [ -f $D${sysconfdir}/shells ]; then
> + printf "$(grep -v "^${base_bindir}/bash$" $D${sysconfdir}/shells)\n" > $D${sysconfdir}/shells
> +
> + if [ ! -s $D${sysconfdir}/shells ]; then
> + rm $D${sysconfdir}/shells
> + fi
> + fi
> }
More information about the Openembedded-core
mailing list