diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2015-07-14 22:56:00 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-07-16 15:09:25 +0100 |
commit | 723411dd92931de01d4e3b08a79638097bc2214f (patch) | |
tree | 3c48d2c2ff08b275bf7d469b1463c27cc8ee3109 /meta/lib/oe/recipeutils.py | |
parent | 7e7e1239d544ff3297b46be8521ecad35d55c996 (diff) | |
download | poky-723411dd92931de01d4e3b08a79638097bc2214f.tar.gz |
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.
(From OE-Core rev: 95c54512c9fcdbaa419891e46fd99102722ba3d8)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/recipeutils.py')
-rw-r--r-- | meta/lib/oe/recipeutils.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py index bd812ccbd1..78d69267ac 100644 --- a/meta/lib/oe/recipeutils.py +++ b/meta/lib/oe/recipeutils.py | |||
@@ -617,7 +617,8 @@ def find_layerdir(fn): | |||
617 | def replace_dir_vars(path, d): | 617 | def replace_dir_vars(path, d): |
618 | """Replace common directory paths with appropriate variable references (e.g. /etc becomes ${sysconfdir})""" | 618 | """Replace common directory paths with appropriate variable references (e.g. /etc becomes ${sysconfdir})""" |
619 | dirvars = {} | 619 | dirvars = {} |
620 | for var in d: | 620 | # Sort by length so we get the variables we're interested in first |
621 | for var in sorted(d.keys(), key=len): | ||
621 | if var.endswith('dir') and var.lower() == var: | 622 | if var.endswith('dir') and var.lower() == var: |
622 | value = d.getVar(var, True) | 623 | value = d.getVar(var, True) |
623 | if value.startswith('/') and not '\n' in value and value not in dirvars: | 624 | if value.startswith('/') and not '\n' in value and value not in dirvars: |