summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Ennis <james.ennis@codethink.co.uk>2019-08-28 13:03:27 +0100
committerbst-marge-bot <marge-bot@buildstream.build>2019-09-05 12:14:53 +0000
commitf35bf5125a776738adb173cfbd01336666a6e076 (patch)
treeeb9bbf1b1ecaaa9ce9906039ff4cc637d5fdc1d3
parentd9e1055d0946a34f9903369522881c8b53f49671 (diff)
downloadbuildstream-f35bf5125a776738adb173cfbd01336666a6e076.tar.gz
cli.py: Clean up dependency scope handling in checkout
-rw-r--r--src/buildstream/_frontend/cli.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/buildstream/_frontend/cli.py b/src/buildstream/_frontend/cli.py
index 132f7f71a..5333be2ea 100644
--- a/src/buildstream/_frontend/cli.py
+++ b/src/buildstream/_frontend/cli.py
@@ -1102,23 +1102,17 @@ def artifact_checkout(app, force, deps, integrate, hardlinks, tar, compression,
if not compression:
compression = inferred_compression
- if deps == "build":
- scope = Scope.BUILD
- elif deps == "none":
- scope = Scope.NONE
- else:
- scope = Scope.RUN
-
with app.initialized():
if not element:
element = app.project.get_default_target()
if not element:
raise AppError('Missing argument "ELEMENT".')
+ scope = {'run': Scope.RUN, 'build': Scope.BUILD, 'none': Scope.NONE}
app.stream.checkout(element,
location=location,
force=force,
- scope=scope,
+ scope=scope[deps],
integrate=True if integrate is None else integrate,
hardlinks=hardlinks,
pull=pull_,