mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 12:29:55 +00:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
c4297f3e22
commit
7435cdf750
@@ -728,14 +728,16 @@ def bbappend_recipe(rd, destlayerdir, srcfiles, install=None, wildcardver=False,
|
|||||||
|
|
||||||
|
|
||||||
def find_layerdir(fn):
|
def find_layerdir(fn):
|
||||||
""" Figure out relative path to base of layer for a file (e.g. a recipe)"""
|
""" Figure out the path to the base of the layer containing a file (e.g. a recipe)"""
|
||||||
pth = os.path.dirname(fn)
|
pth = fn
|
||||||
layerdir = ''
|
layerdir = ''
|
||||||
while pth:
|
while pth:
|
||||||
if os.path.exists(os.path.join(pth, 'conf', 'layer.conf')):
|
if os.path.exists(os.path.join(pth, 'conf', 'layer.conf')):
|
||||||
layerdir = pth
|
layerdir = pth
|
||||||
break
|
break
|
||||||
pth = os.path.dirname(pth)
|
pth = os.path.dirname(pth)
|
||||||
|
if pth == '/':
|
||||||
|
return None
|
||||||
return layerdir
|
return layerdir
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user