All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roman I Khimov <khimov@altell.ru>
To: openembedded-devel@lists.openembedded.org
Subject: [PATCH] rootfs_ipk.bbclass: run preinst/postinst scripts with "-e"
Date: Fri,  9 Apr 2010 15:19:53 +0400	[thread overview]
Message-ID: <1270811993-14861-1-git-send-email-khimov@altell.ru> (raw)
In-Reply-To: <201004091439.53806.khimov@altell.ru>

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@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




  parent reply	other threads:[~2010-04-09 11:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-09 10:26 postinst scripts and opkg configure Sergey Lapin
2010-04-09 10:39 ` Roman I Khimov
2010-04-09 10:53   ` Sergey Lapin
2010-04-09 11:26     ` Roman I Khimov
2010-04-09 13:58       ` Sergey Lapin
2010-04-09 14:26         ` Mike Westerhof
2010-04-09 14:52           ` [PATCH] update-rc.d.bbclass: add dependency on update-rc.d-native Roman I Khimov
2010-04-09 11:19   ` Roman I Khimov [this message]
2010-04-09 15:48     ` [PATCH] rootfs_ipk.bbclass: run preinst/postinst scripts with "-e" Chris Larson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1270811993-14861-1-git-send-email-khimov@altell.ru \
    --to=khimov@altell.ru \
    --cc=openembedded-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.