aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/recipeutils.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-07-06 10:58:46 +1200
committerPaul Eggleton <paul.eggleton@linux.intel.com>2016-07-14 09:01:21 +1200
commit62416e0d1f60d5489becbece2e645ad431e07147 (patch)
tree79e678a879502ad1997b768d717eff1bbf26ab01 /meta/lib/oe/recipeutils.py
parentabe525e5f04f9b0454836ddbed95b10a7d1e202f (diff)
downloadopenembedded-core-contrib-62416e0d1f60d5489becbece2e645ad431e07147.tar.gz
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>
Diffstat (limited to 'meta/lib/oe/recipeutils.py')
-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