diff options
Diffstat (limited to 'buildstream/_artifactcache')
| -rw-r--r-- | buildstream/_artifactcache/artifactcache.py | 5 | ||||
| -rw-r--r-- | buildstream/_artifactcache/ostreecache.py | 2 | ||||
| -rw-r--r-- | buildstream/_artifactcache/tarcache.py | 6 |
3 files changed, 8 insertions, 5 deletions
diff --git a/buildstream/_artifactcache/artifactcache.py b/buildstream/_artifactcache/artifactcache.py index 9cc281524..ae7d23e48 100644 --- a/buildstream/_artifactcache/artifactcache.py +++ b/buildstream/_artifactcache/artifactcache.py @@ -97,9 +97,12 @@ class ArtifactCache(): valid_chars = string.digits + string.ascii_letters + '-._' element_name = ''.join([ x if x in valid_chars else '_' - for x in element.normal_name + for x in element.name ]) + if element_name.endswith('.bst'): + element_name = element_name[:-4] + assert key is not None # assume project and element names are not allowed to contain slashes diff --git a/buildstream/_artifactcache/ostreecache.py b/buildstream/_artifactcache/ostreecache.py index c802fc2e2..3424c7b14 100644 --- a/buildstream/_artifactcache/ostreecache.py +++ b/buildstream/_artifactcache/ostreecache.py @@ -100,7 +100,7 @@ class OSTreeCache(ArtifactCache): # Extracting a nonexistent artifact is a bug assert rev, "Artifact missing for {}".format(ref) - dest = os.path.join(self.extractdir, element._get_project().name, element.normal_name, rev) + dest = os.path.join(self.extractdir, element._get_project().name, element.name, rev) if os.path.isdir(dest): # artifact has already been extracted return dest diff --git a/buildstream/_artifactcache/tarcache.py b/buildstream/_artifactcache/tarcache.py index 10ae9d008..3b8f0243b 100644 --- a/buildstream/_artifactcache/tarcache.py +++ b/buildstream/_artifactcache/tarcache.py @@ -46,7 +46,7 @@ class TarCache(ArtifactCache): return os.path.isfile(path) def commit(self, element, content, keys): - os.makedirs(os.path.join(self.tardir, element._get_project().name, element.normal_name), exist_ok=True) + os.makedirs(os.path.join(self.tardir, element._get_project().name, element.name), exist_ok=True) with utils._tempdir() as temp: for key in keys: @@ -75,7 +75,7 @@ class TarCache(ArtifactCache): with utils._tempdir(dir=self.extractdir) as tmpdir: _Tar.extract(os.path.join(self.tardir, path), tmpdir) - os.makedirs(os.path.join(self.extractdir, element._get_project().name, element.normal_name), + os.makedirs(os.path.join(self.extractdir, element._get_project().name, element.name), exist_ok=True) try: os.rename(os.path.join(tmpdir, key), dest) @@ -105,7 +105,7 @@ class TarCache(ArtifactCache): # def _tarpath(element, key): project = element._get_project() - return os.path.join(project.name, element.normal_name, key + '.tar.bz2') + return os.path.join(project.name, element.name, key + '.tar.bz2') # A helper class that contains tar archive/extract functions |
