]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
parse/cache/cooker: Preserve order in the file inclusion list
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 19 Nov 2012 15:01:20 +0000 (15:01 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 19 Nov 2012 15:45:49 +0000 (15:45 +0000)
The data returned by get_file_depends() may me used in contexts like
checksums where order is important. The current usage of sets means
that some of the checksums can change in circumstances they should not.

This patch changes to use lists, thereby removing the problem.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/cache.py
lib/bb/cooker.py
lib/bb/parse/__init__.py

index 619b9eec24dcad707ea6f0a12222872fcb5c48e6..a3c073a59fb3e5427d43f44a935fe94e90907497 100644 (file)
@@ -405,12 +405,12 @@ class Cache(object):
         """Parse the specified filename, returning the recipe information"""
         infos = []
         datastores = cls.load_bbfile(filename, appends, configdata)
-        depends = set()
+        depends = []
         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())
+            depends = depends + (data.getVar("__depends", False) or [])
             if depends and not variant:
                 data.setVar("__depends", depends)
 
index 5f88f1ff59a1482efd2518fed3abd71223a3ff33..6b58f91c6bde1b1f9c8e5ccd3ab55b4bbdab6823 100644 (file)
@@ -696,8 +696,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 = dep_files + (self.configuration.data.getVar('__depends') or [])
 
         for f in dep_files:
             if f[0].endswith(".conf"):
index 7b9c47e61699a5e709607d88ceb1f9f6c3a06811..4293d09c7aabed8da1edaa3bba79b924640cf155 100644 (file)
@@ -73,8 +73,7 @@ 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 []) + [(f, cached_mtime(f))]
     d.setVar('__depends', deps)
 
 def supports(fn, data):
@@ -134,8 +133,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())
+    depends = d.getVar('__base_depends', True) or []
+    depends = depends + (d.getVar('__depends', True) or [])
     for (fn, _) in depends:
         dep_files.append(os.path.abspath(fn))
     return " ".join(dep_files)