summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/utils.py')
-rw-r--r--bitbake/lib/bb/utils.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
index b7e2c9218b..d6afa21542 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -1457,14 +1457,20 @@ def edit_bblayers_conf(bblayers_conf, add, remove, edit_cb=None):
1457 1457
1458 return (notadded, notremoved) 1458 return (notadded, notremoved)
1459 1459
1460 1460def get_collection_res(d):
1461def get_file_layer(filename, d):
1462 """Determine the collection (as defined by a layer's layer.conf file) containing the specified file"""
1463 collections = (d.getVar('BBFILE_COLLECTIONS') or '').split() 1461 collections = (d.getVar('BBFILE_COLLECTIONS') or '').split()
1464 collection_res = {} 1462 collection_res = {}
1465 for collection in collections: 1463 for collection in collections:
1466 collection_res[collection] = d.getVar('BBFILE_PATTERN_%s' % collection) or '' 1464 collection_res[collection] = d.getVar('BBFILE_PATTERN_%s' % collection) or ''
1467 1465
1466 return collection_res
1467
1468
1469def get_file_layer(filename, d, collection_res={}):
1470 """Determine the collection (as defined by a layer's layer.conf file) containing the specified file"""
1471 if not collection_res:
1472 collection_res = get_collection_res(d)
1473
1468 def path_to_layer(path): 1474 def path_to_layer(path):
1469 # Use longest path so we handle nested layers 1475 # Use longest path so we handle nested layers
1470 matchlen = 0 1476 matchlen = 0