Openembedded Bitbake Development
 help / color / mirror / Atom feed
* [PATCH 0/4] Bug fixing and code clarity
@ 2011-08-11  1:19 Joshua Lock
  2011-08-11  1:19 ` [PATCH 1/4] bb/ui/crumbs/tasklistmodel: fix some typos and add comments to mark() Joshua Lock
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Joshua Lock @ 2011-08-11  1:19 UTC (permalink / raw)
  To: bitbake-devel

The following series addresses some thinko/typo's I'd introduced to hob, by
using variable names which are too similar, as well as adding some changes
to increase clarity in various places.

Regards,

Joshua

The following changes since commit 705d14d1e1108e0544c7eab827f1242f0839add9:

  bb/cooker: only emit ConfigFilePathFound for files which were parsed (2011-08-10 13:38:11 +0100)

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

Joshua Lock (4):
  bb/ui/crumbs/tasklistmodel: fix some typos and add comments to mark()
  bb/ui/crumbs/tasklistmodel: correctly uniquify dependency list
  bb/ui/crumbs/tasklistmodel: don't include an item in its own depends
  bb/cache: rename confusing variable

 lib/bb/cache.py                   |    6 +++---
 lib/bb/ui/crumbs/tasklistmodel.py |   28 ++++++++++++++++++++--------
 2 files changed, 23 insertions(+), 11 deletions(-)

-- 
1.7.6




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

* [PATCH 1/4] bb/ui/crumbs/tasklistmodel: fix some typos and add comments to mark()
  2011-08-11  1:19 [PATCH 0/4] Bug fixing and code clarity Joshua Lock
@ 2011-08-11  1:19 ` Joshua Lock
  2011-08-11  1:19 ` [PATCH 2/4] bb/ui/crumbs/tasklistmodel: correctly uniquify dependency list Joshua Lock
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Joshua Lock @ 2011-08-11  1:19 UTC (permalink / raw)
  To: bitbake-devel

Two similarly named variables in the mark() method resulted in the wrong
variable being used in a couple of places. This patch adresses this in
several ways:
1) Renames the variables to be less similar
2) Uses the correct variables
3) Adds some coments to document the methods intent

Partially addresses [YOCTO #1355]

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

diff --git a/lib/bb/ui/crumbs/tasklistmodel.py b/lib/bb/ui/crumbs/tasklistmodel.py
index 3e09757..96814c2 100644
--- a/lib/bb/ui/crumbs/tasklistmodel.py
+++ b/lib/bb/ui/crumbs/tasklistmodel.py
@@ -316,9 +316,13 @@ class TaskListModel(gtk.ListStore):
     def mark(self, opath):
         usersel = {}
         removed = []
+
         it = self.get_iter_first()
-        name = self[opath][self.COL_NAME]
+        # The name of the item we're removing, so that we can use it to find
+        # other items which either depend on it, or were brought in by it
+        marked_name = self[opath][self.COL_NAME]
 
+        # Remove the passed item
         self.remove_item_path(opath)
 
         # Remove all dependent packages, update binb
@@ -330,7 +334,7 @@ class TaskListModel(gtk.ListStore):
             deps = self[path][self.COL_DEPS]
             binb = self[path][self.COL_BINB]
             itype = self[path][self.COL_TYPE]
-            iname = self[path][self.COL_NAME]
+            itname = self[path][self.COL_NAME]
 
             # We ignore anything that isn't a package
             if not itype == "package":
@@ -341,16 +345,20 @@ class TaskListModel(gtk.ListStore):
             # is to save its name and re-mark it for inclusion once dependency
             # processing is complete
             if binb == "User Selected":
-                usersel[iname] = self[path][self.COL_IMG]
+                usersel[itname] = self[path][self.COL_IMG]
 
+            # If the iterated item is included and depends on the removed
+            # item it should also be removed.
             # FIXME: need to ensure partial name matching doesn't happen
-            if inc and deps.count(name) and name not in removed:
+            if inc and deps.count(marked_name) and itname not in removed:
                 # found a dependency, remove it
-                removed.append(name)
+                removed.append(itname)
                 self.mark(path)
 
-            if inc and binb.count(name):
-                bib = self.find_alt_dependency(name)
+            # If the iterated item was brought in by the removed (passed) item
+            # try and find an alternative dependee and update the binb column
+            if inc and binb.count(marked_name):
+                bib = self.find_alt_dependency(itname)
                 self[path][self.COL_BINB] = bib
 
         # Re-add any removed user selected items
-- 
1.7.6




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

* [PATCH 2/4] bb/ui/crumbs/tasklistmodel: correctly uniquify dependency list
  2011-08-11  1:19 [PATCH 0/4] Bug fixing and code clarity Joshua Lock
  2011-08-11  1:19 ` [PATCH 1/4] bb/ui/crumbs/tasklistmodel: fix some typos and add comments to mark() Joshua Lock
