You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by tv...@apache.org on 2021/02/04 08:16:16 UTC
[buildstream] 08/09: cli.py: Handle the --remote option for pulling
artifacts
This is an automated email from the ASF dual-hosted git repository.
tvb pushed a commit to branch jennis/push_pull_artifacts
in repository https://gitbox.apache.org/repos/asf/buildstream.git
commit 6e12c3fe5d1067b97e1850355f4e69cc6905f8d4
Author: James Ennis <ja...@codethink.com>
AuthorDate: Tue Jan 15 12:52:49 2019 +0000
cli.py: Handle the --remote option for pulling artifacts
---
buildstream/_frontend/cli.py | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/buildstream/_frontend/cli.py b/buildstream/_frontend/cli.py
index 985f5d2..24012ba 100644
--- a/buildstream/_frontend/cli.py
+++ b/buildstream/_frontend/cli.py
@@ -1001,6 +1001,18 @@ def artifact_pull(app, artifacts, deps, remote):
remotes = usr_remotes + project_remotes
+ if remote: # Check if this is one of the available remotes
+ # Here we are restricting the user to only use a remote that is defined
+ # in either the project.conf or the user config, should the user be able to *try*
+ # and pull from any specified remote?
+ remote_found = False
+ for spec in remotes:
+ if remote == spec.url:
+ remotes = [spec]
+ remote_found = True
+ if not remote_found:
+ raise AppError("Remote: '{}' not found.".format(remote))
+
# Pull buildtrees?
excluded_subdirs = ["buildtree"] if app.context.pull_buildtrees else None