Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/1] Fix for recipetool appendfile
@ 2015-07-14 21:55 Paul Eggleton
  2015-07-14 21:56 ` [PATCH 1/1] lib/oe/recipeutils: fix replace_dir_vars to return the correct variables Paul Eggleton
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Eggleton @ 2015-07-14 21:55 UTC (permalink / raw)
  To: openembedded-core

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(-)

-- 
2.1.0



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 1/1] lib/oe/recipeutils: fix replace_dir_vars to return the correct variables
  2015-07-14 21:55 [PATCH 0/1] Fix for recipetool appendfile Paul Eggleton
@ 2015-07-14 21:56 ` Paul Eggleton
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Eggleton @ 2015-07-14 21:56 UTC (permalink / raw)
  To: openembedded-core

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.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 meta/lib/oe/recipeutils.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py
index bd812cc..78d6926 100644
--- a/meta/lib/oe/recipeutils.py
+++ b/meta/lib/oe/recipeutils.py
@@ -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:
-- 
2.1.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-07-14 21:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-14 21:55 [PATCH 0/1] Fix for recipetool appendfile Paul Eggleton
2015-07-14 21:56 ` [PATCH 1/1] lib/oe/recipeutils: fix replace_dir_vars to return the correct variables Paul Eggleton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox