diff options
author | Michael 'Mickey' Lauer <mickey@vanille-media.de> | 2005-06-09 18:03:25 +0000 |
---|---|---|
committer | Michael 'Mickey' Lauer <mickey@vanille-media.de> | 2005-06-09 18:03:25 +0000 |
commit | 42f8a78f64f9db1d2c2ed7233e26862fd280729b (patch) | |
tree | c650e1d71936b6b62fb70db7abc0933acb4a20a7 /lib | |
parent | 13afd4262338ce9343728c507821403bf8fee208 (diff) | |
download | bitbake-42f8a78f64f9db1d2c2ed7233e26862fd280729b.tar.gz |
add 'shell <command>' which hands a command over to the shell and dumps the output
NOTE: Due to a limitation in the bbshell command processor, 'shell' and 'exec' are
currently broken when using more than one parameter. This will be sorted out asap.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bb/shell.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/bb/shell.py b/lib/bb/shell.py index 372bb5b38..da532a66c 100644 --- a/lib/bb/shell.py +++ b/lib/bb/shell.py @@ -44,11 +44,11 @@ try: set except NameError: from sets import Set as set -import sys, os, imp, readline, socket, httplib, urllib +import sys, os, imp, readline, socket, httplib, urllib, commands imp.load_source( "bitbake", os.path.dirname( sys.argv[0] )+"/bitbake" ) from bb import data, parse, build, make, fatal -__version__ = "0.4.0" +__version__ = "0.4.1" __credits__ = """BitBake Shell Version %s (C) 2005 Michael 'Mickey' Lauer <mickey@Vanille.de> Type 'help' for more information, press CTRL-D to exit.""" % __version__ @@ -283,6 +283,10 @@ def rebuildCommand( params ): buildCommand( params, "clean" ) buildCommand( params, "build" ) +def shellCommand( params ): + """Execute a shell command and dump the output""" + print commands.getoutput( " ".join( params ) ) + def statusCommand( params ): print "-" * 78 print "build cache = '%s'" % cooker.build_cache @@ -420,6 +424,7 @@ def init(): registerCommand( "python", pythonCommand ) registerCommand( "rebuild", rebuildCommand, 1, "rebuild <providee>" ) registerCommand( "set", setVarCommand, 2, "set <variable> <value>" ) + registerCommand( "shell", shellCommand, 1, "shell <command>" ) registerCommand( "status", statusCommand ) registerCommand( "test", testCommand ) registerCommand( "which", whichCommand, 1, "which <providee>" ) |