summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2007-03-04 15:21:36 +0000
committerRichard Purdie <rpurdie@linux.intel.com>2007-03-04 15:21:36 +0000
commit9e36b690d050470f222f4cd74fb944bfee099795 (patch)
tree5235c05c4983a3a99db894a25894f7c8021fd840
parent9b8c5d0c6ce444811eb0cfd182695df29c917fa9 (diff)
downloadbitbake-9e36b690d050470f222f4cd74fb944bfee099795.tar.gz
cooker.py: Move some functionality to the module init function
-rwxr-xr-xbin/bitbake4
-rw-r--r--lib/bb/cooker.py62
2 files changed, 33 insertions, 33 deletions
diff --git a/bin/bitbake b/bin/bitbake
index 79095b2cb..cb88ba8ca 100755
--- a/bin/bitbake
+++ b/bin/bitbake
@@ -109,8 +109,8 @@ Default BBFILES are the .bb files in the current directory.""" )
configuration.pkgs_to_build = []
configuration.pkgs_to_build.extend(args[1:])
- bb.cooker.BBCooker().cook(configuration)
-
+ cooker = bb.cooker.BBCooker(configuration)
+ cooker.cook()
if __name__ == "__main__":
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index c792b3aac..0c289fa80 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -38,12 +38,41 @@ class BBCooker:
Manages one bitbake build run
"""
- def __init__( self ):
+ def __init__(self, configuration):
self.status = None
self.cache = None
self.bb_cache = None
+ self.configuration = configuration
+
+ if self.configuration.verbose:
+ bb.msg.set_verbose(True)
+
+ if self.configuration.debug:
+ bb.msg.set_debug_level(self.configuration.debug)
+ else:
+ bb.msg.set_debug_level(0)
+
+ if self.configuration.debug_domains:
+ bb.msg.set_debug_domains(self.configuration.debug_domains)
+
+ self.configuration.data = bb.data.init()
+
+ for f in self.configuration.file:
+ self.parseConfigurationFile( f )
+
+ self.parseConfigurationFile( os.path.join( "conf", "bitbake.conf" ) )
+
+ if not self.configuration.cmd:
+ self.configuration.cmd = bb.data.getVar("BB_DEFAULT_TASK", self.configuration.data) or "build"
+
+ #
+ # Special updated configuration we use for firing events
+ #
+ self.configuration.event_data = bb.data.createCopy(self.configuration.data)
+ bb.data.update_data(self.configuration.event_data)
+
def tryBuildPackage(self, fn, item, task, the_data, build_depends):
"""
Build one task of a package, optionally build following task depends
@@ -337,42 +366,13 @@ class BBCooker:
bb.msg.error(bb.msg.domain.Parsing, "invalid value for BBFILE_PRIORITY_%s: \"%s\"" % (c, priority))
- def cook(self, configuration):
+ def cook(self):
"""
We are building stuff here. We do the building
from here. By default we try to execute task
build.
"""
- self.configuration = configuration
-
- if self.configuration.verbose:
- bb.msg.set_verbose(True)
-
- if self.configuration.debug:
- bb.msg.set_debug_level(self.configuration.debug)
- else:
- bb.msg.set_debug_level(0)
-
- if self.configuration.debug_domains:
- bb.msg.set_debug_domains(self.configuration.debug_domains)
-
- self.configuration.data = bb.data.init()
-
- for f in self.configuration.file:
- self.parseConfigurationFile( f )
-
- self.parseConfigurationFile( os.path.join( "conf", "bitbake.conf" ) )
-
- if not self.configuration.cmd:
- self.configuration.cmd = bb.data.getVar("BB_DEFAULT_TASK", self.configuration.data) or "build"
-
- #
- # Special updated configuration we use for firing events
- #
- self.configuration.event_data = bb.data.createCopy(self.configuration.data)
- bb.data.update_data(self.configuration.event_data)
-
if self.configuration.show_environment:
self.showEnvironment()
sys.exit( 0 )