summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-04-26 19:02:23 -0600
committerSimon Glass <sjg@chromium.org>2019-05-21 17:33:23 -0600
commit347ea0b63eb5143bf0e48aba65a41f50999367f0 (patch)
tree478e33a7c3f2465a538fcb23e03b9736e142ab03
parente679d03b08fbde6145fdef150f4b240e6d14448e (diff)
downloadu-boot-347ea0b63eb5143bf0e48aba65a41f50999367f0.tar.gz
buildman: Deal more nicely with invalid build-status file
The 'done' files created by buildman may end up being empty if buildman runs out of disk space while writing them. At present buildman dies with an exception when using -s to check the build status. Fix this. Seriesl-cc: trini Signed-off-by: Simon Glass <sjg@chromium.org>
-rw-r--r--tools/buildman/builder.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py
index 6a6c83bf33..fbb236676c 100644
--- a/tools/buildman/builder.py
+++ b/tools/buildman/builder.py
@@ -673,7 +673,12 @@ class Builder:
environment = {}
if os.path.exists(done_file):
with open(done_file, 'r') as fd:
- return_code = int(fd.readline())
+ try:
+ return_code = int(fd.readline())
+ except ValueError:
+ # The file may be empty due to running out of disk space.
+ # Try a rebuild
+ return_code = 1
err_lines = []
err_file = self.GetErrFile(commit_upto, target)
if os.path.exists(err_file):