summaryrefslogtreecommitdiff
path: root/meta/lib
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-07-14 09:04:21 +1200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-07-20 10:24:53 +0100
commit912026d85c2f535be2f60c45979162ea25c7f356 (patch)
tree107f2f7ed3bc80906ac04ce0d2bfea400a2dc751 /meta/lib
parent9230bfcc839eb35630949f0a8ed058ca1fa944b1 (diff)
downloadopenembedded-core-912026d85c2f535be2f60c45979162ea25c7f356.tar.gz
openembedded-core-912026d85c2f535be2f60c45979162ea25c7f356.tar.bz2
openembedded-core-912026d85c2f535be2f60c45979162ea25c7f356.zip
lib/oe/recipeutils: fix a few issues in find_layerdir()
* Allow the function to be called with the base layer path (in which case it will just return the same path) * Ensure that the function doesn't recurse indefinitely if it's called on a file that's not inside a layer * Correct the doc comment for accuracy Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oe/recipeutils.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py
index e3c4b8a759..cb4ed53d0f 100644
--- a/meta/lib/oe/recipeutils.py
+++ b/meta/lib/oe/recipeutils.py
@@ -728,14 +728,16 @@ def bbappend_recipe(rd, destlayerdir, srcfiles, install=None, wildcardver=False,
def find_layerdir(fn):
- """ Figure out relative path to base of layer for a file (e.g. a recipe)"""
- pth = os.path.dirname(fn)
+ """ Figure out the path to the base of the layer containing a file (e.g. a recipe)"""
+ pth = fn
layerdir = ''
while pth:
if os.path.exists(os.path.join(pth, 'conf', 'layer.conf')):
layerdir = pth
break
pth = os.path.dirname(pth)
+ if pth == '/':
+ return None
return layerdir