diff options
author | William Salmon <will.salmon@codethink.co.uk> | 2018-08-14 09:57:42 +0100 |
---|---|---|
committer | William Salmon <will.salmon@codethink.co.uk> | 2018-08-17 10:49:23 +0100 |
commit | d5ed4f45dd618236b19b54ea37edaeea89bdaafb (patch) | |
tree | 1eb10810596fb8880f83dc56c77c820a71118c1b /buildstream | |
parent | 9b6fac5ada7c2541da5666fa63160a7cea3dbe67 (diff) | |
download | buildstream-d5ed4f45dd618236b19b54ea37edaeea89bdaafb.tar.gz |
Improve error message for build if there are refs missingwillsalmon/APIFix
Diffstat (limited to 'buildstream')
-rw-r--r-- | buildstream/_pipeline.py | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/buildstream/_pipeline.py b/buildstream/_pipeline.py index f1e51a05e..cc462c21a 100644 --- a/buildstream/_pipeline.py +++ b/buildstream/_pipeline.py @@ -359,23 +359,14 @@ class Pipeline(): if inconsistent: detail = "Exact versions are missing for the following elements:\n\n" - - missingTrack = 0 for element in inconsistent: - detail += " " + element._get_full_name() + detail += " Element: {} is inconsistent\n".format(element._get_full_name()) for source in element.sources(): - if not source._get_consistency() and not source.get_ref(): - if hasattr(source, 'tracking') and source.tracking is None: - detail += ": Source {} is missing ref and track. ".format(source._get_full_name()) + \ - "Please specify a ref or branch/tag to track." - missingTrack = 1 - - detail += "\n" + if source._get_consistency() == Consistency.INCONSISTENT: + detail += " Source {} is missing ref\n".format(source) + detail += '\n' + detail += "Try tracking these elements first with `bst track`\n" - if missingTrack: - detail += "\nThen track these elements with `bst track`\n" - else: - detail += "\nTry tracking these elements first with `bst track`\n" raise PipelineError("Inconsistent pipeline", detail=detail, reason="inconsistent-pipeline") ############################################################# |