Skip to contentSkip to conversation

Fix for recipetool appendfile

PATCH New Paul Eggleton 1 participant 2 messages Jul 14, 2015

lore
Share & tools
lore
#0 lore raw

cover Fix for recipetool appendfile

The following changes since commit 6be698b7270f73f40d38713ecf13f12aec0ced61:

dpkg: Fix for Fedora22 and new versions of tar (2015-07-13 13:46:45 +0100)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib paule/recipetool-selftest-fix
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/recipetool-selftest-fix

Paul Eggleton (1):
lib/oe/recipeutils: fix replace_dir_vars to return the correct
variables

 meta/lib/oe/recipeutils.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Signature · 1 line
2.1.0
#1 lore raw

PATCH 1/1 lib/oe/recipeutils: fix replace_dir_vars to return the correct variables

If we sort by length of name here we get the variables we are interested in first. I've tested this with all of the variables we care about (the ones at the top of bitbake.conf) and it returns the right results.

This fixes the failures we've been seeing in the oe-selftest test_recipetool_appendfile_* tests.

---
 meta/lib/oe/recipeutils.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/lib/oe/recipeutils.py +2 -1
index bd812cc..78d6926 100644
@@ -617,7 +617,8 @@ def find_layerdir(fn):
 def replace_dir_vars(path, d):
     """Replace common directory paths with appropriate variable references (e.g. /etc becomes ${sysconfdir})"""
     dirvars = {}
-    for var in d:
+    # Sort by length so we get the variables we're interested in first
+    for var in sorted(d.keys(), key=len):
         if var.endswith('dir') and var.lower() == var:
             value = d.getVar(var, True)
             if value.startswith('/') and not '\n' in value and value not in dirvars:
Signature · 1 line
2.1.0