All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Bug fixes for the hob GUI
@ 2011-07-12 21:48 Joshua Lock
  2011-07-12 21:48 ` [PATCH 1/3] ui/crumbs/tasklistmodel: update brought in by column when possible Joshua Lock
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Joshua Lock @ 2011-07-12 21:48 UTC (permalink / raw)
  To: bitbake-devel

The attached series contains three patches which fix Yocto bugs #1218 and
#1219. More detail in the commit headers.

The following changes since commit 521909d1350a415d19516aa1710041e30950c7cc:

  bitbake cooker/ui: handle cmd line parsing result by individual UI. (2011-07-08 17:38:06 +0100)

are available in the git repository at:
  git://github.com/incandescant/bitbake hob
  https://github.com/incandescant/bitbake/tree/hob

Joshua Lock (3):
  ui/crumbs/tasklistmodel: update brought in by column when possible
  ui/crumbs/tasklistmodel: fix automatic removal of orphaned items
  cooker: only return *Found events if something was actually found

 lib/bb/cooker.py                  |   12 ++++++---
 lib/bb/ui/crumbs/tasklistmodel.py |   48 ++++++++++++++++++++++--------------
 2 files changed, 37 insertions(+), 23 deletions(-)

-- 
1.7.6




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

* [PATCH 1/3] ui/crumbs/tasklistmodel: update brought in by column when possible
  2011-07-12 21:48 [PATCH 0/3] Bug fixes for the hob GUI Joshua Lock
@ 2011-07-12 21:48 ` Joshua Lock
  2011-07-12 21:48 ` [PATCH 2/3] ui/crumbs/tasklistmodel: fix automatic removal of orphaned items Joshua Lock
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Joshua Lock @ 2011-07-12 21:48 UTC (permalink / raw)
  To: bitbake-devel

When a package is orphaned we were not correctly updating the brought-in-by
column if a later package additon would have brought that package in as a
dependency. This patch ensures that orphan packages are correctly re-parented
when appropriate.

Partially addresses [YOCTO #1218]

Signed-off-by: Joshua Lock <josh@linux.intel.com>
---
 lib/bb/ui/crumbs/tasklistmodel.py |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/lib/bb/ui/crumbs/tasklistmodel.py b/lib/bb/ui/crumbs/tasklistmodel.py
index 5e979b7..3e74e7f 100644
--- a/lib/bb/ui/crumbs/tasklistmodel.py
+++ b/lib/bb/ui/crumbs/tasklistmodel.py
@@ -390,8 +390,9 @@ class TaskListModel(gtk.ListStore):
         if not cur_inc:
             self[item_path][self.COL_INC] = True
             self[item_path][self.COL_BINB] = binb
-        # We want to do some magic with things which are brought in by the base
-        # image so tag them as so
+
+        # We want to do some magic with things which are brought in by the
+        # base image so tag them as so
         if image_contents:
             self[item_path][self.COL_IMG] = True
             if self[item_path][self.COL_TYPE] == 'image':
@@ -403,12 +404,17 @@ class TaskListModel(gtk.ListStore):
                 # If the contents model doesn't already contain dep, add it
                 # We only care to show things which will end up in the
                 # resultant image, so filter cross and native recipes
-                if not self.contents_includes_name(dep) and not dep.endswith("-native") and not dep.endswith("-cross"):
-                    path = self.find_path_for_item(dep)
+                dep_included = self.contents_includes_name(dep)
+                path = self.find_path_for_item(dep)
+                if not dep_included and not dep.endswith("-native") and not dep.endswith("-cross"):
                     if path:
                         self.include_item(path, name, image_contents)
                     else:
                         pass
+                # Set brought in by for any no longer orphan packages
+                elif dep_included and path:
+                    if not self[path][self.COL_BINB]:
+                        self[path][self.COL_BINB] = name
 
     """
     Find the model path for the item_name
-- 
1.7.6




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

* [PATCH 2/3] ui/crumbs/tasklistmodel: fix automatic removal of orphaned items
  2011-07-12 21:48 [PATCH 0/3] Bug fixes for the hob GUI Joshua Lock
  2011-07-12 21:48 ` [PATCH 1/3] ui/crumbs/tasklistmodel: update brought in by column when possible Joshua Lock
