Skip to contentSkip to conversation

lib/oe/recipeutils: Ensure order of data store doesn't influence the result

PATCH Richard Purdie 1 participant 1 message Jul 10, 2015

lore
Share & tools
lore
#0 lore raw

The order of the keys from the data store is not prescribed. If target_datadir comes before datadir the selftests fail since the 'wrong' variable is used for substitutions. This highlights an issue with the replace_dir_vars() function. Fix this.

meta/lib/oe/recipeutils.py +1 -1
index d8094c8..ccec2a1 100644
@@ -620,7 +620,7 @@ def replace_dir_vars(path, d):
     for var in d:
         if var.endswith('dir') and var.lower() == var:
             value = d.getVar(var, True)
-            if value.startswith('/') and not '\n' in value:
+            if value.startswith('/') and not '\n' in value and value not in dirvars:
                 dirvars[value] = var
     for dirpath in sorted(dirvars.keys(), reverse=True):
         path = path.replace(dirpath, '${%s}' % dirvars[dirpath])