summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2019-02-25 07:59:23 +0100
committerAbderrahim Kitouni <akitouni@gnome.org>2020-08-26 12:47:05 +0100
commitbc852517e2fb8e36f0e26f92ce9c7b818516da6a (patch)
tree7cc55e35a693ab4b95cdde7cf22304e145463323
parent0ebc88c952bb64b857f5e9ca6b8a460861f7412d (diff)
downloadbuildstream-bc852517e2fb8e36f0e26f92ce9c7b818516da6a.tar.gz
element.py: Use virtual artifact directory for metadata
-rw-r--r--buildstream/element.py30
1 files changed, 15 insertions, 15 deletions
diff --git a/buildstream/element.py b/buildstream/element.py
index e7832beff..71ffbfea9 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -2552,7 +2552,7 @@ class Element(Plugin):
def __get_artifact_metadata_keys(self, key=None):
# Now extract it and possibly derive the key
- artifact_base, key = self.__extract(key)
+ artifact_vdir, key = self.__get_artifact_directory(key)
# Now try the cache, once we're sure about the key
if key in self.__metadata_keys:
@@ -2560,8 +2560,8 @@ class Element(Plugin):
self.__metadata_keys[key]['weak'])
# Parse the expensive yaml now and cache the result
- meta_file = os.path.join(artifact_base, 'meta', 'keys.yaml')
- meta = _yaml.load(meta_file)
+ meta_file = artifact_vdir._objpath(['meta', 'keys.yaml'])
+ meta = _yaml.load(meta_file, shortname='meta/keys.yaml')
strong_key = meta['strong']
weak_key = meta['weak']
@@ -2584,15 +2584,15 @@ class Element(Plugin):
def __get_artifact_metadata_dependencies(self, key=None):
# Extract it and possibly derive the key
- artifact_base, key = self.__extract(key)
+ artifact_vdir, key = self.__get_artifact_directory(key)
# Now try the cache, once we're sure about the key
if key in self.__metadata_dependencies:
return self.__metadata_dependencies[key]
# Parse the expensive yaml now and cache the result
- meta_file = os.path.join(artifact_base, 'meta', 'dependencies.yaml')
- meta = _yaml.load(meta_file)
+ meta_file = artifact_vdir._objpath(['meta', 'dependencies.yaml'])
+ meta = _yaml.load(meta_file, shortname='meta/dependencies.yaml')
# Cache it under both strong and weak keys
strong_key, weak_key = self.__get_artifact_metadata_keys(key)
@@ -2613,15 +2613,15 @@ class Element(Plugin):
def __get_artifact_metadata_workspaced(self, key=None):
# Extract it and possibly derive the key
- artifact_base, key = self.__extract(key)
+ artifact_vdir, key = self.__get_artifact_directory(key)
# Now try the cache, once we're sure about the key
if key in self.__metadata_workspaced:
return self.__metadata_workspaced[key]
# Parse the expensive yaml now and cache the result
- meta_file = os.path.join(artifact_base, 'meta', 'workspaced.yaml')
- meta = _yaml.load(meta_file)
+ meta_file = artifact_vdir._objpath(['meta', 'workspaced.yaml'])
+ meta = _yaml.load(meta_file, shortname='meta/workspaced.yaml')
workspaced = meta['workspaced']
# Cache it under both strong and weak keys
@@ -2643,15 +2643,15 @@ class Element(Plugin):
def __get_artifact_metadata_workspaced_dependencies(self, key=None):
# Extract it and possibly derive the key
- artifact_base, key = self.__extract(key)
+ artifact_vdir, key = self.__get_artifact_directory(key)
# Now try the cache, once we're sure about the key
if key in self.__metadata_workspaced_dependencies:
return self.__metadata_workspaced_dependencies[key]
# Parse the expensive yaml now and cache the result
- meta_file = os.path.join(artifact_base, 'meta', 'workspaced-dependencies.yaml')
- meta = _yaml.load(meta_file)
+ meta_file = artifact_vdir._objpath(['meta', 'workspaced-dependencies.yaml'])
+ meta = _yaml.load(meta_file, shortname='meta/workspaced-dependencies.yaml')
workspaced = meta['workspaced-dependencies']
# Cache it under both strong and weak keys
@@ -2669,9 +2669,9 @@ class Element(Plugin):
assert self.__dynamic_public is None
# Load the public data from the artifact
- artifact_base, _ = self.__extract()
- metadir = os.path.join(artifact_base, 'meta')
- self.__dynamic_public = _yaml.load(os.path.join(metadir, 'public.yaml'))
+ artifact_vdir, _ = self.__get_artifact_directory()
+ meta_file = artifact_vdir._objpath(['meta', 'public.yaml'])
+ self.__dynamic_public = _yaml.load(meta_file, shortname='meta/public.yaml')
def __get_cache_keys_for_commit(self):
keys = []