aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bb')
-rw-r--r--lib/bb/runqueue.py10
-rw-r--r--lib/bb/shell.py45
2 files changed, 41 insertions, 14 deletions
diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py
index f07902fc5..ddf165b9a 100644
--- a/lib/bb/runqueue.py
+++ b/lib/bb/runqueue.py
@@ -25,8 +25,8 @@ import bb, os, sys
class TaskFailure(Exception):
"""Exception raised when a task in a runqueue fails"""
- def __init__(self, fnid, taskname):
- self.args = fnid, taskname
+ def __init__(self, fnid, fn, taskname):
+ self.args = fnid, fn, taskname
class RunQueue:
"""
@@ -268,7 +268,9 @@ class RunQueue:
try:
self.execute_runqueue_internal(cooker, cfgData, dataCache, taskData)
return failures
- except bb.runqueue.TaskFailure, (fnid, taskname):
+ except bb.runqueue.TaskFailure, (fnid, taskData.fn_index[fnid], taskname):
+ if cooker.configuration.abort:
+ raise
if cooker.configuration.abort:
raise
taskData.fail_fnid(fnid)
@@ -373,7 +375,7 @@ class RunQueue:
active_builds = active_builds - 1
if result[1] != 0:
bb.msg.error(bb.msg.domain.RunQueue, "Task %s (%s) failed" % (build_pids[result[0]], self.get_user_idstring(build_pids[result[0]], taskData)))
- raise bb.runqueue.TaskFailure(self.runq_fnid[build_pids[result[0]]], self.runq_task[build_pids[result[0]]])
+ raise bb.runqueue.TaskFailure(self.runq_fnid[build_pids[result[0]]], taskData.fn_index[self.runq_fnid[build_pids[result[0]]]], self.runq_task[build_pids[result[0]]])
task_complete(self, build_pids[result[0]])
del build_pids[result[0]]
continue
diff --git a/lib/bb/shell.py b/lib/bb/shell.py
index dbf7363d4..7b6d5415e 100644
--- a/lib/bb/shell.py
+++ b/lib/bb/shell.py
@@ -57,7 +57,7 @@ try:
except NameError:
from sets import Set as set
import sys, os, readline, socket, httplib, urllib, commands, popen2, copy, shlex, Queue, fnmatch
-from bb import data, parse, build, fatal, cache
+from bb import data, parse, build, fatal, cache, taskdata, runqueue, providers as Providers
__version__ = "0.5.3.1"
__credits__ = """BitBake Shell Version %s (C) 2005 Michael 'Mickey' Lauer <mickey@Vanille.de>
@@ -107,7 +107,7 @@ class BitBakeShellCommands:
preferred = data.getVar( "PREFERRED_PROVIDER_%s" % item, cooker.configuration.data, 1 )
if not preferred: preferred = item
try:
- lv, lf, pv, pf = bb.providers.findBestProvider(preferred, cooker.configuration.data, cooker.status, cooker.build_cache_fail)
+ lv, lf, pv, pf = Providers.findBestProvider(preferred, cooker.configuration.data, cooker.status, cooker.build_cache_fail)
except KeyError:
if item in cooker.status.providers:
pf = cooker.status.providers[item][0]
@@ -155,14 +155,39 @@ class BitBakeShellCommands:
cooker.build_cache = []
cooker.build_cache_fail = []
- for name in names:
- try:
- cooker.buildProvider( name, data.getVar("BUILD_ALL_DEPS", cooker.configuration.data, True) )
- except build.EventException, e:
- print "ERROR: Couldn't build '%s'" % name
- global last_exception
- last_exception = e
- break
+ td = taskdata.TaskData()
+
+ try:
+ tasks = []
+ for name in names:
+ td.add_provider(cooker.configuration.data, cooker.status, name)
+ providers = td.get_provider(name)
+
+ if len(providers) == 0:
+ raise Providers.NoProvider
+
+ tasks.append([name, "do_%s" % cooker.configuration.cmd])
+
+ td.add_unresolved(cooker.configuration.data, cooker.status)
+
+ rq = runqueue.RunQueue()
+ rq.prepare_runqueue(cooker.configuration.data, cooker.status, td, tasks)
+ rq.execute_runqueue(cooker, cooker.configuration.data, cooker.status, td, tasks)
+
+ except Providers.NoProvider:
+ print "ERROR: No Provider"
+ global last_exception
+ last_exception = Providers.NoProvider
+
+ except runqueue.TaskFailure, (fnid, fn, taskname):
+ print "ERROR: '%s, %s' failed" % (fn, taskname)
+ global last_exception
+ last_exception = runqueue.TaskFailure
+
+ except build.EventException, e:
+ print "ERROR: Couldn't build '%s'" % names
+ global last_exception
+ last_exception = e
cooker.configuration.cmd = oldcmd