summaryrefslogtreecommitdiff
path: root/bitbake/lib/bb/shell.py
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2006-05-09 15:44:08 +0000
committerRichard Purdie <richard@openedhand.com>2006-05-09 15:44:08 +0000
commit27dba1e6247ae48349aee1bce141a9eefaafaad1 (patch)
tree822235005ccbd2707f7874ad680dedc4df36760c /bitbake/lib/bb/shell.py
parented234aca98d0867c7b32801fc63820b19cf67df9 (diff)
downloadopenembedded-core-27dba1e6247ae48349aee1bce141a9eefaafaad1.tar.gz
openembedded-core-27dba1e6247ae48349aee1bce141a9eefaafaad1.tar.bz2
openembedded-core-27dba1e6247ae48349aee1bce141a9eefaafaad1.zip
Update to bitbake 1.4.2 (latest stable branch release). This includes the caching speedups
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@371 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'bitbake/lib/bb/shell.py')
-rw-r--r--bitbake/lib/bb/shell.py44
1 files changed, 24 insertions, 20 deletions
diff --git a/bitbake/lib/bb/shell.py b/bitbake/lib/bb/shell.py
index b86dc9753c..93ad00d1ed 100644
--- a/bitbake/lib/bb/shell.py
+++ b/bitbake/lib/bb/shell.py
@@ -3,7 +3,8 @@
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
##########################################################################
#
-# Copyright (C) 2005 Michael 'Mickey' Lauer <mickey@Vanille.de>, Vanille Media
+# Copyright (C) 2005-2006 Michael 'Mickey' Lauer <mickey@Vanille.de>
+# Copyright (C) 2005-2006 Vanille Media
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
@@ -59,7 +60,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.3"
+__version__ = "0.5.3.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__
@@ -263,9 +264,10 @@ class BitBakeShellCommands:
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:
+ cooker.bb_cache.cacheValidUpdate(bbfile)
+ fromCache = cooker.bb_cache.loadData(bbfile, cooker)
+ cooker.bb_cache.sync()
+ if False: #from Cache
print "SHELL: File has not been updated, not reparsing"
else:
print "SHELL: Parsed"
@@ -307,7 +309,7 @@ class BitBakeShellCommands:
what, globexpr = params
if what == "files":
self._checkParsed()
- for key in globfilter( cooker.pkgdata.keys(), globexpr ): print key
+ for key in globfilter( cooker.status.pkg_fn.keys(), globexpr ): print key
elif what == "providers":
self._checkParsed()
for key in globfilter( cooker.status.pkg_pn.keys(), globexpr ): print key
@@ -374,7 +376,7 @@ SRC_URI = ""
pasteBin.usage = "<index>"
def pasteLog( self, params ):
- """Send the last event exception error log (if there is one) to http://pastebin.com"""
+ """Send the last event exception error log (if there is one) to http://oe.pastebin.com"""
if last_exception is None:
print "SHELL: No Errors yet (Phew)..."
else:
@@ -432,7 +434,8 @@ SRC_URI = ""
name, var = params
bbfile = self._findProvider( name )
if bbfile is not None:
- value = cooker.pkgdata[bbfile].getVar( var, 1 )
+ the_data = cooker.bb_cache.loadDataFull(bbfile, cooker)
+ value = the_data.getVar( var, 1 )
print value
else:
print "ERROR: Nothing provides '%s'" % name
@@ -442,13 +445,14 @@ SRC_URI = ""
"""Set contents of variable defined in providee's metadata"""
name, var, value = params
bbfile = self._findProvider( name )
- d = cooker.pkgdata[bbfile]
if bbfile is not None:
- data.setVar( var, value, d )
+ print "ERROR: Sorry, this functionality is currently broken"
+ #d = cooker.pkgdata[bbfile]
+ #data.setVar( var, value, d )
# mark the change semi persistant
- cooker.pkgdata.setDirty(bbfile, d)
- print "OK"
+ #cooker.pkgdata.setDirty(bbfile, d)
+ #print "OK"
else:
print "ERROR: Nothing provides '%s'" % name
poke.usage = "<providee> <variable> <value>"
@@ -458,7 +462,7 @@ SRC_URI = ""
what = params[0]
if what == "files":
self._checkParsed()
- for key in cooker.pkgdata.keys(): print key
+ for key in cooker.status.pkg_fn.keys(): print key
elif what == "providers":
self._checkParsed()
for key in cooker.status.providers.keys(): print key
@@ -555,14 +559,14 @@ SRC_URI = ""
def completeFilePath( bbfile ):
"""Get the complete bbfile path"""
- if not cooker.pkgdata: return bbfile
- for key in cooker.pkgdata.keys():
+ if not cooker.status.pkg_fn: return bbfile
+ for key in cooker.status.pkg_fn.keys():
if key.endswith( bbfile ):
return key
return bbfile
def sendToPastebin( content ):
- """Send content to http://www.pastebin.com"""
+ """Send content to http://oe.pastebin.com"""
mydata = {}
mydata["parent_pid"] = ""
mydata["format"] = "bash"
@@ -572,7 +576,7 @@ def sendToPastebin( content ):
params = urllib.urlencode( mydata )
headers = {"Content-type": "application/x-www-form-urlencoded","Accept": "text/plain"}
- conn = httplib.HTTPConnection( "pastebin.com:80" )
+ conn = httplib.HTTPConnection( "oe.pastebin.com:80" )
conn.request("POST", "/", params, headers )
response = conn.getresponse()
@@ -594,10 +598,10 @@ def completer( text, state ):
if u == "<variable>":
allmatches = cooker.configuration.data.keys()
elif u == "<bbfile>":
- if cooker.pkgdata is None: allmatches = [ "(No Matches Available. Parsed yet?)" ]
- else: allmatches = [ x.split("/")[-1] for x in cooker.pkgdata.keys() ]
+ if cooker.status.pkg_fn is None: allmatches = [ "(No Matches Available. Parsed yet?)" ]
+ else: allmatches = [ x.split("/")[-1] for x in cooker.status.pkg_fn.keys() ]
elif u == "<providee>":
- if cooker.pkgdata is None: allmatches = [ "(No Matches Available. Parsed yet?)" ]
+ if cooker.status.pkg_fn 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)" ]