summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Watt <jpewhacker@gmail.com>2019-05-22 14:56:50 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-05-30 12:37:03 +0100
commit88f5abb028729212a7758c565eb90f0286593c5c (patch)
tree7f7b1270ab917b0dca757bf872cd9665a6b589f7
parent66fd4c13d97a23338f6cdde6770ffb0e60f0b814 (diff)
downloadpoky-88f5abb028729212a7758c565eb90f0286593c5c.tar.gz
bitbake: bitbake: Show base multiconfig environment
Adds support to the 'bitbake -e' command so that it can display the base environment for a multiconfig. It was previously possible to get the base environment for the main environment by running "bitbake -e", but there was no support for getting the base environment for a multiconfig without specifying a recipe. A user can now print the base environment for the multiconfig "foo" by running: $ bitbake -e multiconfig:foo (Bitbake rev: 3d657af8a6120193d45d01968605b30075a56198) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/cooker.py31
1 files changed, 21 insertions, 10 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 33697a71d5..d183abab6d 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -495,6 +495,7 @@ class BBCooker:
495 """ 495 """
496 fn = None 496 fn = None
497 envdata = None 497 envdata = None
498 mc = ''
498 if not pkgs_to_build: 499 if not pkgs_to_build:
499 pkgs_to_build = [] 500 pkgs_to_build = []
500 501
@@ -503,6 +504,12 @@ class BBCooker:
503 self.enableDataTracking() 504 self.enableDataTracking()
504 self.reset() 505 self.reset()
505 506
507 def mc_base(p):
508 if p.startswith('multiconfig:'):
509 s = p.split(':')
510 if len(s) == 2:
511 return s[1]
512 return None
506 513
507 if buildfile: 514 if buildfile:
508 # Parse the configuration here. We need to do it explicitly here since 515 # Parse the configuration here. We need to do it explicitly here since
@@ -513,18 +520,16 @@ class BBCooker:
513 fn = self.matchFile(fn) 520 fn = self.matchFile(fn)
514 fn = bb.cache.realfn2virtual(fn, cls, mc) 521 fn = bb.cache.realfn2virtual(fn, cls, mc)
515 elif len(pkgs_to_build) == 1: 522 elif len(pkgs_to_build) == 1:
516 ignore = self.data.getVar("ASSUME_PROVIDED") or "" 523 mc = mc_base(pkgs_to_build[0])
517 if pkgs_to_build[0] in set(ignore.split()): 524 if not mc:
518 bb.fatal("%s is in ASSUME_PROVIDED" % pkgs_to_build[0]) 525 ignore = self.data.getVar("ASSUME_PROVIDED") or ""
526 if pkgs_to_build[0] in set(ignore.split()):
527 bb.fatal("%s is in ASSUME_PROVIDED" % pkgs_to_build[0])
519 528
520 taskdata, runlist = self.buildTaskData(pkgs_to_build, None, self.configuration.abort, allowincomplete=True) 529 taskdata, runlist = self.buildTaskData(pkgs_to_build, None, self.configuration.abort, allowincomplete=True)
521 530
522 mc = runlist[0][0] 531 mc = runlist[0][0]
523 fn = runlist[0][3] 532 fn = runlist[0][3]
524 else:
525 envdata = self.data
526 data.expandKeys(envdata)
527 parse.ast.runAnonFuncs(envdata)
528 533
529 if fn: 534 if fn:
530 try: 535 try:
@@ -533,6 +538,12 @@ class BBCooker:
533 except Exception as e: 538 except Exception as e:
534 parselog.exception("Unable to read %s", fn) 539 parselog.exception("Unable to read %s", fn)
535 raise 540 raise
541 else:
542 if not mc in self.databuilder.mcdata:
543 bb.fatal('Not multiconfig named "%s" found' % mc)
544 envdata = self.databuilder.mcdata[mc]
545 data.expandKeys(envdata)
546 parse.ast.runAnonFuncs(envdata)
536 547
537 # Display history 548 # Display history
538 with closing(StringIO()) as env: 549 with closing(StringIO()) as env: