summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2019-05-24 20:33:14 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2019-05-24 20:33:14 +0900
commit90116be6618c8fc04c70a22d9f6b941239350fcd (patch)
tree48904140a094e35bf78fccf85f141438059816cd /src
parent547681e5cc786c8447706b2fe7af814ba16b9f3f (diff)
downloadbuildstream-90116be6618c8fc04c70a22d9f6b941239350fcd.tar.gz
_loader/loader.py: Use Element._fetch() for junctionstristan/fix-workspaced-junctions
This is the canonical way to fetch sources, and now leverages the source cache if possible, better to do this rather than poking around into Element.sources() directly and reimplementing fetching in the loader.
Diffstat (limited to 'src')
-rw-r--r--src/buildstream/_loader/loader.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/buildstream/_loader/loader.py b/src/buildstream/_loader/loader.py
index 6287f84aa..5bd048707 100644
--- a/src/buildstream/_loader/loader.py
+++ b/src/buildstream/_loader/loader.py
@@ -534,14 +534,11 @@ class Loader():
# Handle the case where a subproject needs to be fetched
#
- sources = list(element.sources())
if element._get_consistency() == Consistency.RESOLVED:
if fetch_subprojects:
- for source in sources:
- if ticker:
- ticker(filename, 'Fetching subproject from {} source'.format(source.get_kind()))
- if source._get_consistency() != Consistency.CACHED:
- source._fetch()
+ if ticker:
+ ticker(filename, 'Fetching subproject')
+ element._fetch()
else:
detail = "Try fetching the project with `bst source fetch {}`".format(filename)
raise LoadError(LoadErrorReason.SUBPROJECT_FETCH_NEEDED,
@@ -556,6 +553,7 @@ class Loader():
"{}Subproject has no ref for junction: {}".format(provenance_str, filename),
detail=detail)
+ sources = list(element.sources())
workspace = element._get_workspace()
if workspace:
# If a workspace is open, load it from there instead