[bitbake-devel] [PATCH] lib/bb/utils.py: Fix explode_dep_versions2() determinism issue
Richard Purdie
richard.purdie at linuxfoundation.org
Mon May 9 13:07:17 UTC 2016
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 at linuxfoundation.org>
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
index 3544bbe..bf4ac40 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -34,6 +34,7 @@ import traceback
import errno
import signal
import ast
+import collections
from commands import getstatusoutput
from contextlib import contextmanager
from ctypes import cdll
@@ -188,7 +189,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 = ""
More information about the bitbake-devel
mailing list