@ 2011-07-12 21:48 ` Joshua Lock
  2011-07-12 21:49 ` [PATCH 3/3] cooker: only return *Found events if something was actually found Joshua Lock
  2011-07-13 11:28 ` [PATCH 0/3] Bug fixes for the hob GUI Richard Purdie
  3 siblings, 0 replies; 6+ messages in thread
From: Joshua Lock @ 2011-07-12 21:48 UTC (permalink / raw)
  To: bitbake-devel

The sweep_up() method intends to remove all packages with an empty brought in
by column, this patch changes the implementation to be more reliable.

Each time a removal is triggered we begin interating the contents model again
at the beginning, only once the contents model has been iterated from start
to finish without any removals can we be certain that there will be no more
orphaned items.

Fixes [YOCTO #1218]

Signed-off-by: Joshua Lock <josh@linux.intel.com>
---
 lib/bb/ui/crumbs/tasklistmodel.py |   34 +++++++++++++++++++---------------
 1 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/lib/bb/ui/crumbs/tasklistmodel.py b/lib/bb/ui/crumbs/tasklistmodel.py
index 3e74e7f..633931d 100644
--- a/lib/bb/ui/crumbs/tasklistmodel.py
+++ b/lib/bb/ui/crumbs/tasklistmodel.py
@@ -327,24 +327,28 @@ class TaskListModel(gtk.ListStore):
     If the item isn't a package we leave it included.
     """
     def sweep_up(self):
-        model = self.contents
-        removals = []
         it = self.contents.get_iter_first()
-
-	while it:
-            binb = model.get_value(it, self.COL_BINB)
-            itype = model.get_value(it, self.COL_TYPE)
+        while it:
+            binb = self.contents.get_value(it, self.COL_BINB)
+            itype = self.contents.get_value(it, self.COL_TYPE)
+            remove = False
 
             if itype == 'package' and not binb:
-                opath = model.convert_path_to_child_path(model.get_path(it))
-                if not opath in removals:
-                    removals.extend(opath)
-
-            it = model.iter_next(it)
-
-	while removals:
-	    path = removals.pop()
-	    self.mark(path)
+                oit = self.contents.convert_iter_to_child_iter(it)
+                opath = self.get_path(oit)
+                self.mark(opath)
+                remove = True
+
+            # When we remove a package from the contents model we alter the
+            # model, so continuing to iterate is bad. *Furthermore* it's
+            # likely that the removal has affected an already iterated item
+            # so we should start from the beginning anyway.
+            # Only when we've managed to iterate the entire contents model
+            # without removing any items do we allow the loop to exit.
+            if remove:
+                it = self.contents.get_iter_first()
+            else:
+                it = self.contents.iter_next(it)
 
     """
     Find the name of an item in the image contents which depends on the item
-- 
1.7.6




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

* [PATCH 3/3] cooker: only return *Found events if something was actually found
  2011-07-12 21:48 [PATCH 0/3] Bug fixes for the hob GUI Joshua Lock
  2011-07-12 21:48 ` [PATCH 1/3] ui/crumbs/tasklistmodel: update brought in by column when possible Joshua Lock
  2011-07-12 21:48 ` [PATCH 2/3] ui/crumbs/tasklistmodel: fix automatic removal of orphaned items Joshua Lock
@ 2011-07-12 21:49 ` Joshua Lock
  2011-07-13 11:27   ` Richard Purdie
  2011-07-13 11:28 ` [PATCH 0/3] Bug fixes for the hob GUI Richard Purdie
  3 siblings, 1 reply; 6+ messages in thread
From: Joshua Lock @ 2011-07-12 21:49 UTC (permalink / raw)
  To: bitbake-devel

The cooker methods which fire FooBarFound style events should only fire the
event when an item was actually found, rather than each time the method
is called.

