Openembedded Bitbake Development
 help / color / mirror / Atom feed
* [PATCH 0/1][PULL] bitbake: retain order for __depends and __base_depends variables
@ 2012-04-18  5:46 Dongxiao Xu
  2012-04-18  5:46 ` [PATCH 1/1] bitbake: Retain order for __depends and __base_depends Dongxiao Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Dongxiao Xu @ 2012-04-18  5:46 UTC (permalink / raw)
  To: bitbake-devel

Hi Richard,

This is the revised version for retaining order for __depends and __base_depends variables,
please help to review and pull.

Thanks,
Dongxiao

The following changes since commit 1a39698ab8498410d159c665c015f9297f153797:

  lib/bb/ui/crumbs/recipeselectionpage: fix type availabel->available (2012-04-17 16:41:30 +0100)

are available in the git repository at:
  git://git.pokylinux.org/poky-contrib dxu4/hob-bugfix
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=dxu4/hob-bugfix

Dongxiao Xu (1):
  bitbake: Retain order for __depends and __base_depends

 lib/bb/cache.py          |   15 +++++++++++----
 lib/bb/cooker.py         |    4 ++--
 lib/bb/parse/__init__.py |    8 ++++----
 3 files changed, 17 insertions(+), 10 deletions(-)

-- 
1.7.4.1




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

* [PATCH 1/1] bitbake: Retain order for __depends and __base_depends
  2012-04-18  5:46 [PATCH 0/1][PULL] bitbake: retain order for __depends and __base_depends variables Dongxiao Xu
@ 2012-04-18  5:46 ` Dongxiao Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Dongxiao Xu @ 2012-04-18  5:46 UTC (permalink / raw)
  To: bitbake-devel

Bitbake take seriously with variables order, therefore when setting
values to __depends and __base_depends, we need to retain its order.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 lib/bb/cache.py          |   15 +++++++++++----
 lib/bb/cooker.py         |    4 ++--
 lib/bb/parse/__init__.py |    8 ++++----
 3 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/lib/bb/cache.py b/lib/bb/cache.py
index 47e814b..27d9be8 100644
--- a/lib/bb/cache.py
+++ b/lib/bb/cache.py
@@ -391,14 +391,21 @@ class Cache(object):
         """Parse the specified filename, returning the recipe information"""
         infos = []
         datastores = cls.load_bbfile(filename, appends, configdata)
-        depends = set()
+        depdict = {}
         for variant, data in sorted(datastores.iteritems(),
                                     key=lambda i: i[0],
                                     reverse=True):
             virtualfn = cls.realfn2virtual(filename, variant)
-            depends |= (data.getVar("__depends", False) or set())
-            if depends and not variant:
+            if not variant:
+                base = data.getVar("__depends", False) or []
+                depends = base[:]
+                for var in depdict.values():
+                    for item in var:
+                        if item not in base:
+                            depends.append(item)
                 data.setVar("__depends", depends)
+            else:
+                depdict[variant] = data.getVar("__depends", False) or []
 
             info_array = []
             for cache_class in caches_array:
@@ -497,7 +504,7 @@ class Cache(object):
         # Check dependencies are still valid
         depends = info_array[0].file_depends
         if depends:
-            for f, old_mtime in depends:
+            for f, old_mtime in set(depends):
                 fmtime = bb.parse.cached_mtime_noerror(f)
                 # Check if file still exists
                 if old_mtime != 0 and fmtime == 0:
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index dea0aad..8c2b35d 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -680,8 +680,8 @@ class BBCooker:
         # Generate a list of parsed configuration files by searching the files
         # listed in the __depends and __base_depends variables with a .conf suffix.
         conffiles = []
-        dep_files = self.configuration.data.getVar('__depends') or set()
-        dep_files.union(self.configuration.data.getVar('__base_depends') or set())
+        dep_files = self.configuration.data.getVar('__base_depends') or []
+        dep_files += (self.configuration.data.getVar('__depends') or [])
 
         for f in dep_files:
             if f[0].endswith(".conf"):
diff --git a/lib/bb/parse/__init__.py b/lib/bb/parse/__init__.py
index 7b9c47e..30f6254 100644
--- a/lib/bb/parse/__init__.py
+++ b/lib/bb/parse/__init__.py
@@ -73,8 +73,8 @@ def update_mtime(f):
 def mark_dependency(d, f):
     if f.startswith('./'):
         f = "%s/%s" % (os.getcwd(), f[2:])
-    deps = d.getVar('__depends') or set()
-    deps.update([(f, cached_mtime(f))])
+    deps = d.getVar('__depends') or []
+    deps.append((f, cached_mtime(f)))
     d.setVar('__depends', deps)
 
 def supports(fn, data):
@@ -134,8 +134,8 @@ def vars_from_file(mypkg, d):
 def get_file_depends(d):
     '''Return the dependent files'''
     dep_files = []
-    depends = d.getVar('__depends', True) or set()
-    depends = depends.union(d.getVar('__base_depends', True) or set())
+    base_depends = d.getVar('__base_depends', True) or []
+    depends = base_depends + (d.getVar('__depends', True) or [])
     for (fn, _) in depends:
         dep_files.append(os.path.abspath(fn))
     return " ".join(dep_files)
-- 
1.7.4.1




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

end of thread, other threads:[~2012-04-18  5:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-18  5:46 [PATCH 0/1][PULL] bitbake: retain order for __depends and __base_depends variables Dongxiao Xu
2012-04-18  5:46 ` [PATCH 1/1] bitbake: Retain order for __depends and __base_depends Dongxiao Xu

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