summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/shell.py
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2008-01-06 16:51:51 +0000
committerRichard Purdie <richard@openedhand.com>2008-01-06 16:51:51 +0000
commit7821f2250d16e24097d973c34197db7fd60bc51a (patch)
treea65ca61381af497265f02b5363196b36fe1b0150 /bitbake/lib/bb/shell.py
parentc7fca99aab060efe14332ce6d913bc7d346a4478 (diff)
downloadpoky-7821f2250d16e24097d973c34197db7fd60bc51a.tar.gz
bitbake: Sync with bitbake upstream for various fixes
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@3411 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'bitbake/lib/bb/shell.py')
-rw-r--r--bitbake/lib/bb/shell.py36
1 files changed, 19 insertions, 17 deletions
diff --git a/bitbake/lib/bb/shell.py b/bitbake/lib/bb/shell.py
index fc213c3f4a..745091fb7d 100644
--- a/bitbake/lib/bb/shell.py
+++ b/bitbake/lib/bb/shell.py
@@ -68,7 +68,6 @@ leave_mainloop = False
68last_exception = None 68last_exception = None
69cooker = None 69cooker = None
70parsed = False 70parsed = False
71initdata = None
72debug = os.environ.get( "BBSHELL_DEBUG", "" ) 71debug = os.environ.get( "BBSHELL_DEBUG", "" )
73 72
74########################################################################## 73##########################################################################
@@ -156,11 +155,14 @@ class BitBakeShellCommands:
156 cooker.configuration.cmd = cmd 155 cooker.configuration.cmd = cmd
157 156
158 td = taskdata.TaskData(cooker.configuration.abort) 157 td = taskdata.TaskData(cooker.configuration.abort)
158 localdata = data.createCopy(cooker.configuration.data)
159 data.update_data(localdata)
160 data.expandKeys(localdata)
159 161
160 try: 162 try:
161 tasks = [] 163 tasks = []
162 for name in names: 164 for name in names:
163 td.add_provider(cooker.configuration.data, cooker.status, name) 165 td.add_provider(localdata, cooker.status, name)
164 providers = td.get_provider(name) 166 providers = td.get_provider(name)
165 167
166 if len(providers) == 0: 168 if len(providers) == 0:
@@ -168,9 +170,9 @@ class BitBakeShellCommands:
168 170
169 tasks.append([name, "do_%s" % cooker.configuration.cmd]) 171 tasks.append([name, "do_%s" % cooker.configuration.cmd])
170 172
171 td.add_unresolved(cooker.configuration.data, cooker.status) 173 td.add_unresolved(localdata, cooker.status)
172 174
173 rq = runqueue.RunQueue(cooker, cooker.configuration.data, cooker.status, td, tasks) 175 rq = runqueue.RunQueue(cooker, localdata, cooker.status, td, tasks)
174 rq.prepare_runqueue() 176 rq.prepare_runqueue()
175 rq.execute_runqueue() 177 rq.execute_runqueue()
176 178
@@ -217,8 +219,8 @@ class BitBakeShellCommands:
217 edit.usage = "<providee>" 219 edit.usage = "<providee>"
218 220
219 def environment( self, params ): 221 def environment( self, params ):
220 """Dump out the outer BitBake environment (see bbread)""" 222 """Dump out the outer BitBake environment"""
221 data.emit_env(sys.__stdout__, cooker.configuration.data, True) 223 cooker.showEnvironment()
222 224
223 def exit_( self, params ): 225 def exit_( self, params ):
224 """Leave the BitBake Shell""" 226 """Leave the BitBake Shell"""
@@ -241,11 +243,10 @@ class BitBakeShellCommands:
241 oldcmd = cooker.configuration.cmd 243 oldcmd = cooker.configuration.cmd
242 cooker.configuration.cmd = cmd 244 cooker.configuration.cmd = cmd
243 245
244 thisdata = copy.deepcopy( initdata ) 246 thisdata = data.createCopy(cooker.configuration.data)
245 # Caution: parse.handle modifies thisdata, hence it would 247 data.update_data(thisdata)
246 # lead to pollution cooker.configuration.data, which is 248 data.expandKeys(thisdata)
247 # why we use it on a safe copy we obtained from cooker right after 249
248 # parsing the initial *.conf files
249 try: 250 try:
250 bbfile_data = parse.handle( bf, thisdata ) 251 bbfile_data = parse.handle( bf, thisdata )
251 except parse.ParseError: 252 except parse.ParseError:
@@ -393,6 +394,11 @@ SRC_URI = ""
393 os.system( "%s %s/%s" % ( os.environ.get( "EDITOR" ), fulldirname, filename ) ) 394 os.system( "%s %s/%s" % ( os.environ.get( "EDITOR" ), fulldirname, filename ) )
394 new.usage = "<directory> <filename>" 395 new.usage = "<directory> <filename>"
395 396
397 def package( self, params ):
398 """Execute 'package' on a providee"""
399 self.build( params, "package" )
400 package.usage = "<providee>"
401
396 def pasteBin( self, params ): 402 def pasteBin( self, params ):
397 """Send a command + output buffer to the pastebin at http://rafb.net/paste""" 403 """Send a command + output buffer to the pastebin at http://rafb.net/paste"""
398 index = params[0] 404 index = params[0]
@@ -501,8 +507,8 @@ SRC_URI = ""
501 interpreter.interact( "SHELL: Expert Mode - BitBake Python %s\nType 'help' for more information, press CTRL-D to switch back to BBSHELL." % sys.version ) 507 interpreter.interact( "SHELL: Expert Mode - BitBake Python %s\nType 'help' for more information, press CTRL-D to switch back to BBSHELL." % sys.version )
502 508
503 def showdata( self, params ): 509 def showdata( self, params ):
504 """Execute 'showdata' on a providee""" 510 """Show the parsed metadata for a given providee"""
505 self.build( params, "showdata" ) 511 cooker.showEnvironment(None, params)
506 showdata.usage = "<providee>" 512 showdata.usage = "<providee>"
507 513
508 def setVar( self, params ): 514 def setVar( self, params ):
@@ -732,10 +738,6 @@ class BitBakeShell:
732 738
733 print __credits__ 739 print __credits__
734 740
735 # save initial cooker configuration (will be reused in file*** commands)
736 global initdata
737 initdata = copy.deepcopy( cooker.configuration.data )
738
739 def cleanup( self ): 741 def cleanup( self ):
740 """Write readline history and clean up resources""" 742 """Write readline history and clean up resources"""
741 debugOut( "writing command history" ) 743 debugOut( "writing command history" )