Fixes [YOCTO #1219]

Signed-off-by: Joshua Lock <josh@linux.intel.com>
---
 lib/bb/cooker.py |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index 7aa600f..8b6da1d 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -546,14 +546,15 @@ class BBCooker:
 
     def findConfigFilePath(self, configfile):
         path = self._findConfigFile(configfile)
-        bb.event.fire(bb.event.ConfigFilePathFound(path), self.configuration.data)
+        if path:
+            bb.event.fire(bb.event.ConfigFilePathFound(path), self.configuration.data)
 
     def findFilesMatchingInDir(self, filepattern, directory):
         """
         Searches for files matching the regex 'pattern' which are children of
         'directory' in each BBPATH. i.e. to find all rootfs package classes available
         to BitBake one could call findFilesMatchingInDir(self, 'rootfs_', 'classes')
-        or to find all machine configuration files on could call
+        or to find all machine configuration files one could call:
         findFilesMatchingInDir(self, 'conf/machines', 'conf')
         """
         import re
@@ -569,7 +570,8 @@ class BBCooker:
                         if p.search(f):
                             matches.append(f)
 
-        bb.event.fire(bb.event.FilesMatchingFound(filepattern, matches), self.configuration.data)
+        if len(matches):
+            bb.event.fire(bb.event.FilesMatchingFound(filepattern, matches), self.configuration.data)
 
     def findConfigFiles(self, varname):
         """
@@ -592,7 +594,8 @@ class BBCooker:
                         if end == 'conf':
                             possible.append(val)
 
-        bb.event.fire(bb.event.ConfigFilesFound(var, possible), self.configuration.data)
+        if len(possible):
+            bb.event.fire(bb.event.ConfigFilesFound(var, possible), self.configuration.data)
 
     def findInheritsClass(self, klass):
         """
@@ -667,6 +670,7 @@ class BBCooker:
                 return confpath
 
             path, _ = os.path.split(path)
+        return None
 
     def _findLayerConf(self):
         return self._findConfigFile("bblayers.conf")
-- 
1.7.6




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

* Re: [PATCH 3/3] cooker: only return *Found events if something was actually found
  2011-07-12 21:49 ` [PATCH 3/3] cooker: only return *Found events if something was actually found Joshua Lock
@ 2011-07-13 11:27   ` Richard Purdie
  0 siblings, 0 replies; 6+ messages in thread
From: Richard Purdie @ 2011-07-13 11:27 UTC (permalink / raw)
  To: Joshua Lock; +Cc: bitbake-devel

On Tue, 2011-07-12 at 14:49 -0700, Joshua Lock wrote:
> @@ -569,7 +570,8 @@ class BBCooker:
>                          if p.search(f):
>                              matches.append(f)
>  
> -        bb.event.fire(bb.event.FilesMatchingFound(filepattern, matches), self.configuration.data)
> +        if len(matches):
> +            bb.event.fire(bb.event.FilesMatchingFound(filepattern, matches), self.configuration.data)

I think this can just be "if matches:"

>      def findConfigFiles(self, varname):
>          """
> @@ -592,7 +594,8 @@ class BBCooker:
>                          if end == 'conf':
>                              possible.append(val)
>  
> -        bb.event.fire(bb.event.ConfigFilesFound(var, possible), self.configuration.data)
> +        if len(possible):
> +            bb.event.fire(bb.event.ConfigFilesFound(var, possible), self.configuration.data)
>  
>      def findInheritsClass(self, klass):
>          """

ditto.

Cheers,

Richard




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

* Re: [PATCH 0/3] Bug fixes for the hob GUI
  2011-07-12 21:48 [PATCH 0/3] Bug fixes for the hob GUI Joshua Lock
                   ` (2 preceding siblings ...)
  2011-07-12 21:49 ` [PATCH 3/3] cooker: only return *Found events if something was actually found Joshua Lock
@ 2011-07-13 11:28 ` Richard Purdie
  3 siblings, 0 replies; 6+ messages in thread
From: Richard Purdie @ 2011-07-13 11:28 UTC (permalink / raw)
  To: Joshua Lock; +Cc: bitbake-devel

On Tue, 2011-07-12 at 14:48 -0700, Joshua Lock wrote:
> The attached series contains three patches which fix Yocto bugs #1218 and
> #1219. More detail in the commit headers.
> 
> The following changes since commit 521909d1350a415d19516aa1710041e30950c7cc:
> 
>   bitbake cooker/ui: handle cmd line parsing result by individual UI. (2011-07-08 17:38:06 +0100)
> 
> are available in the git repository at:
>   git://github.com/incandescant/bitbake hob
>   https://github.com/incandescant/bitbake/tree/hob
> 
> Joshua Lock (3):
>   ui/crumbs/tasklistmodel: update brought in by column when possible
>   ui/crumbs/tasklistmodel: fix automatic removal of orphaned items

These have merged to master, thanks.

>   cooker: only return *Found events if something was actually found

and this one will be fine with a tweak :)

Cheers,

Richard




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

end of thread, other threads:[~2011-07-13 11:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-12 21:48 [PATCH 0/3] Bug fixes for the hob GUI Joshua Lock
2011-07-12 21:48 ` [PATCH 1/3] ui/crumbs/tasklistmodel: update brought in by column when possible Joshua Lock
2011-07-12 21:48 ` [PATCH 2/3] ui/crumbs/tasklistmodel: fix automatic removal of orphaned items Joshua Lock
2011-07-12 21:49 ` [PATCH 3/3] cooker: only return *Found events if something was actually found Joshua Lock
2011-07-13 11:27   ` Richard Purdie
2011-07-13 11:28 ` [PATCH 0/3] Bug fixes for the hob GUI Richard Purdie

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.