summaryrefslogtreecommitdiff
path: root/buildstream/_artifactcache/artifactcache.py
diff options
context:
space:
mode:
Diffstat (limited to 'buildstream/_artifactcache/artifactcache.py')
-rw-r--r--buildstream/_artifactcache/artifactcache.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/buildstream/_artifactcache/artifactcache.py b/buildstream/_artifactcache/artifactcache.py
index a5321b528..6f95586fc 100644
--- a/buildstream/_artifactcache/artifactcache.py
+++ b/buildstream/_artifactcache/artifactcache.py
@@ -61,6 +61,8 @@ class ArtifactCache():
else:
self.remote = None
+ self.__remote_refs = None
+
# contains():
#
# Check whether the artifact for the specified Element is already available
@@ -236,6 +238,20 @@ class ArtifactCache():
raise _ArtifactError("Failed to pull artifact for element {}: {}"
.format(element.name, e)) from e
+ # fetch_remote_refs():
+ #
+ # Fetch list of artifacts from remote repository.
+ #
+ def fetch_remote_refs(self):
+ if self.context.artifact_pull.startswith("/"):
+ remote = "file://" + self.context.artifact_pull
+ elif self.remote is not None:
+ remote = self.remote
+ else:
+ raise _ArtifactError("Attempt to fetch remote refs without any pull URL")
+
+ self.__remote_refs = _ostree.list_remote_refs(self.repo, remote=remote)
+
# can_push():
#
# Check whether remote repository is available for pushing.