diff options
author | James Ennis <james.ennis@codethink.co.uk> | 2019-08-21 14:32:18 +0100 |
---|---|---|
committer | James Ennis <james.ennis@codethink.co.uk> | 2019-08-27 12:12:13 +0100 |
commit | a94218bb5d37533551bcf24623d951b5a4463bf7 (patch) | |
tree | 79df4191d3cf09540bbcbe98aeaa840821acd8f4 | |
parent | 1e614545c490e0d2cbefc93c8142fd451557bc0f (diff) | |
download | buildstream-a94218bb5d37533551bcf24623d951b5a4463bf7.tar.gz |
_stream.py: Validate selection for target artifacts in _load()
-rw-r--r-- | src/buildstream/_stream.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/buildstream/_stream.py b/src/buildstream/_stream.py index 092b96128..fc83156f5 100644 --- a/src/buildstream/_stream.py +++ b/src/buildstream/_stream.py @@ -1158,9 +1158,12 @@ class Stream(): # Classify element and artifact strings target_elements, target_artifacts = self._classify_artifacts(targets) - if target_artifacts and not load_refs: - detail = '\n'.join(target_artifacts) - raise ArtifactElementError("Cannot perform this operation with artifact refs:", detail=detail) + if target_artifacts: + if not load_refs: + detail = '\n'.join(target_artifacts) + raise ArtifactElementError("Cannot perform this operation with artifact refs:", detail=detail) + if selection in (PipelineSelection.ALL, PipelineSelection.RUN): + raise StreamError("Error: '--deps {}' is not supported for artifact refs".format(selection)) # Load rewritable if we have any tracking selection to make rewritable = False |