]> code.ossystems Code Review - openembedded-core.git/commitdiff
Empty image: package list splitting and iteration
authorAlex Franco <alejandro.franco@linux.intel.com>
Wed, 26 Aug 2015 21:57:34 +0000 (16:57 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 29 Aug 2015 12:32:41 +0000 (13:32 +0100)
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>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/license.bbclass
meta/lib/oe/package_manager.py
meta/lib/oe/rootfs.py

index 32e172afc7d82b9465dea66959d5cd714a8640b2..c616a201213a0f131415c346711e082a6868561f 100644 (file)
@@ -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))
index 2ab1d78bca47d2a24e513133728459214634dfe1..ef917f15b2dba2b96232bbfe4f55346c93eeb74a 100644 (file)
@@ -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:
index 8c8244c4537e96b8bd75c39983fa4a9f07fc713b..c29843b054faa18ad806ce5f5c84922a2da57e44 100644 (file)
@@ -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",