Patchwork [bitbake-devel,10/10] Hob: fix IMAGE_INSTALL setting while save template

login
register
mail settings
Submitter Dongxiao Xu
Date April 1, 2012, 12:14 p.m.
Message ID <b921b683cd4b92ad0feb7aeeb02914dc891cb139.1333269705.git.dongxiao.xu@intel.com>
Download mbox | patch
Permalink /patch/25027/
State Accepted
Commit 6c970d07422bb9a8fcf339315587cfc9b207a44e
Headers show

Comments

Dongxiao Xu - April 1, 2012, 12:14 p.m.
If save every selected package into IMAGE_INSTALL field, and then build
the saved bb file by bitbake command line, it will report errors since
some packages could not be found since they are dynamically generated.
With this commit, Hob will only save those packages into the
IMAGE_INSTALL variable which are brought in by user.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 lib/bb/ui/crumbs/builder.py              |    4 +++-
 lib/bb/ui/crumbs/hoblistmodel.py         |   17 +++++++++++++++++
 lib/bb/ui/crumbs/packageselectionpage.py |    1 +
 3 files changed, 21 insertions(+), 1 deletions(-)

Patch

diff --git a/lib/bb/ui/crumbs/builder.py b/lib/bb/ui/crumbs/builder.py
index 20d4652..3ff6df7 100755
--- a/lib/bb/ui/crumbs/builder.py
+++ b/lib/bb/ui/crumbs/builder.py
@@ -68,6 +68,8 @@  class Configuration:
         self.selected_recipes = []
         self.selected_packages = []
 
+        self.user_selected_packages = []
+
         # proxy settings
         self.all_proxy = params["all_proxy"]
         self.http_proxy = params["http_proxy"]
@@ -157,7 +159,7 @@  class Configuration:
         self.selected_image = filename
         template.setVar("__SELECTED_IMAGE__", self.selected_image)
         template.setVar("DEPENDS", self.selected_recipes)
-        template.setVar("IMAGE_INSTALL", self.selected_packages)
+        template.setVar("IMAGE_INSTALL", self.user_selected_packages)
         # proxy
         template.setVar("all_proxy", self.all_proxy)
         template.setVar("http_proxy", self.http_proxy)
diff --git a/lib/bb/ui/crumbs/hoblistmodel.py b/lib/bb/ui/crumbs/hoblistmodel.py
index a351597..5dddffa 100644
--- a/lib/bb/ui/crumbs/hoblistmodel.py
+++ b/lib/bb/ui/crumbs/hoblistmodel.py
@@ -342,6 +342,23 @@  class PackageListModel(gtk.TreeStore):
         self.selection_change_notification()
         return left
 
+    def get_user_selected_packages(self):
+        packagelist = []
+
+        it = self.get_iter_first()
+        while it:
+            child_it = self.iter_children(it)
+            while child_it:
+                if self.get_value(child_it, self.COL_INC):
+                    binb = self.get_value(child_it, self.COL_BINB)
+                    if not binb or binb == "User Selected":
+                        name = self.get_value(child_it, self.COL_NAME)
+                        packagelist.append(name)
+                child_it = self.iter_next(child_it)
+            it = self.iter_next(it)
+
+        return packagelist
+
     def get_selected_packages(self):
         packagelist = []
 
diff --git a/lib/bb/ui/crumbs/packageselectionpage.py b/lib/bb/ui/crumbs/packageselectionpage.py
index e071b07..0a7474e 100755
--- a/lib/bb/ui/crumbs/packageselectionpage.py
+++ b/lib/bb/ui/crumbs/packageselectionpage.py
@@ -161,6 +161,7 @@  class PackageSelectionPage (HobPage):
         self._expand_all()
 
         self.builder.configuration.selected_packages = self.package_model.get_selected_packages()
+        self.builder.configuration.user_selected_packages = self.package_model.get_user_selected_packages()
         selected_packages_num = len(self.builder.configuration.selected_packages)
         selected_packages_size = float(self.package_model.get_packages_size())
         selected_packages_size_str = self._size_to_string(selected_packages_size)