All of lore.kernel.org
 help / color / mirror / Atom feed
From: <Qi.Chen@windriver.com>
To: <openembedded-core@lists.openembedded.org>
Cc: qingtao.cao@windriver.com
Subject: [PATCH V3 2/4] dpkg: modify the run-postinst script to enable postinst logging
Date: Tue, 21 May 2013 16:12:09 +0800	[thread overview]
Message-ID: <f4a775e12f1f3da88dc8655adc76596b8de00362.1369123754.git.Qi.Chen@windriver.com> (raw)
In-Reply-To: <cover.1369123754.git.Qi.Chen@windriver.com>

From: Chen Qi <Qi.Chen@windriver.com>

Enable postinst logging by checking the configuration in /etc/
default/postinst.

In this way, the postinst logging is enabled if 'debug-tweaks' is
in IMAGE_FEATURES, and at the same time, we avoid unnecessary rebuilt
if IMAGE_FEATURES is changed.

[YOCTO #4262]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/recipes-devtools/dpkg/dpkg.inc |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/meta/recipes-devtools/dpkg/dpkg.inc b/meta/recipes-devtools/dpkg/dpkg.inc
index d773fbd..08a9f5a 100644
--- a/meta/recipes-devtools/dpkg/dpkg.inc
+++ b/meta/recipes-devtools/dpkg/dpkg.inc
@@ -35,10 +35,6 @@ do_configure () {
     autotools_do_configure
 }
 
-POSTLOG ?= "/var/log/postinstall.log"
-REDIRECT_CMD = "${@base_contains('IMAGE_FEATURES', 'debug-tweaks', '>${POSTLOG} 2>&1', '', d)}"
-REDIRECT_CMD[vardepsexclude] += "IMAGE_FEATURES POSTLOG"
-
 DPKG_INIT_POSITION ?= "98"
 
 do_install_append () {
@@ -67,7 +63,12 @@ if [ "x$D" != "x" ] && [ -f $D/var/lib/dpkg/status ]; then
 
 	# this happens at S98 where our good 'ole packages script used to run
 	echo "#!/bin/sh
-dpkg --configure -a ${REDIRECT_CMD}
+[ -e /etc/default/postinst ] && . /etc/default/postinst
+if [ \"\$POSTINST_LOGGING\" = \"1\" ]; then
+    dpkg --configure -a >\$LOGFILE 2>&1
+else
+    dpkg --configure -a
+fi
 rm -f ${sysconfdir}/rcS.d/S${DPKG_INIT_POSITION}run-postinsts
 " > $D${sysconfdir}/rcS.d/S${DPKG_INIT_POSITION}run-postinsts
 	chmod 0755 $D${sysconfdir}/rcS.d/S${DPKG_INIT_POSITION}run-postinsts
-- 
1.7.9.5



  parent reply	other threads:[~2013-05-21  8:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-21  8:12 [PATCH V3 0/4] Postinst logging reimplementation Qi.Chen
2013-05-21  8:12 ` [PATCH V3 1/4] image.bbclass: add postinst_enable_logging Qi.Chen
2013-05-21  8:12 ` Qi.Chen [this message]
2013-05-21  8:12 ` [PATCH V3 3/4] opkg: modify the run-postinst script to enable postinst logging Qi.Chen
2013-05-21  8:12 ` [PATCH V3 4/4] rpm-postinsts.bb: " Qi.Chen

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=f4a775e12f1f3da88dc8655adc76596b8de00362.1369123754.git.Qi.Chen@windriver.com \
    --to=qi.chen@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=qingtao.cao@windriver.com \
    /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.