All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] A couple of fixes for do_rootfs log checking
@ 2015-06-08 10:04 Paul Eggleton
  2015-06-08 10:04 ` [PATCH 1/2] lib/oe/rootfs: tidy up log warning reporting Paul Eggleton
  2015-06-08 10:04 ` [PATCH 2/2] python-smartpm: change "already installed" warnings into info messages Paul Eggleton
  0 siblings, 2 replies; 3+ messages in thread
From: Paul Eggleton @ 2015-06-08 10:04 UTC (permalink / raw)
  To: openembedded-core

The following changes since commit 3b1d89a51445cf526ca84eb5b53de434f9585d6e:

  scripts/combo-layer: Fix exit codes and tty handling (2015-06-05 16:42:07 +0100)

are available in the git repository at:

  git://git.openembedded.org/openembedded-core-contrib paule/rootfs-warning
  http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/rootfs-warning

Paul Eggleton (2):
  lib/oe/rootfs: tidy up log warning reporting
  python-smartpm: change "already installed" warnings into info messages

 meta/lib/oe/rootfs.py                              | 13 +++---
 .../smart-already-installed-message.patch          | 54 ++++++++++++++++++++++
 .../python/python-smartpm_1.4.1.bb                 |  1 +
 3 files changed, 61 insertions(+), 7 deletions(-)
 create mode 100644 meta/recipes-devtools/python/python-smartpm/smart-already-installed-message.patch

-- 
2.1.0



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] lib/oe/rootfs: tidy up log warning reporting
  2015-06-08 10:04 [PATCH 0/2] A couple of fixes for do_rootfs log checking Paul Eggleton
@ 2015-06-08 10:04 ` Paul Eggleton
  2015-06-08 10:04 ` [PATCH 2/2] python-smartpm: change "already installed" warnings into info messages Paul Eggleton
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Eggleton @ 2015-06-08 10:04 UTC (permalink / raw)
  To: openembedded-core

* bb.warn() should only be called once per warning - UIs such as Toaster
  assume that this is the case, so adjust the output accordingly. (It's
  tricky here because we have to include "log_check" on every line or
  we'll end up looping forever as the log checking code's own messages
  retrigger the log check, sigh...)
* Iterating over a file already splits by line, there's no need to do it
  manually.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 meta/lib/oe/rootfs.py | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index 5f1f7b3e..48e5754 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -44,15 +44,14 @@ class Rootfs(object):
         r = re.compile('^(warn|Warn|NOTE: warn|NOTE: Warn|WARNING:)')
         log_path = self.d.expand("${T}/log.do_rootfs")
         with open(log_path, 'r') as log:
-            for line in log.read().split('\n'):
+            for line in log:
                 if 'log_check' in line or 'NOTE:' in line:
                     continue
 
                 m = r.search(line)
                 if m:
-                    bb.warn('log_check: There is a warn message in the logfile')
-                    bb.warn('log_check: Matched keyword: [%s]' % m.group())
-                    bb.warn('log_check: %s\n' % line)
+                    bb.warn('[log_check] %s: found a warning message in the logfile (keyword \'%s\'):\n[log_check] %s'
+				    % (self.d.getVar('PN', True), m.group(), line))
 
     def _log_check_error(self):
         r = re.compile(self.log_check_regex)
@@ -60,15 +59,15 @@ class Rootfs(object):
         with open(log_path, 'r') as log:
             found_error = 0
             message = "\n"
-            for line in log.read().split('\n'):
+            for line in log:
                 if 'log_check' in line:
                     continue
 
                 m = r.search(line)
                 if m:
                     found_error = 1
-                    bb.warn('log_check: There were error messages in the logfile')
-                    bb.warn('log_check: Matched keyword: [%s]\n\n' % m.group())
+                    bb.warn('[log_check] %s: found an error message in the logfile (keyword \'%s\'):\n[log_check] %s'
+				    % (self.d.getVar('PN', True), m.group(), line))
 
                 if found_error >= 1 and found_error <= 5:
                     message += line + '\n'
-- 
2.1.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] python-smartpm: change "already installed" warnings into info messages
  2015-06-08 10:04 [PATCH 0/2] A couple of fixes for do_rootfs log checking Paul Eggleton
  2015-06-08 10:04 ` [PATCH 1/2] lib/oe/rootfs: tidy up log warning reporting Paul Eggleton
@ 2015-06-08 10:04 ` Paul Eggleton
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Eggleton @ 2015-06-08 10:04 UTC (permalink / raw)
  To: openembedded-core

