[oe] [PATCH] rootfs_ipk.bbclass: run preinst/postinst scripts with "-e"
Chris Larson
clarson at kergoth.com
Fri Apr 9 15:48:54 UTC 2010
Looks good to me. The script could always set +e to disable it anyway if it
really wanted to :)
Acked-by: Chris Larson <clarson at kergoth.com>
On Fri, Apr 9, 2010 at 4:19 AM, Roman I Khimov <khimov at altell.ru> wrote:
> There are scripts that can and should work when being ran on build
> host (for example, simple update-rc.d), but there are also many which
> can't and won't ever (for example, anything adding users/groups).
> The second group sometimes doesn't get "unpacked" flag because
> scripts throw errors in the middle and return something nice from
> the last command.
>
> It can be considered as a bug in pre/postinst script (as it should
> either explicitly check for "${D}" or just do "set -e" at start),
> but it is common enough.
>
> There is also another aspect to this as in general we can't be sure
> that everything is OK wrt preinst/postinst if script commands throw
> errors.
>
> Running preinst/postinst scripts on host with "-e" should solve
> that.
>
> Signed-off-by: Roman I Khimov <khimov at altell.ru>
> ---
> classes/rootfs_ipk.bbclass | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/classes/rootfs_ipk.bbclass b/classes/rootfs_ipk.bbclass
> index 3a73ed8..5483c7e 100644
> --- a/classes/rootfs_ipk.bbclass
> +++ b/classes/rootfs_ipk.bbclass
> @@ -70,12 +70,12 @@ fakeroot rootfs_ipk_do_rootfs () {
> fi
>
> for i in ${IMAGE_ROOTFS}${libdir}/opkg/info/*.preinst; do
> - if [ -f $i ] && ! sh $i; then
> + if [ -f $i ] && ! sh -e $i; then
> opkg-cl ${IPKG_ARGS} flag unpacked `basename $i
> .preinst`
> fi
> done
> for i in ${IMAGE_ROOTFS}${libdir}/opkg/info/*.postinst; do
> - if [ -f $i ] && ! sh $i configure; then
> + if [ -f $i ] && ! sh -e $i configure; then
> opkg-cl ${IPKG_ARGS} flag unpacked `basename $i
> .postinst`
> fi
> done
> --
> 1.5.6.5
>
>
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel at lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
>
--
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
More information about the Openembedded-devel
mailing list