[oe-commits] org.nslu2-linux.bitbake bitbake 313

jbowler commit openembedded-commits at lists.openembedded.org
Mon Oct 23 17:44:39 UTC 2006


bitbake 313

Author: jbowler at nslu2-linux.org
Branch: org.nslu2-linux.bitbake
Revision: e1a190844a7c21f1afc1231126cc17030470391e
ViewMTN: http://monotone.openembedded.org/revision.psp?id=e1a190844a7c21f1afc1231126cc17030470391e
Files:
1
lib/bb/__init__.py
lib/bb/parse/__init__.py
lib/bb/shell.py
Diffs:

#
# mt diff -ra68af4ca64b874bdf471eab48b34780515b524f9 -re1a190844a7c21f1afc1231126cc17030470391e
#
# 
# 
# patch "lib/bb/__init__.py"
#  from [b6d5f29cbac9e32229541fd250eb935cacfb725c]
#    to [d72fe5cef84c696eaf77d22f4fae94864eae4d60]
# 
# patch "lib/bb/parse/__init__.py"
#  from [b9e6217f360fb327033f85114f7039c889ec586b]
#    to [3c8c3d2ff032e0536c096c0272eb9748a852f264]
# 
# patch "lib/bb/shell.py"
#  from [3085da839db12391048a58cf162bb2b5a13b5186]
#    to [9d77708d9910f911076f9678ca01f0a63c47e6b1]
# 
============================================================
--- lib/bb/__init__.py	b6d5f29cbac9e32229541fd250eb935cacfb725c
+++ lib/bb/__init__.py	d72fe5cef84c696eaf77d22f4fae94864eae4d60
@@ -23,7 +23,7 @@ Place, Suite 330, Boston, MA 02111-1307 
 Place, Suite 330, Boston, MA 02111-1307 USA.
 """
 
-__version__ = "1.3.2"
+__version__ = "1.3.2.1"
 
 __all__ = [
 
============================================================
--- lib/bb/parse/__init__.py	b9e6217f360fb327033f85114f7039c889ec586b
+++ lib/bb/parse/__init__.py	3c8c3d2ff032e0536c096c0272eb9748a852f264
@@ -26,6 +26,8 @@ handlers = []
             'supports', 'handle', 'init' ]
 handlers = []
 
+import bb, os
+
 class ParseError(Exception):
     """Exception raised when parsing fails"""
 
@@ -34,13 +36,14 @@ def cached_mtime(f):
 
 __mtime_cache = {}
 def cached_mtime(f):
-    import os
     if not __mtime_cache.has_key(f):
-        __mtime_cache[f] = os.stat(f)[8]
+        update_mtime(f)
     return __mtime_cache[f]
 
+def update_mtime(f):
+    __mtime_cache[f] = os.stat(f)[8]
+
 def mark_dependency(d, f):
-    import bb, os
     if f.startswith('./'):
         f = "%s/%s" % (os.getcwd(), f[2:])
     deps = (bb.data.getVar('__depends', d) or "").split()
============================================================
--- lib/bb/shell.py	3085da839db12391048a58cf162bb2b5a13b5186
+++ lib/bb/shell.py	9d77708d9910f911076f9678ca01f0a63c47e6b1
@@ -18,6 +18,12 @@
 # Place, Suite 330, Boston, MA 02111-1307 USA.
 #
 ##########################################################################
+#
+# Thanks to:
+# * Holger Freyther <zecke at handhelds.org>
+# * Justin Patrin <papercrane at reversefold.com>
+#
+##########################################################################
 
 """
 BitBake Shell
@@ -53,7 +59,7 @@ from bb import data, parse, build, fatal
 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 at 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]






More information about the Openembedded-commits mailing list