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-22 16:35:30 +0100 |
commit | 3989ef02496afe8f65c438ab725f2b3233597cbe (patch) | |
tree | e0808726b40ae698a28a675a72c0c2b770f7bfa6 | |
parent | 6e4db048f8ad6a6d628a40517fb19fde6065a769 (diff) | |
download | buildstream-3989ef02496afe8f65c438ab725f2b3233597cbe.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 |