summaryrefslogtreecommitdiffstats
path: root/lib/bb/shell.py
diff options
context:
space:
mode:
authorMichael 'Mickey' Lauer <mickey@vanille-media.de>2005-09-08 13:11:53 +0000
committerMichael 'Mickey' Lauer <mickey@vanille-media.de>2005-09-08 13:11:53 +0000
commit6a5f647e83145ab6d470469974c618511b458827 (patch)
tree26714b93e571c271bcfa2fc72679791a47d81be9 /lib/bb/shell.py
parent3d7348c9eb7deebecce594f005f0019f9139e51c (diff)
downloadbitbake-6a5f647e83145ab6d470469974c618511b458827.tar.gz
parser: add function to update the mtime for one file, courtesy Justin Patrin
parser: move import bb and import os out of the commands (import in a function that's called often has a performance penalty) lib: increase revision shell: add 'reparse' and 'fileReparse' commands, courtesy Justin Patrin
Diffstat (limited to 'lib/bb/shell.py')
-rw-r--r--lib/bb/shell.py31
1 files changed, 30 insertions, 1 deletions
diff --git a/lib/bb/shell.py b/lib/bb/shell.py
index 97e61e116..24406bb80 100644
--- a/lib/bb/shell.py
+++ b/lib/bb/shell.py
@@ -18,6 +18,12 @@
# Place, Suite 330, Boston, MA 02111-1307 USA.
#
##########################################################################
+#
+# Thanks to:
+# * Holger Freyther <zecke@handhelds.org>
+# * Justin Patrin <papercrane@reversefold.com>
+#
+##########################################################################
"""
BitBake Shell
@@ -53,7 +59,7 @@ import sys, os, imp, readline, socket, httplib, urllib, commands, popen2, copy,
imp.load_source( "bitbake", os.path.dirname( sys.argv[0] )+"/bitbake" )
from bb import data, parse, build, fatal
-__version__ = "0.5.2"
+__version__ = "0.5.3"
__credits__ = """BitBake Shell Version %s (C) 2005 Michael 'Mickey' Lauer <mickey@Vanille.de>
Type 'help' for more information, press CTRL-D to exit.""" % __version__
@@ -252,6 +258,19 @@ class BitBakeShellCommands:
self.fileBuild( params )
fileRebuild.usage = "<bbfile>"
+ def fileReparse( self, params ):
+ """(re)Parse a bb file"""
+ bbfile = params[0]
+ print "SHELL: Parsing '%s'" % bbfile
+ parse.update_mtime( bbfile )
+ bb_data, fromCache = cooker.load_bbfile( bbfile )
+ cooker.pkgdata[bbfile] = bb_data
+ if fromCache:
+ print "SHELL: File has not been updated, not reparsing"
+ else:
+ print "SHELL: Parsed"
+ fileReparse.usage = "<bbfile>"
+
def force( self, params ):
"""Toggle force task execution flag (see bitbake -f)"""
cooker.configuration.force = not cooker.configuration.force
@@ -391,6 +410,16 @@ SRC_URI = ""
parsed = True
print
+ def reparse( self, params ):
+ """(re)Parse a providee's bb file"""
+ bbfile = self._findProvider( params[0] )
+ if bbfile is not None:
+ print "SHELL: Found bbfile '%s' for '%s'" % ( bbfile, params[0] )
+ self.fileReparse( [ bbfile ] )
+ else:
+ print "ERROR: Nothing provides '%s'" % params[0]
+ reparse.usage = "<providee>"
+
def getvar( self, params ):
"""Dump the contents of an outer BitBake environment variable"""
var = params[0]