All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chen Qi <Qi.Chen@windriver.com>
To: <openembedded-core@lists.openembedded.org>
Subject: [PATCH 1/2] package_manager: default to have scriptlet output captured in log
Date: Wed, 21 Dec 2016 12:32:46 +0800	[thread overview]
Message-ID: <4e33a8311af3ea53162e3c9a8ed0848b4a8250cc.1482294710.git.Qi.Chen@windriver.com> (raw)
In-Reply-To: <cover.1482294710.git.Qi.Chen@windriver.com>

We need to have scriptlet output captured in log. If we don't do so,
some useful information from scriptlets (especially postinstall script)
would be missing. In case a script has a warning message but it does not
necessarily have to fail, the message should be captured.

Opkg has already done that. Change for rpm and dpkg so that scriptlet
output is captured and no warning message is missing.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/lib/oe/package_manager.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index e557473..6892106 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -669,11 +669,11 @@ class RpmPM(PackageManager):
         self.install_dir_path = os.path.join(self.target_rootfs, self.install_dir_name)
         self.rpm_cmd = bb.utils.which(os.getenv('PATH'), "rpm")
         self.smart_cmd = bb.utils.which(os.getenv('PATH'), "smart")
-        # 0 = default, only warnings
-        # 1 = --log-level=info (includes information about executing scriptlets and their output)
+        # 0 = --log-level=warning, only warnings
+        # 1 = --log-level=info (includes information about executing scriptlets and their output), default
         # 2 = --log-level=debug
         # 3 = --log-level=debug plus dumps of scriplet content and command invocation
-        self.debug_level = int(d.getVar('ROOTFS_RPM_DEBUG') or "0")
+        self.debug_level = int(d.getVar('ROOTFS_RPM_DEBUG') or "1")
         self.smart_opt = ["--log-level=%s" %
                          ("warning" if self.debug_level == 0 else
                           "info" if self.debug_level == 1 else
@@ -2025,7 +2025,8 @@ class DpkgPM(OpkgDpkgPM):
                         bb.note("Executing %s for package: %s ..." %
                                  (control_script.name.lower(), pkg_name))
                         subprocess.check_output([p_full, control_script.argument],
-                                stderr=subprocess.STDOUT)
+                                stderr=subprocess.STDOUT).decode("utf-8")
+                        bb.note(output)
                     except subprocess.CalledProcessError as e:
                         bb.note("%s for package %s failed with %d:\n%s" %
                                 (control_script.name, pkg_name, e.returncode,
-- 
1.9.1



  reply	other threads:[~2016-12-21  4:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-21  4:32 [PATCH 0/2] warn when ALTERNATIVE_PRIORITY are the same Chen Qi
2016-12-21  4:32 ` Chen Qi [this message]
2016-12-22  9:36   ` [PATCH 1/2] package_manager: default to have scriptlet output captured in log Jussi Kukkonen
2016-12-23  2:02     ` ChenQi
2016-12-21  4:32 ` [PATCH 2/2] opkg-utils: warn if update-alternatives finds priority conflict Chen Qi

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=4e33a8311af3ea53162e3c9a8ed0848b4a8250cc.1482294710.git.Qi.Chen@windriver.com \
    --to=qi.chen@windriver.com \
    --cc=openembedded-core@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.