mirror of
https://git.yoctoproject.org/poky
synced 2026-04-26 18:32:13 +02:00
lib/oe/recipeutils: Ensure order of data store doesn't influence the result
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. (From OE-Core rev: d47c496aa058f5b18d03a68bcd79e5c8607de34f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user