summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-03-22 17:48:31 +0000
committerRichard Purdie <rpurdie@linux.intel.com>2010-03-22 17:48:31 +0000
commit666c753d4bf3d6d1defb4e4326a4264b4625aca0 (patch)
tree89e1a8acbae1e438c10a60243f357ec8e6c0cdd8 /bitbake
parenta4008b883c5b4e50f6a2a74e42242d5653665cfe (diff)
downloadpoky-666c753d4bf3d6d1defb4e4326a4264b4625aca0.tar.gz
bitbake/cooker.py: Add support for a bblayers.conf file
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/cooker.py33
1 files changed, 25 insertions, 8 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index bf174859cb..be73c8a271 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -87,10 +87,7 @@ class BBCooker:
87 87
88 bb.data.inheritFromOS(self.configuration.data) 88 bb.data.inheritFromOS(self.configuration.data)
89 89
90 for f in self.configuration.file: 90 self.parseConfigurationFiles(self.configuration.file)
91 self.parseConfigurationFile( f )
92
93 self.parseConfigurationFile( os.path.join( "conf", "bitbake.conf" ) )
94 91
95 if not self.configuration.cmd: 92 if not self.configuration.cmd:
96 self.configuration.cmd = bb.data.getVar("BB_DEFAULT_TASK", self.configuration.data, True) or "build" 93 self.configuration.cmd = bb.data.getVar("BB_DEFAULT_TASK", self.configuration.data, True) or "build"
@@ -524,9 +521,29 @@ class BBCooker:
524 else: 521 else:
525 shell.start( self ) 522 shell.start( self )
526 523
527 def parseConfigurationFile( self, afile ): 524 def parseConfigurationFiles(self, files):
528 try: 525 try:
529 self.configuration.data = bb.parse.handle( afile, self.configuration.data ) 526 data = self.configuration.data
527 for f in files:
528 data = bb.parse.handle(f, data)
529
530 layerconf = os.path.join(os.getcwd(), "conf", "bblayers.conf")
531 if os.path.exists(layerconf):
532 bb.msg.debug(2, bb.msg.domain.Parsing, "Found bblayers.conf (%s)" % layerconf)
533 data = bb.parse.handle(layerconf, data)
534
535 layers = (bb.data.getVar('BBLAYERS', data, True) or "").split()
536
537 for layer in layers:
538 bb.msg.debug(2, bb.msg.domain.Parsing, "Adding layer %s" % layer)
539 bb.data.setVar('LAYERDIR', layer, data)
540 data = bb.parse.handle(os.path.join(layer, "conf", "layer.conf"), data)
541
542 bb.data.delVar('LAYERDIR', data)
543
544 data = bb.parse.handle(os.path.join("conf", "bitbake.conf"), data)
545
546 self.configuration.data = data
530 547
531 # Handle any INHERITs and inherit the base class 548 # Handle any INHERITs and inherit the base class
532 inherits = ["base"] + (bb.data.getVar('INHERIT', self.configuration.data, True ) or "").split() 549 inherits = ["base"] + (bb.data.getVar('INHERIT', self.configuration.data, True ) or "").split()
@@ -543,9 +560,9 @@ class BBCooker:
543 bb.event.fire(bb.event.ConfigParsed(), self.configuration.data) 560 bb.event.fire(bb.event.ConfigParsed(), self.configuration.data)
544 561
545 except IOError, e: 562 except IOError, e:
546 bb.msg.fatal(bb.msg.domain.Parsing, "Error when parsing %s: %s" % (afile, str(e))) 563 bb.msg.fatal(bb.msg.domain.Parsing, "Error when parsing %s: %s" % (files, str(e)))
547 except bb.parse.ParseError, details: 564 except bb.parse.ParseError, details:
548 bb.msg.fatal(bb.msg.domain.Parsing, "Unable to parse %s (%s)" % (afile, details) ) 565 bb.msg.fatal(bb.msg.domain.Parsing, "Unable to parse %s (%s)" % (files, details) )
549 566
550 def handleCollections( self, collections ): 567 def handleCollections( self, collections ):
551 """Handle collections""" 568 """Handle collections"""