It's possible to trigger "already installed" messages during normal
usage if you explicitly install something in the image through
IMAGE_INSTALL that has a dependency on some -dev packages and also have
dev-pkgs in IMAGE_FEATURES. Since we now check the do_rootfs log for
warnings, these are reported as warnings at the build system level.
This situation should not trigger warnings, nor is it really cause for
concern under any other circumstance if the user asks smart to install
something that's already installed, so make it an info message rather
than a warning.

Fixes [YOCTO #7840].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 .../smart-already-installed-message.patch          | 54 ++++++++++++++++++++++
 .../python/python-smartpm_1.4.1.bb                 |  1 +
 2 files changed, 55 insertions(+)
 create mode 100644 meta/recipes-devtools/python/python-smartpm/smart-already-installed-message.patch

diff --git a/meta/recipes-devtools/python/python-smartpm/smart-already-installed-message.patch b/meta/recipes-devtools/python/python-smartpm/smart-already-installed-message.patch
new file mode 100644
index 0000000..9055555
--- /dev/null
+++ b/meta/recipes-devtools/python/python-smartpm/smart-already-installed-message.patch
@@ -0,0 +1,54 @@
+From a74a9a9eb9d75964a0e978950e8b191d7a18d763 Mon Sep 17 00:00:00 2001
+From: Paul Eggleton <paul.eggleton@linux.intel.com>
+Date: Fri, 5 Jun 2015 17:07:16 +0100
+Subject: [PATCH] smart: change "is already installed" message from warning to
+ info
+
+This doesn't need to be a warning.
+
+Upstream-Status: Pending
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+---
+ smart/commands/install.py            | 4 ++--
+ smart/interfaces/text/interactive.py | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/smart/commands/install.py b/smart/commands/install.py
+index 6ef9682..80d456b 100644
+--- a/smart/commands/install.py
++++ b/smart/commands/install.py
+@@ -152,7 +152,7 @@ def main(ctrl, opts):
+             for obj in results:
+                 for pkg in obj.packages:
+                     if pkg.installed:
+-                        iface.warning(_("%s (for %s) is already installed")
++                        iface.info(_("%s (for %s) is already installed")
+                                       % (pkg, arg))
+                         installed = True
+                         break
+@@ -184,7 +184,7 @@ def main(ctrl, opts):
+         for name in names:
+             pkg = names[name][0]
+             if pkg.installed:
+-                iface.warning(_("%s is already installed") % pkg)
++                iface.info(_("%s is already installed") % pkg)
+             else:
+                 trans.enqueue(pkg, INSTALL)
+ 
+diff --git a/smart/interfaces/text/interactive.py b/smart/interfaces/text/interactive.py
+index 9865584..190867b 100644
+--- a/smart/interfaces/text/interactive.py
++++ b/smart/interfaces/text/interactive.py
+@@ -278,7 +278,7 @@ class Interpreter(Cmd):
+             for name in names:
+                 pkg = names[name][0]
+                 if pkg.installed:
+-                    iface.warning(_("%s is already installed") % pkg)
++                    iface.info(_("%s is already installed") % pkg)
+                 else:
+                     found = True
+                     transaction.enqueue(pkg, INSTALL)
+-- 
+2.1.0
+
diff --git a/meta/recipes-devtools/python/python-smartpm_1.4.1.bb b/meta/recipes-devtools/python/python-smartpm_1.4.1.bb
index c75f10f..69b94a2 100644
--- a/meta/recipes-devtools/python/python-smartpm_1.4.1.bb
+++ b/meta/recipes-devtools/python/python-smartpm_1.4.1.bb
@@ -34,6 +34,7 @@ SRC_URI = "\
           file://smart-filename-NAME_MAX.patch \
           file://smart-rpm4-fixes.patch \
           file://smart-add-for-rpm-ignoresize-check.patch \
+          file://smart-already-installed-message.patch \
          "
 
 SRC_URI[md5sum] = "573ef32ba177a6b3c4bf7ef04873fcb6"
-- 
2.1.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-06-08 10:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-08 10:04 [PATCH 0/2] A couple of fixes for do_rootfs log checking Paul Eggleton
2015-06-08 10:04 ` [PATCH 1/2] lib/oe/rootfs: tidy up log warning reporting Paul Eggleton
2015-06-08 10:04 ` [PATCH 2/2] python-smartpm: change "already installed" warnings into info messages Paul Eggleton

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.