]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
lib/bb/utils.py: Fix explode_dep_versions2() determinism issue
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 9 May 2016 13:07:17 +0000 (14:07 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 9 May 2016 16:32:13 +0000 (17:32 +0100)
When we pass data into explode_dep_versions2(), we need to result to be
able to be processed in a deterministic way so that we end up with
consistent hash values. This means we need an ordered structure rather
than an unordered one.

To do this, return an OrderedDict() rather than a dict().

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/utils.py

index 2abf518eceb05b499a305c3c6d5e4402d2e0ccbe..0c553dd765c8ec482ef1c38613178abb0135e8e1 100644 (file)
@@ -36,6 +36,7 @@ import traceback
 import errno
 import signal
 import ast
+import collections
 from commands import getstatusoutput
 from contextlib import contextmanager
 from ctypes import cdll
@@ -192,7 +193,7 @@ def explode_dep_versions2(s):
     "DEPEND1 (optional version) DEPEND2 (optional version) ..."
     and return a dictionary of dependencies and versions.
     """
-    r = {}
+    r = collections.OrderedDict()
     l = s.replace(",", "").split()
     lastdep = None
     lastcmp = ""