summaryrefslogtreecommitdiffstats
path: root/meta
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:28:49 +0100
commit7435cdf750abc8cba2a6cebc7c78df6d46ae7ca3 (patch)
tree070aeef6c9a37af5892e4b73c281d64a97ca5a39 /meta
parentc4297f3e2220ec71f1745a70c603541c6a24ee76 (diff)
downloadpoky-7435cdf750abc8cba2a6cebc7c78df6d46ae7ca3.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 (From OE-Core rev: 912026d85c2f535be2f60c45979162ea25c7f356) 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')
-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,
728 728
729 729
730def find_layerdir(fn): 730def find_layerdir(fn):
731 """ Figure out relative path to base of layer for a file (e.g. a recipe)""" 731 """ Figure out the path to the base of the layer containing a file (e.g. a recipe)"""
732 pth = os.path.dirname(fn) 732 pth = fn
733 layerdir = '' 733 layerdir = ''
734 while pth: 734 while pth:
735 if os.path.exists(os.path.join(pth, 'conf', 'layer.conf')): 735 if os.path.exists(os.path.join(pth, 'conf', 'layer.conf')):
736 layerdir = pth 736 layerdir = pth
737 break 737 break
738 pth = os.path.dirname(pth) 738 pth = os.path.dirname(pth)
739 if pth == '/':
740 return None
739 return layerdir 741 return layerdir
740 742
741 743