@ 2011-08-11  1:19 ` Joshua Lock
  2011-08-11  1:19 ` [PATCH 3/4] bb/ui/crumbs/tasklistmodel: don't include an item in its own depends Joshua Lock
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Joshua Lock @ 2011-08-11  1:19 UTC (permalink / raw)
  To: bitbake-devel

Fix thinko - the squish method returns a uniquified list, it doesn't modify
the list in place. Therefore the call to squish() was useless as its return
value was never assigned.

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

diff --git a/lib/bb/ui/crumbs/tasklistmodel.py b/lib/bb/ui/crumbs/tasklistmodel.py
index 96814c2..aec80e2 100644
--- a/lib/bb/ui/crumbs/tasklistmodel.py
+++ b/lib/bb/ui/crumbs/tasklistmodel.py
@@ -235,7 +235,8 @@ class TaskListModel(gtk.ListStore):
                         if pn:
                             depends.append(pn)
 
-            self.squish(depends)
+            # uniquify the list of depends
+            depends = self.squish(depends)
             deps = " ".join(depends)
 
             if name.count('task-') > 0:
-- 
1.7.6




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

* [PATCH 3/4] bb/ui/crumbs/tasklistmodel: don't include an item in its own depends
  2011-08-11  1:19 [PATCH 0/4] Bug fixing and code clarity Joshua Lock
  2011-08-11  1:19 ` [PATCH 1/4] bb/ui/crumbs/tasklistmodel: fix some typos and add comments to mark() Joshua Lock
  2011-08-11  1:19 ` [PATCH 2/4] bb/ui/crumbs/tasklistmodel: correctly uniquify dependency list Joshua Lock
@ 2011-08-11  1:19 ` Joshua Lock
  2011-08-11  1:19 ` [PATCH 4/4] bb/cache: rename confusing variable Joshua Lock
  2011-08-11 22:58 ` [PATCH 0/4] Bug fixing and code clarity Joshua Lock
  4 siblings, 0 replies; 8+ messages in thread
From: Joshua Lock @ 2011-08-11  1:19 UTC (permalink / raw)
  To: bitbake-devel

This causes the simple removal algorithm to perform needless circular logic

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

diff --git a/lib/bb/ui/crumbs/tasklistmodel.py b/lib/bb/ui/crumbs/tasklistmodel.py
index aec80e2..7a463a6 100644
--- a/lib/bb/ui/crumbs/tasklistmodel.py
+++ b/lib/bb/ui/crumbs/tasklistmodel.py
@@ -237,6 +237,9 @@ class TaskListModel(gtk.ListStore):
 
             # uniquify the list of depends
             depends = self.squish(depends)
+            # remove circular dependencies
+            if name in depends:
+                depends.remove(name)
             deps = " ".join(depends)
 
             if name.count('task-') > 0:
-- 
1.7.6




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

* [PATCH 4/4] bb/cache: rename confusing variable
  2011-08-11  1:19 [PATCH 0/4] Bug fixing and code clarity Joshua Lock
                   ` (2 preceding siblings ...)
  2011-08-11  1:19 ` [PATCH 3/4] bb/ui/crumbs/tasklistmodel: don't include an item in its own depends Joshua Lock
@ 2011-08-11  1:19 ` Joshua Lock
  2011-08-11 22:58 ` [PATCH 0/4] Bug fixing and code clarity Joshua Lock
  4 siblings, 0 replies; 8+ messages in thread
From: Joshua Lock @ 2011-08-11  1:19 UTC (permalink / raw)
  To: bitbake-devel

The bNeedUpdate variable doesn't reflect its purpose, and doesn't match
coding style (type encoded in variable name, camel case) - rename to
cache_ok.

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

diff --git a/lib/bb/cache.py b/lib/bb/cache.py
index d805d46..d495f9e 100644
--- a/lib/bb/cache.py
+++ b/lib/bb/cache.py
@@ -286,14 +286,14 @@ class Cache(object):
         old_mtimes.append(newest_mtime)
         newest_mtime = max(old_mtimes)
 
-        bNeedUpdate = True
+        cache_ok = True
         if self.caches_array:
             for cache_class in self.caches_array:
                 if type(cache_class) is type and issubclass(cache_class, RecipeInfoCommon):
                     cachefile = getCacheFile(self.cachedir, cache_class.cachefile)
-                    bNeedUpdate = bNeedUpdate and (bb.parse.cached_mtime_noerror(cachefile) >= newest_mtime)
+                    cache_ok = cache_ok and (bb.parse.cached_mtime_noerror(cachefile) >= newest_mtime)
                     cache_class.init_cacheData(self)
-        if bNeedUpdate:
+        if cache_ok:
             self.load_cachefile()
         elif os.path.isfile(self.cachefile):
             logger.info("Out of date cache found, rebuilding...")
-- 
1.7.6




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

* Re: [PATCH 0/4] Bug fixing and code clarity
  2011-08-11  1:19 [PATCH 0/4] Bug fixing and code clarity Joshua Lock
                   ` (3 preceding siblings ...)
  2011-08-11  1:19 ` [PATCH 4/4] bb/cache: rename confusing variable Joshua Lock
@ 2011-08-11 22:58 ` Joshua Lock
  2011-08-11 23:41   ` Richard Purdie
  4 siblings, 1 reply; 8+ messages in thread
From: Joshua Lock @ 2011-08-11 22:58 UTC (permalink / raw)
  To: bitbake-devel

On Wed, 2011-08-10 at 18:19 -0700, Joshua Lock wrote:
> The following series addresses some thinko/typo's I'd introduced to hob, by
> using variable names which are too similar, as well as adding some changes
> to increase clarity in various places.

This series rolled into a new series submitted just now, please ignore
this series.

Joshua
-- 
Joshua Lock
        Yocto Project "Johannes Factotum"
        Intel Open Source Technology Centre




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

* Re: [PATCH 0/4] Bug fixing and code clarity
  2011-08-11 22:58 ` [PATCH 0/4] Bug fixing and code clarity Joshua Lock
