]> code.ossystems Code Review - openembedded-core.git/commitdiff
lib/oe/recipeutils: Ensure order of data store doesn't influence the result
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 10 Jul 2015 13:11:16 +0000 (14:11 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 12 Jul 2015 21:53:18 +0000 (22:53 +0100)
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.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oe/recipeutils.py

index d8094c876901c6168f7e0895bf740f3f0f9d0367..ccec2a14447b6f3afa81a3fe673ff18151cdcd88 100644 (file)
@@ -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])