aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb
diff options
context:
space:
mode:
authorMichael 'Mickey' Lauer <mickey@vanille-media.de>2005-06-14 09:19:20 +0000
committerMichael 'Mickey' Lauer <mickey@vanille-media.de>2005-06-14 09:19:20 +0000
commit4b4c7e596cd4667da773e73ff9864eca8d85804c (patch)
tree9451d37acf5d094598a58bc93929f86622af6d0b /lib/bb
parent6e9cf3a2cc7e27c2e3c6d9afa7f8e9bb2f38976e (diff)
downloadbitbake-4b4c7e596cd4667da773e73ff9864eca8d85804c.tar.gz
- add 'fetch', 'unpack', 'patch', 'configure', 'compile', 'stage'
which reflect the execution of the respective tasks on providees - add 'force' to toggle make.options.force - switch to a more sane context sensitive completion method inspecting the 'usage' attribute
Diffstat (limited to 'lib/bb')
-rw-r--r--lib/bb/shell.py54
1 files changed, 46 insertions, 8 deletions
diff --git a/lib/bb/shell.py b/lib/bb/shell.py
index fb12d7a5f..f8176cd36 100644
--- a/lib/bb/shell.py
+++ b/lib/bb/shell.py
@@ -129,6 +129,16 @@ class BitBakeShellCommands:
self.build( params, "clean" )
clean.usage = "<providee>"
+ def compile( self, params ):
+ """Execute 'compile' on a providee"""
+ self.build( params, "compile" )
+ compile.usage = "<providee>"
+
+ def configure( self, params ):
+ """Execute 'configure' on a providee"""
+ self.build( params, "configure" )
+ configure.usage = "<providee>"
+
def edit( self, params ):
"""Call $EDITOR on a .bb file"""
name = params[0]
@@ -145,6 +155,11 @@ class BitBakeShellCommands:
global leave_mainloop
leave_mainloop = True
+ def fetch( self, params ):
+ """Fetch a providee"""
+ self.build( params, "fetch" )
+ fetch.usage = "<providee>"
+
def fileBuild( self, params, cmd = "build" ):
"""Parse and build a .bb file"""
name = params[0]
@@ -184,6 +199,11 @@ class BitBakeShellCommands:
self.fileBuild( params )
fileRebuild.usage = "<bbfile>"
+ def force( self, params ):
+ """Toggle force task execution flag (see bitbake -f)"""
+ make.options.force = not make.options.force
+ print "SHELL: Force Flag is now '%s'" % repr( make.options.force )
+
def help( self, params ):
"""Show a comprehensive list of commands and their purpose"""
print "="*30, "Available Commands", "="*30
@@ -287,6 +307,11 @@ SRC_URI = ""
else:
print "ERROR: %s %s" % ( response.status, response.reason )
+ def patch( self, params ):
+ """Execute 'patch' command on a providee"""
+ self.build( params, "patch" )
+ patch.usage = "<providee>"
+
def parse( self, params ):
"""(Re-)parse .bb files and calculate the dependency graph"""
cooker.status = cooker.ParsingStatus()
@@ -334,6 +359,11 @@ SRC_URI = ""
print commands.getoutput( " ".join( params ) )
shell.usage = "<...>"
+ def stage( self, params ):
+ """Execute 'stage' on a providee"""
+ self.build( params, "stage" )
+ stage.usage = "<providee>"
+
def status( self, params ):
"""<just for testing>"""
print "-" * 78
@@ -350,6 +380,11 @@ SRC_URI = ""
"""<just for testing>"""
print "testCommand called with '%s'" % params
+ def unpack( self, params ):
+ """Execute 'unpack' on a providee"""
+ self.build( params, "unpack" )
+ unpack.usage = "<providee>"
+
def which( self, params ):
"""Computes the providers for a given providee"""
item = params[0]
@@ -417,14 +452,17 @@ def completer( text, state ):
if " " in line:
line = line.split()
# we are in second (or more) argument
- if line[0] == "print" or line[0] == "set":
- allmatches = make.cfg.keys()
- elif line[0].startswith( "file" ):
- if make.pkgdata is None: allmatches = [ "(No Matches Available. Parsed yet?)" ]
- else: allmatches = [ x.split("/")[-1] for x in make.pkgdata.keys() ]
- elif line[0] == "build" or line[0] == "clean" or line[0] == "which":
- if make.pkgdata is None: allmatches = [ "(No Matches Available. Parsed yet?)" ]
- else: allmatches = cooker.status.providers.iterkeys()
+ if line[0] in cmds and hasattr( cmds[line[0]][0], "usage" ): # known command and usage
+ u = getattr( cmds[line[0]][0], "usage" ).split()[0]
+ if u == "<variable>":
+ allmatches = make.cfg.keys()
+ elif u == "<bbfile>":
+ if make.pkgdata is None: allmatches = [ "(No Matches Available. Parsed yet?)" ]
+ else: allmatches = [ x.split("/")[-1] for x in make.pkgdata.keys() ]
+ elif u == "<providee>":
+ if make.pkgdata is None: allmatches = [ "(No Matches Available. Parsed yet?)" ]
+ else: allmatches = cooker.status.providers.iterkeys()
+ else: allmatches = [ "(No tab completion available for this command)" ]
else: allmatches = [ "(No tab completion available for this command)" ]
else:
# we are in first argument