@ 2011-08-11 23:41   ` Richard Purdie
  2011-08-12  3:01     ` Joshua Lock
  0 siblings, 1 reply; 8+ messages in thread
From: Richard Purdie @ 2011-08-11 23:41 UTC (permalink / raw)
  To: Joshua Lock; +Cc: bitbake-devel

On Thu, 2011-08-11 at 15:58 -0700, Joshua Lock wrote:
> On Wed, 2011-08-10 at 18:19 -0700, Joshua Lock wrote:
> > The following series addresses some thinko/typo's I'd introduced to hob, by
> > using variable names which are too similar, as well as adding some changes
> > to increase clarity in various places.
> 
> This series rolled into a new series submitted just now, please ignore
> this series.

I've actually already merged this series. Was there any change in the
newer version I should be looking for?

Cheers,

Richard




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

* Re: [PATCH 0/4] Bug fixing and code clarity
  2011-08-11 23:41   ` Richard Purdie
@ 2011-08-12  3:01     ` Joshua Lock
  0 siblings, 0 replies; 8+ messages in thread
From: Joshua Lock @ 2011-08-12  3:01 UTC (permalink / raw)
  To: Richard Purdie; +Cc: bitbake-devel

On Fri, 2011-08-12 at 00:41 +0100, Richard Purdie wrote:
> On Thu, 2011-08-11 at 15:58 -0700, Joshua Lock wrote:
> > On Wed, 2011-08-10 at 18:19 -0700, Joshua Lock wrote:
> > > The following series addresses some thinko/typo's I'd introduced to hob, by
> > > using variable names which are too similar, as well as adding some changes
> > > to increase clarity in various places.
> > 
> > This series rolled into a new series submitted just now, please ignore
> > this series.
> 
> I've actually already merged this series. Was there any change in the
> newer version I should be looking for?

None at all, I was just using the same branch to push the new changes so
included them in the new pull request.

Apologies for any confusion.

Joshua
-- 
Joshua Lock
        Yocto Project "Johannes factotum"
        Intel Open Source Technology Centre




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

end of thread, other threads:[~2011-08-12  3:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-11  1:19 [PATCH 0/4] Bug fixing and code clarity Joshua Lock
2011-08-11  1:19 ` [PATCH 1/4] bb/ui/crumbs/tasklistmodel: fix some typos and add comments to mark() Joshua Lock
2011-08-11  1:19 ` [PATCH 2/4] bb/ui/crumbs/tasklistmodel: correctly uniquify dependency list Joshua Lock
2011-08-11  1:19 ` [PATCH 3/4] bb/ui/crumbs/tasklistmodel: don't include an item in its own depends Joshua Lock
2011-08-11  1:19 ` [PATCH 4/4] bb/cache: rename confusing variable Joshua Lock
2011-08-11 22:58 ` [PATCH 0/4] Bug fixing and code clarity Joshua Lock
2011-08-11 23:41   ` Richard Purdie
2011-08-12  3:01     ` Joshua Lock

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox