[oe-commits] [openembedded-core] 73/122: lib/oe/recipeutils: fix a few issues in find_layerdir()

git at git.openembedded.org git at git.openembedded.org
Tue Jul 19 14:06:53 UTC 2016


rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 3599db76ecf2239c87afc97f47d4aa06404e9340
Author: Paul Eggleton <paul.eggleton at linux.intel.com>
AuthorDate: Thu Jul 14 09:04:21 2016 +1200

    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 at linux.intel.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 meta/lib/oe/recipeutils.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py
index e3c4b8a..cb4ed53 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
 
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list