-Changes in bitbake 1.3.0:
+Changes in BitBake 1.3.2:
+ - reintegration of make.py into BitBake
+ - bbread is gone, use bitbake -e
+ - lots of shell updates and bugfixes
+
+Changes in BitBake 1.3.0:
- add bitbake interactive shell (bitbake -i)
- refactor bitbake utility in OO style
- kill default arguments in methods in the bb.data module
each data instance in memory when using a cache/persistent
storage
-Changes in bitbake 1.2.1:
+Changes in BitBake 1.2.1:
The 1.2.1 release is meant as a intermediate release to lay the
-ground for more radical changes. The most notable changes are:
+ ground for more radical changes. The most notable changes are:
- -Do not hardcode {}, use bb.data.init() instead if you want to
-get a instance of a data class
- -bb.data.init() is a factory and the old bb.data methods are delegates
- -Do not use deepcopy use bb.data.createCopy() instead.
- -Removed default arguments in bb.fetch
+ - Do not hardcode {}, use bb.data.init() instead if you want to
+ get a instance of a data class
+ - bb.data.init() is a factory and the old bb.data methods are delegates
+ - Do not use deepcopy use bb.data.createCopy() instead.
+ - Removed default arguments in bb.fetch
* automatic check if reparsing is necessary (inotify?)
* frontend for bb file manipulation
* more shell-like features:
- - shell lexer (shlex)
- output control, i.e. pipe output into grep, sort, etc.
- job control, i.e. bring running commands into background and foreground
- wildcards for commands, i.e. build *opie*
* start parsing in background right after startup
- * print variable from package data
* ncurses interface
- * read some initial commands from startup file (batch)
PROBLEMS:
* force doesn't always work
set
except NameError:
from sets import Set as set
-import sys, os, imp, readline, socket, httplib, urllib, commands, popen2, copy
+import sys, os, imp, readline, socket, httplib, urllib, commands, popen2, copy, shlex, Queue
imp.load_source( "bitbake", os.path.dirname( sys.argv[0] )+"/bitbake" )
from bb import data, parse, build, fatal
-__version__ = "0.5.1"
+__version__ = "0.5.2"
__credits__ = """BitBake Shell Version %s (C) 2005 Michael 'Mickey' Lauer <mickey@Vanille.de>
Type 'help' for more information, press CTRL-D to exit.""" % __version__
def __init__( self ):
"""Register commands and set up readline"""
+ self.commandQ = Queue.Queue()
self.commands = BitBakeShellCommands( self )
self.myout = MemoryOutput( sys.stdout )
self.historyfilename = os.path.expanduser( "~/.bbsh_history" )
"""Read and execute all commands found in $HOME/.bbsh_startup"""
if os.path.exists( self.startupfilename ):
startupfile = open( self.startupfilename, "r" )
- # save_stdout = sys.stdout
- # sys.stdout = open( "/dev/null", "w" )
- numCommands = 0
- for cmdline in startupfile.readlines():
- cmdline = cmdline.strip()
+ for cmdline in startupfile:
debugOut( "processing startup line '%s'" % cmdline )
if not cmdline:
continue
if "|" in cmdline:
- print >>save_stdout, "ERROR: ';' in startup file is not allowed. Ignoring line"
+ print "ERROR: '|' in startup file is not allowed. Ignoring line"
continue
- allCommands = cmdline.split( ';' )
- for command in allCommands:
- if ' ' in command:
- self.processCommand( command.split()[0], command.split()[1:] )
- else:
- self.processCommand( command, "" )
- numCommands += 1
- print "SHELL: Processed %d commands from '%s'" % ( numCommands, self.startupfilename )
+ self.commandQ.put( cmdline.strip() )
def main( self ):
"""The main command loop"""
while not leave_mainloop:
try:
- sys.stdout = self.myout.delegate
- cmdline = raw_input( "BB>> " )
- sys.stdout = self.myout
+ if self.commandQ.empty():
+ sys.stdout = self.myout.delegate
+ cmdline = raw_input( "BB>> " )
+ sys.stdout = self.myout
+ else:
+ cmdline = self.commandQ.get()
if cmdline:
allCommands = cmdline.split( ';' )
for command in allCommands:
command, pipecmd = command.split( '|' )
delegate = self.myout.delegate
self.myout.delegate = None
- if ' ' in command:
- self.processCommand( command.split()[0], command.split()[1:] )
- else:
- self.processCommand( command, "" )
+ tokens = shlex.split( command, True )
+ self.processCommand( tokens[0], tokens[1:] or "" )
self.myout.endCommand()
if pipecmd is not None: # restore output
self.myout.delegate = delegate