Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Alex Franco <alejandro.franco@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Cc: paul.eggleton@linux.intel.com
Subject: [PATCH 2/3] Empty image: package list splitting and iteration
Date: Wed, 26 Aug 2015 16:57:34 -0500	[thread overview]
Message-ID: <1440626255-29614-3-git-send-email-alejandro.franco@linux.intel.com> (raw)
In-Reply-To: <1440626255-29614-1-git-send-email-alejandro.franco@linux.intel.com>

A few short fixes to splitting/iteration done over package lists
in license.bbclass, package_manager.py and rootfs.py.

[YOCTO #7664]

Signed-off-by: Alex Franco <alejandro.franco@linux.intel.com>
---
 meta/classes/license.bbclass   | 2 +-
 meta/lib/oe/package_manager.py | 5 +++--
 meta/lib/oe/rootfs.py          | 2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
index 32e172a..c616a20 100644
--- a/meta/classes/license.bbclass
+++ b/meta/classes/license.bbclass
@@ -39,7 +39,7 @@ python license_create_manifest() {
         return 0
 
     pkg_dic = {}
-    for pkg in image_list_installed_packages(d).split("\n"):
+    for pkg in image_list_installed_packages(d).splitlines():
         pkg_info = os.path.join(d.getVar('PKGDATA_DIR', True),
                                 'runtime-reverse', pkg)
         pkg_name = os.path.basename(os.readlink(pkg_info))
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 2ab1d78..ef917f1 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -995,9 +995,10 @@ class RpmPM(PackageManager):
     '''
     def install(self, pkgs, attempt_only=False):
 
-        bb.note("Installing the following packages: %s" % ' '.join(pkgs))
-        if attempt_only and len(pkgs) == 0:
+        if not pkgs:
+            bb.note("There are no packages to install")
             return
+        bb.note("Installing the following packages: %s" % ' '.join(pkgs))
         pkgs = self._pkg_translate_oe_to_smart(pkgs, attempt_only)
 
         if not attempt_only:
diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index f8cc6eb..0bfc217 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -235,7 +235,7 @@ class Rootfs(object):
                 installed_pkgs_dir = self.d.expand('${WORKDIR}/installed_pkgs.txt')
                 pkgs_to_remove = list()
                 with open(installed_pkgs_dir, "r+") as installed_pkgs:
-                    pkgs_installed = installed_pkgs.read().split('\n')
+                    pkgs_installed = installed_pkgs.read().splitlines()
                     for pkg_installed in pkgs_installed[:]:
                         pkg = pkg_installed.split()[0]
                         if pkg in ["update-rc.d",
-- 
2.5.0



  parent reply	other threads:[~2015-08-26 21:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-26 21:57 [PATCH 0/3] Empty-image functionality Alex Franco
2015-08-26 21:57 ` [PATCH 1/3] Empty image: core-image-empty recipe, Rootfs fix Alex Franco
2015-08-29 11:18   ` Paul Eggleton
2015-09-08 23:20     ` Alex Franco
2015-08-26 21:57 ` Alex Franco [this message]
2015-08-26 21:57 ` [PATCH 3/3] Empty image: filesystem allocation Alex Franco
2015-09-11 17:26   ` Benjamin Esquivel
2015-09-11 22:32     ` Richard Purdie
2015-08-28 18:23 ` [PATCH 0/3] Empty-image functionality Aníbal Limón

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=1440626255-29614-3-git-send-email-alejandro.franco@linux.intel.com \
    --to=alejandro.franco@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=paul.eggleton@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox