summaryrefslogtreecommitdiffstats
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:49:02 +0000
commit6034a2d8460aeceacadbf3eeb7bfe956b215555c (patch)
tree21c81ec51dbff36edcdace343a42fda441a1acc0
parent060ef3d957615b7eb1209dc0d01ebeb53f8c4edc (diff)
downloadbitbake-6034a2d8460aeceacadbf3eeb7bfe956b215555c.tar.gz
cooker.py: Add support for a bblayers.conf file
(From Poky rev: 666c753) Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
-rw-r--r--lib/bb/cooker.py33
1 files changed, 25 insertions, 8 deletions
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index bf174859c..be73c8a27 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -87,10 +87,7 @@ class BBCooker:
bb.data.inheritFromOS(self.configuration.data)
- for f in self.configuration.file:
- self.parseConfigurationFile( f )
-
- self.parseConfigurationFile( os.path.join( "conf", "bitbake.conf" ) )
+ self.parseConfigurationFiles(self.configuration.file)
if not self.configuration.cmd:
self.configuration.cmd = bb.data.getVar("BB_DEFAULT_TASK", self.configuration.data, True) or "build"
@@ -524,9 +521,29 @@ class BBCooker:
else:
shell.start( self )
- def parseConfigurationFile( self, afile ):
+ def parseConfigurationFiles(self, files):
try:
- self.configuration.data = bb.parse.handle( afile, self.configuration.data )
+ data = self.configuration.data
+ for f in files:
+ data = bb.parse.handle(f, data)
+
+ layerconf = os.path.join(os.getcwd(), "conf", "bblayers.conf")
+ if os.path.exists(layerconf):
+ bb.msg.debug(2, bb.msg.domain.Parsing, "Found bblayers.conf (%s)" % layerconf)
+ data = bb.parse.handle(layerconf, data)
+
+ layers = (bb.data.getVar('BBLAYERS', data, True) or "").split()
+
+ for layer in layers:
+ bb.msg.debug(2, bb.msg.domain.Parsing, "Adding layer %s" % layer)
+ bb.data.setVar('LAYERDIR', layer, data)
+ data = bb.parse.handle(os.path.join(layer, "conf", "layer.conf"), data)
+
+ bb.data.delVar('LAYERDIR', data)
+
+ data = bb.parse.handle(os.path.join("conf", "bitbake.conf"), data)
+
+ self.configuration.data = data
# Handle any INHERITs and inherit the base class
inherits = ["base"] + (bb.data.getVar('INHERIT', self.configuration.data, True ) or "").split()
@@ -543,9 +560,9 @@ class BBCooker:
bb.event.fire(bb.event.ConfigParsed(), self.configuration.data)
except IOError, e:
- bb.msg.fatal(bb.msg.domain.Parsing, "Error when parsing %s: %s" % (afile, str(e)))
+ bb.msg.fatal(bb.msg.domain.Parsing, "Error when parsing %s: %s" % (files, str(e)))
except bb.parse.ParseError, details:
- bb.msg.fatal(bb.msg.domain.Parsing, "Unable to parse %s (%s)" % (afile, details) )
+ bb.msg.fatal(bb.msg.domain.Parsing, "Unable to parse %s (%s)" % (files, details) )
def handleCollections( self, collections ):
"""Handle collections"""