[oe-commits] Jian Liu : sdk.py: fix conflicts of packages

git at git.openembedded.org git at git.openembedded.org
Fri Sep 4 15:37:07 UTC 2015


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

Author: Jian Liu <jian.liu at windriver.com>
Date:   Tue Aug 25 16:29:01 2015 +0800

sdk.py: fix conflicts of packages

If packages are conveyed to smart to install at the same time,
conflicts will not happen.
Try to install packages into sdk image at the same time.

This patch is not so perfect. For example,
  IMAGE_INSTALL += "lib32-ncurses"
  IMAGE_INSTALL += "ncurses-dev"
 ncurses-dev and lib32-ncurses-dev will have conflicts during packages installation.

Signed-off-by: Jian Liu <jian.liu at windriver.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/lib/oe/sdk.py | 45 +++++++++++++++++++++++++++++++++------------
 1 file changed, 33 insertions(+), 12 deletions(-)

diff --git a/meta/lib/oe/sdk.py b/meta/lib/oe/sdk.py
index a676741..53da0f0 100644
--- a/meta/lib/oe/sdk.py
+++ b/meta/lib/oe/sdk.py
@@ -107,10 +107,17 @@ class RpmSdk(Sdk):
         pm.dump_all_available_pkgs()
         pm.update()
 
-        for pkg_type in self.install_order:
-            if pkg_type in pkgs_to_install:
-                pm.install(pkgs_to_install[pkg_type],
-                           [False, True][pkg_type == Manifest.PKG_TYPE_ATTEMPT_ONLY])
+        pkgs = []
+        pkgs_attempt = []
+        for pkg_type in pkgs_to_install:
+            if pkg_type == Manifest.PKG_TYPE_ATTEMPT_ONLY:
+                pkgs_attempt += pkgs_to_install[pkg_type]
+            else:
+                pkgs += pkgs_to_install[pkg_type]
+
+        pm.install(pkgs)
+
+        pm.install(pkgs_attempt, True)
 
     def _populate(self):
         bb.note("Installing TARGET packages")
@@ -184,10 +191,17 @@ class OpkgSdk(Sdk):
 
         pm.update()
 
-        for pkg_type in self.install_order:
-            if pkg_type in pkgs_to_install:
-                pm.install(pkgs_to_install[pkg_type],
-                           [False, True][pkg_type == Manifest.PKG_TYPE_ATTEMPT_ONLY])
+        pkgs = []
+        pkgs_attempt = []
+        for pkg_type in pkgs_to_install:
+            if pkg_type == Manifest.PKG_TYPE_ATTEMPT_ONLY:
+                pkgs_attempt += pkgs_to_install[pkg_type]
+            else:
+                pkgs += pkgs_to_install[pkg_type]
+
+        pm.install(pkgs)
+
+        pm.install(pkgs_attempt, True)
 
     def _populate(self):
         bb.note("Installing TARGET packages")
@@ -260,10 +274,17 @@ class DpkgSdk(Sdk):
         pm.write_index()
         pm.update()
 
-        for pkg_type in self.install_order:
-            if pkg_type in pkgs_to_install:
-                pm.install(pkgs_to_install[pkg_type],
-                           [False, True][pkg_type == Manifest.PKG_TYPE_ATTEMPT_ONLY])
+        pkgs = []
+        pkgs_attempt = []
+        for pkg_type in pkgs_to_install:
+            if pkg_type == Manifest.PKG_TYPE_ATTEMPT_ONLY:
+                pkgs_attempt += pkgs_to_install[pkg_type]
+            else:
+                pkgs += pkgs_to_install[pkg_type]
+
+        pm.install(pkgs)
+
+        pm.install(pkgs_attempt, True)
 
     def _populate(self):
         bb.note("Installing TARGET packages")



More information about the Openembedded-commits mailing list