summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/cookerdata.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/cookerdata.py')
-rw-r--r--bitbake/lib/bb/cookerdata.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/bitbake/lib/bb/cookerdata.py b/bitbake/lib/bb/cookerdata.py
index adde0e7444..42b8d64685 100644
--- a/bitbake/lib/bb/cookerdata.py
+++ b/bitbake/lib/bb/cookerdata.py
@@ -494,8 +494,9 @@ class CookerDataBuilder(object):
494 return data 494 return data
495 495
496 @staticmethod 496 @staticmethod
497 def _parse_recipe(bb_data, bbfile, appends, mc=''): 497 def _parse_recipe(bb_data, bbfile, appends, mc, layername):
498 bb_data.setVar("__BBMULTICONFIG", mc) 498 bb_data.setVar("__BBMULTICONFIG", mc)
499 bb_data.setVar("FILE_LAYERNAME", layername)
499 500
500 bbfile_loc = os.path.abspath(os.path.dirname(bbfile)) 501 bbfile_loc = os.path.abspath(os.path.dirname(bbfile))
501 bb.parse.cached_mtime_noerror(bbfile_loc) 502 bb.parse.cached_mtime_noerror(bbfile_loc)
@@ -505,7 +506,7 @@ class CookerDataBuilder(object):
505 bb_data = bb.parse.handle(bbfile, bb_data) 506 bb_data = bb.parse.handle(bbfile, bb_data)
506 return bb_data 507 return bb_data
507 508
508 def parseRecipeVariants(self, bbfile, appends, virtonly=False, mc=None): 509 def parseRecipeVariants(self, bbfile, appends, virtonly=False, mc=None, layername=None):
509 """ 510 """
510 Load and parse one .bb build file 511 Load and parse one .bb build file
511 Return the data and whether parsing resulted in the file being skipped 512 Return the data and whether parsing resulted in the file being skipped
@@ -515,32 +516,32 @@ class CookerDataBuilder(object):
515 (bbfile, virtual, mc) = bb.cache.virtualfn2realfn(bbfile) 516 (bbfile, virtual, mc) = bb.cache.virtualfn2realfn(bbfile)
516 bb_data = self.mcdata[mc].createCopy() 517 bb_data = self.mcdata[mc].createCopy()
517 bb_data.setVar("__ONLYFINALISE", virtual or "default") 518 bb_data.setVar("__ONLYFINALISE", virtual or "default")
518 datastores = self._parse_recipe(bb_data, bbfile, appends, mc) 519 datastores = self._parse_recipe(bb_data, bbfile, appends, mc, layername)
519 return datastores 520 return datastores
520 521
521 if mc is not None: 522 if mc is not None:
522 bb_data = self.mcdata[mc].createCopy() 523 bb_data = self.mcdata[mc].createCopy()
523 return self._parse_recipe(bb_data, bbfile, appends, mc) 524 return self._parse_recipe(bb_data, bbfile, appends, mc, layername)
524 525
525 bb_data = self.data.createCopy() 526 bb_data = self.data.createCopy()
526 datastores = self._parse_recipe(bb_data, bbfile, appends) 527 datastores = self._parse_recipe(bb_data, bbfile, appends, '', layername)
527 528
528 for mc in self.mcdata: 529 for mc in self.mcdata:
529 if not mc: 530 if not mc:
530 continue 531 continue
531 bb_data = self.mcdata[mc].createCopy() 532 bb_data = self.mcdata[mc].createCopy()
532 newstores = self._parse_recipe(bb_data, bbfile, appends, mc) 533 newstores = self._parse_recipe(bb_data, bbfile, appends, mc, layername)
533 for ns in newstores: 534 for ns in newstores:
534 datastores["mc:%s:%s" % (mc, ns)] = newstores[ns] 535 datastores["mc:%s:%s" % (mc, ns)] = newstores[ns]
535 536
536 return datastores 537 return datastores
537 538
538 def parseRecipe(self, virtualfn, appends): 539 def parseRecipe(self, virtualfn, appends, layername):
539 """ 540 """
540 Return a complete set of data for fn. 541 Return a complete set of data for fn.
541 To do this, we need to parse the file. 542 To do this, we need to parse the file.
542 """ 543 """
543 logger.debug("Parsing %s (full)" % virtualfn) 544 logger.debug("Parsing %s (full)" % virtualfn)
544 (fn, virtual, mc) = bb.cache.virtualfn2realfn(virtualfn) 545 (fn, virtual, mc) = bb.cache.virtualfn2realfn(virtualfn)
545 bb_data = self.parseRecipeVariants(virtualfn, appends, virtonly=True) 546 bb_data = self.parseRecipeVariants(virtualfn, appends, virtonly=True, layername=layername)
546 return bb_data[virtual] 547 return bb_data[virtual]