mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 19:11:53 +00:00
buildman: Use common code to send an result
At present the code to report a build result is duplicated. Put it in a common function to avoid this. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
249933136f
commit
ab9b4f35e3
1 changed files with 13 additions and 8 deletions
|
@ -444,6 +444,17 @@ class BuilderThread(threading.Thread):
|
||||||
target = '%s-%s%s' % (base, dirname, ext)
|
target = '%s-%s%s' % (base, dirname, ext)
|
||||||
shutil.copy(fname, os.path.join(build_dir, target))
|
shutil.copy(fname, os.path.join(build_dir, target))
|
||||||
|
|
||||||
|
def _SendResult(self, result):
|
||||||
|
"""Send a result to the builder for processing
|
||||||
|
|
||||||
|
Args:
|
||||||
|
result: CommandResult object containing the results of the build
|
||||||
|
"""
|
||||||
|
if self.thread_num != -1:
|
||||||
|
self.builder.out_queue.put(result)
|
||||||
|
else:
|
||||||
|
self.builder.ProcessResult(result)
|
||||||
|
|
||||||
def RunJob(self, job):
|
def RunJob(self, job):
|
||||||
"""Run a single job
|
"""Run a single job
|
||||||
|
|
||||||
|
@ -517,10 +528,7 @@ class BuilderThread(threading.Thread):
|
||||||
|
|
||||||
# We have the build results, so output the result
|
# We have the build results, so output the result
|
||||||
self._WriteResult(result, job.keep_outputs, job.work_in_output)
|
self._WriteResult(result, job.keep_outputs, job.work_in_output)
|
||||||
if self.thread_num != -1:
|
self._SendResult(result)
|
||||||
self.builder.out_queue.put(result)
|
|
||||||
else:
|
|
||||||
self.builder.ProcessResult(result)
|
|
||||||
else:
|
else:
|
||||||
# Just build the currently checked-out build
|
# Just build the currently checked-out build
|
||||||
result, request_config = self.RunCommit(None, brd, work_dir, True,
|
result, request_config = self.RunCommit(None, brd, work_dir, True,
|
||||||
|
@ -529,10 +537,7 @@ class BuilderThread(threading.Thread):
|
||||||
work_in_output=job.work_in_output)
|
work_in_output=job.work_in_output)
|
||||||
result.commit_upto = 0
|
result.commit_upto = 0
|
||||||
self._WriteResult(result, job.keep_outputs, job.work_in_output)
|
self._WriteResult(result, job.keep_outputs, job.work_in_output)
|
||||||
if self.thread_num != -1:
|
self._SendResult(result)
|
||||||
self.builder.out_queue.put(result)
|
|
||||||
else:
|
|
||||||
self.builder.ProcessResult(result)
|
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
"""Our thread's run function
|
"""Our thread's run function
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue