aboutsummaryrefslogtreecommitdiffstats
path: root/bin/bitbake
diff options
context:
space:
mode:
Diffstat (limited to 'bin/bitbake')
-rwxr-xr-xbin/bitbake80
1 files changed, 44 insertions, 36 deletions
diff --git a/bin/bitbake b/bin/bitbake
index cf75b5d1..824dd4db 100755
--- a/bin/bitbake
+++ b/bin/bitbake
@@ -139,6 +139,10 @@ class BBCooker:
"""
Manages one bitbake build run
"""
+
+ ParsingStatus = BBParsingStatus # make it visible from the shell
+ Statistics = BBStatistics # make it visible from the shell
+
def __init__( self ):
self.build_cache_fail = []
self.build_cache = []
@@ -581,13 +585,45 @@ class BBCooker:
self.build_cache_fail.append(fn)
def interactiveMode( self ):
+ """Drop off into a shell"""
try:
from bb import shell
- except ImportError:
- print "Sorry, the shell is not available yet."
- sys.exit( -1 )
+ except ImportError, details:
+ bb.fatal("Sorry, shell not available (%s)" % details )
else:
- shell.start()
+ shell.start( self )
+ sys.exit( 0 )
+
+ def parseConfigurationFile( self, afile ):
+ try:
+ make.cfg = bb.parse.handle( afile, make.cfg )
+ except IOError:
+ bb.fatal( "Unable to open %s" % afile )
+
+ def handleCollections( self, collections ):
+ """Handle collections"""
+ if collections:
+ collection_list = collections.split()
+ for c in collection_list:
+ regex = bb.data.getVar("BBFILE_PATTERN_%s" % c, make.cfg, 1)
+ if regex == None:
+ bb.error("BBFILE_PATTERN_%s not defined" % c)
+ continue
+ priority = bb.data.getVar("BBFILE_PRIORITY_%s" % c, make.cfg, 1)
+ if priority == None:
+ bb.error("BBFILE_PRIORITY_%s not defined" % c)
+ continue
+ try:
+ cre = re.compile(regex)
+ except re.error:
+ bb.error("BBFILE_PATTERN_%s \"%s\" is not a valid regular expression" % (c, regex))
+ continue
+ try:
+ pri = int(priority)
+ self.status.bbfile_config_priorities.append((cre, pri))
+ except ValueError:
+ bb.error("invalid value for BBFILE_PRIORITY_%s: \"%s\"" % (c, priority))
+
def cook( self, args ):
if not make.options.cmd:
@@ -599,15 +635,9 @@ class BBCooker:
make.cfg = bb.data.init()
for f in make.options.file:
- try:
- make.cfg = bb.parse.handle(f, make.cfg)
- except IOError:
- bb.fatal("Unable to open %s" % f)
+ self.parseConfigurationFile( f )
- try:
- make.cfg = bb.parse.handle(os.path.join('conf', 'bitbake.conf'), make.cfg)
- except IOError:
- bb.fatal("Unable to open %s" % os.path.join('conf', 'bitbake.conf'))
+ self.parseConfigurationFile( os.path.join( "conf", "bitbake.conf" ) )
if not bb.data.getVar("BUILDNAME", make.cfg):
bb.data.setVar("BUILDNAME", os.popen('date +%Y%m%d%H%M').readline().strip(), make.cfg)
@@ -628,28 +658,7 @@ class BBCooker:
ignore = bb.data.getVar("ASSUME_PROVIDED", make.cfg, 1) or ""
self.status.ignored_dependencies = Set( ignore.split() )
- collections = bb.data.getVar("BBFILE_COLLECTIONS", make.cfg, 1)
- if collections:
- collection_list = collections.split()
- for c in collection_list:
- regex = bb.data.getVar("BBFILE_PATTERN_%s" % c, make.cfg, 1)
- if regex == None:
- bb.error("BBFILE_PATTERN_%s not defined" % c)
- continue
- priority = bb.data.getVar("BBFILE_PRIORITY_%s" % c, make.cfg, 1)
- if priority == None:
- bb.error("BBFILE_PRIORITY_%s not defined" % c)
- continue
- try:
- cre = re.compile(regex)
- except re.error:
- bb.error("BBFILE_PATTERN_%s \"%s\" is not a valid regular expression" % (c, regex))
- continue
- try:
- pri = int(priority)
- self.status.bbfile_config_priorities.append((cre, pri))
- except ValueError:
- bb.error("invalid value for BBFILE_PRIORITY_%s: \"%s\"" % (c, priority))
+ self.handleCollections( bb.data.getVar("BBFILE_COLLECTIONS", make.cfg, 1) )
pkgs_to_build = None
if args:
@@ -660,12 +669,11 @@ class BBCooker:
bbpkgs = bb.data.getVar('BBPKGS', make.cfg, 1)
if bbpkgs:
pkgs_to_build = bbpkgs.split()
- if not pkgs_to_build and not make.options.show_versions:
+ if not pkgs_to_build and not make.options.show_versions and not make.options.interactive:
print "Nothing to do. Use 'bitbake world' to build everything, or run 'bitbake --help'"
print "for usage information."
sys.exit(0)
-
# Import Psyco if available and not disabled
if not make.options.disable_psyco:
try: