diff options
Diffstat (limited to 'bitbake/lib/bb/cookerdata.py')
-rw-r--r-- | bitbake/lib/bb/cookerdata.py | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/bitbake/lib/bb/cookerdata.py b/bitbake/lib/bb/cookerdata.py index 8a354fed7c..c322ab2ffb 100644 --- a/bitbake/lib/bb/cookerdata.py +++ b/bitbake/lib/bb/cookerdata.py | |||
@@ -466,3 +466,54 @@ class CookerDataBuilder(object): | |||
466 | 466 | ||
467 | return data | 467 | return data |
468 | 468 | ||
469 | @staticmethod | ||
470 | def _parse_recipe(bb_data, bbfile, appends, mc=''): | ||
471 | bb_data.setVar("__BBMULTICONFIG", mc) | ||
472 | |||
473 | bbfile_loc = os.path.abspath(os.path.dirname(bbfile)) | ||
474 | bb.parse.cached_mtime_noerror(bbfile_loc) | ||
475 | |||
476 | if appends: | ||
477 | bb_data.setVar('__BBAPPEND', " ".join(appends)) | ||
478 | bb_data = bb.parse.handle(bbfile, bb_data) | ||
479 | return bb_data | ||
480 | |||
481 | def parseRecipeVariants(self, bbfile, appends, virtonly=False, mc=None): | ||
482 | """ | ||
483 | Load and parse one .bb build file | ||
484 | Return the data and whether parsing resulted in the file being skipped | ||
485 | """ | ||
486 | |||
487 | if virtonly: | ||
488 | (bbfile, virtual, mc) = bb.cache.virtualfn2realfn(bbfile) | ||
489 | bb_data = self.mcdata[mc].createCopy() | ||
490 | bb_data.setVar("__ONLYFINALISE", virtual or "default") | ||
491 | datastores = self._parse_recipe(bb_data, bbfile, appends, mc) | ||
492 | return datastores | ||
493 | |||
494 | if mc is not None: | ||
495 | bb_data = self.mcdata[mc].createCopy() | ||
496 | return self._parse_recipe(bb_data, bbfile, appends, mc) | ||
497 | |||
498 | bb_data = self.data.createCopy() | ||
499 | datastores = self._parse_recipe(bb_data, bbfile, appends) | ||
500 | |||
501 | for mc in self.mcdata: | ||
502 | if not mc: | ||
503 | continue | ||
504 | bb_data = self.mcdata[mc].createCopy() | ||
505 | newstores = self._parse_recipe(bb_data, bbfile, appends, mc) | ||
506 | for ns in newstores: | ||
507 | datastores["mc:%s:%s" % (mc, ns)] = newstores[ns] | ||
508 | |||
509 | return datastores | ||
510 | |||
511 | def parseRecipe(self, virtualfn, appends): | ||
512 | """ | ||
513 | Return a complete set of data for fn. | ||
514 | To do this, we need to parse the file. | ||
515 | """ | ||
516 | logger.debug("Parsing %s (full)" % virtualfn) | ||
517 | (fn, virtual, mc) = bb.cache.virtualfn2realfn(virtualfn) | ||
518 | bb_data = self.parseRecipeVariants(virtualfn, appends, virtonly=True) | ||
519 | return bb_data[virtual] | ||