[oe-commits] Chen Qi : dpkg: modify the run-postinst script to enable postinst logging

git at git.openembedded.org git at git.openembedded.org
Thu May 23 09:52:49 UTC 2013


Module: openembedded-core.git
Branch: master-next
Commit: 881880992ac0edc5f928f7e3d2a8f3f993284df6
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=881880992ac0edc5f928f7e3d2a8f3f993284df6

Author: Chen Qi <Qi.Chen at windriver.com>
Date:   Thu May 23 12:43:34 2013 +0800

dpkg: modify the run-postinst script to enable postinst logging

Enable postinst logging by checking the configuration in ${sysconfdir}
/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 at windriver.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/recipes-devtools/dpkg/dpkg.inc |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/meta/recipes-devtools/dpkg/dpkg.inc b/meta/recipes-devtools/dpkg/dpkg.inc
index d773fbd..6197777 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 ${sysconfdir}/default/postinst ] && . ${sysconfdir}/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



More information about the Openembedded-commits mailing list