diff options
-rw-r--r-- | bitbake/lib/bb/utils.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index ad13d043312..4b48d20c8e3 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py @@ -1576,6 +1576,16 @@ def get_file_layer(filename, d, collection_res={}): return result +def layer_path(layername, d): + """ + Return the path to the specified layer, or None if the layer isn't present. + """ + bbpath = d.getVar("BBPATH").split(":") + pattern = d.getVar('BBFILE_PATTERN_' + layername) + for path in reversed(sorted(bbpath)): + if re.match(pattern, path + "/"): + return path + return None # Constant taken from http://linux.die.net/include/linux/prctl.h PR_SET_PDEATHSIG = 1 |