summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/shell.py
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2007-04-01 15:04:49 +0000
committerRichard Purdie <richard@openedhand.com>2007-04-01 15:04:49 +0000
commit7371e6323c3fb6b0545712e3cf84606644073e77 (patch)
treee08f25669ec0f0e9d11334909f3b68c0ab6aca19 /bitbake/lib/bb/shell.py
parent8b36dc217443aeeec8493d39561d2bb010336774 (diff)
downloadpoky-7371e6323c3fb6b0545712e3cf84606644073e77.tar.gz
bitbake: Update to 1.8.1 (inc. various bug fixes, epoch support)
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1419 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'bitbake/lib/bb/shell.py')
-rw-r--r--bitbake/lib/bb/shell.py25
1 files changed, 9 insertions, 16 deletions
diff --git a/bitbake/lib/bb/shell.py b/bitbake/lib/bb/shell.py
index 32a773064b..fc213c3f4a 100644
--- a/bitbake/lib/bb/shell.py
+++ b/bitbake/lib/bb/shell.py
@@ -104,10 +104,11 @@ class BitBakeShellCommands:
104 104
105 def _findProvider( self, item ): 105 def _findProvider( self, item ):
106 self._checkParsed() 106 self._checkParsed()
107 # Need to use taskData for this information
107 preferred = data.getVar( "PREFERRED_PROVIDER_%s" % item, cooker.configuration.data, 1 ) 108 preferred = data.getVar( "PREFERRED_PROVIDER_%s" % item, cooker.configuration.data, 1 )
108 if not preferred: preferred = item 109 if not preferred: preferred = item
109 try: 110 try:
110 lv, lf, pv, pf = Providers.findBestProvider(preferred, cooker.configuration.data, cooker.status, cooker.build_cache_fail) 111 lv, lf, pv, pf = Providers.findBestProvider(preferred, cooker.configuration.data, cooker.status)
111 except KeyError: 112 except KeyError:
112 if item in cooker.status.providers: 113 if item in cooker.status.providers:
113 pf = cooker.status.providers[item][0] 114 pf = cooker.status.providers[item][0]
@@ -144,6 +145,7 @@ class BitBakeShellCommands:
144 145
145 def build( self, params, cmd = "build" ): 146 def build( self, params, cmd = "build" ):
146 """Build a providee""" 147 """Build a providee"""
148 global last_exception
147 globexpr = params[0] 149 globexpr = params[0]
148 self._checkParsed() 150 self._checkParsed()
149 names = globfilter( cooker.status.pkg_pn.keys(), globexpr ) 151 names = globfilter( cooker.status.pkg_pn.keys(), globexpr )
@@ -152,8 +154,6 @@ class BitBakeShellCommands:
152 154
153 oldcmd = cooker.configuration.cmd 155 oldcmd = cooker.configuration.cmd
154 cooker.configuration.cmd = cmd 156 cooker.configuration.cmd = cmd
155 cooker.build_cache = []
156 cooker.build_cache_fail = []
157 157
158 td = taskdata.TaskData(cooker.configuration.abort) 158 td = taskdata.TaskData(cooker.configuration.abort)
159 159
@@ -170,24 +170,21 @@ class BitBakeShellCommands:
170 170
171 td.add_unresolved(cooker.configuration.data, cooker.status) 171 td.add_unresolved(cooker.configuration.data, cooker.status)
172 172
173 rq = runqueue.RunQueue() 173 rq = runqueue.RunQueue(cooker, cooker.configuration.data, cooker.status, td, tasks)
174 rq.prepare_runqueue(cooker, cooker.configuration.data, cooker.status, td, tasks) 174 rq.prepare_runqueue()
175 rq.execute_runqueue(cooker, cooker.configuration.data, cooker.status, td, tasks) 175 rq.execute_runqueue()
176 176
177 except Providers.NoProvider: 177 except Providers.NoProvider:
178 print "ERROR: No Provider" 178 print "ERROR: No Provider"
179 global last_exception
180 last_exception = Providers.NoProvider 179 last_exception = Providers.NoProvider
181 180
182 except runqueue.TaskFailure, fnids: 181 except runqueue.TaskFailure, fnids:
183 for fnid in fnids: 182 for fnid in fnids:
184 print "ERROR: '%s' failed" % td.fn_index[fnid] 183 print "ERROR: '%s' failed" % td.fn_index[fnid]
185 global last_exception
186 last_exception = runqueue.TaskFailure 184 last_exception = runqueue.TaskFailure
187 185
188 except build.EventException, e: 186 except build.EventException, e:
189 print "ERROR: Couldn't build '%s'" % names 187 print "ERROR: Couldn't build '%s'" % names
190 global last_exception
191 last_exception = e 188 last_exception = e
192 189
193 cooker.configuration.cmd = oldcmd 190 cooker.configuration.cmd = oldcmd
@@ -236,14 +233,13 @@ class BitBakeShellCommands:
236 233
237 def fileBuild( self, params, cmd = "build" ): 234 def fileBuild( self, params, cmd = "build" ):
238 """Parse and build a .bb file""" 235 """Parse and build a .bb file"""
236 global last_exception
239 name = params[0] 237 name = params[0]
240 bf = completeFilePath( name ) 238 bf = completeFilePath( name )
241 print "SHELL: Calling '%s' on '%s'" % ( cmd, bf ) 239 print "SHELL: Calling '%s' on '%s'" % ( cmd, bf )
242 240
243 oldcmd = cooker.configuration.cmd 241 oldcmd = cooker.configuration.cmd
244 cooker.configuration.cmd = cmd 242 cooker.configuration.cmd = cmd
245 cooker.build_cache = []
246 cooker.build_cache_fail = []
247 243
248 thisdata = copy.deepcopy( initdata ) 244 thisdata = copy.deepcopy( initdata )
249 # Caution: parse.handle modifies thisdata, hence it would 245 # Caution: parse.handle modifies thisdata, hence it would
@@ -266,7 +262,6 @@ class BitBakeShellCommands:
266 cooker.tryBuildPackage( os.path.abspath( bf ), item, cmd, bbfile_data, True ) 262 cooker.tryBuildPackage( os.path.abspath( bf ), item, cmd, bbfile_data, True )
267 except build.EventException, e: 263 except build.EventException, e:
268 print "ERROR: Couldn't build '%s'" % name 264 print "ERROR: Couldn't build '%s'" % name
269 global last_exception
270 last_exception = e 265 last_exception = e
271 266
272 cooker.configuration.cmd = oldcmd 267 cooker.configuration.cmd = oldcmd
@@ -537,8 +532,6 @@ SRC_URI = ""
537 def status( self, params ): 532 def status( self, params ):
538 """<just for testing>""" 533 """<just for testing>"""
539 print "-" * 78 534 print "-" * 78
540 print "build cache = '%s'" % cooker.build_cache
541 print "build cache fail = '%s'" % cooker.build_cache_fail
542 print "building list = '%s'" % cooker.building_list 535 print "building list = '%s'" % cooker.building_list
543 print "build path = '%s'" % cooker.build_path 536 print "build path = '%s'" % cooker.build_path
544 print "consider_msgs_cache = '%s'" % cooker.consider_msgs_cache 537 print "consider_msgs_cache = '%s'" % cooker.consider_msgs_cache
@@ -557,6 +550,7 @@ SRC_URI = ""
557 550
558 def which( self, params ): 551 def which( self, params ):
559 """Computes the providers for a given providee""" 552 """Computes the providers for a given providee"""
553 # Need to use taskData for this information
560 item = params[0] 554 item = params[0]
561 555
562 self._checkParsed() 556 self._checkParsed()
@@ -565,8 +559,7 @@ SRC_URI = ""
565 if not preferred: preferred = item 559 if not preferred: preferred = item
566 560
567 try: 561 try:
568 lv, lf, pv, pf = Providers.findBestProvider(preferred, cooker.configuration.data, cooker.status, 562 lv, lf, pv, pf = Providers.findBestProvider(preferred, cooker.configuration.data, cooker.status)
569cooker.build_cache_fail)
570 except KeyError: 563 except KeyError:
571 lv, lf, pv, pf = (None,)*4 564 lv, lf, pv, pf = (None,)*4
572 565