summaryrefslogtreecommitdiff
path: root/buildstream/_artifactcache
diff options
context:
space:
mode:
authorfinnball <finn.ball@codethink.com>2018-05-14 11:33:35 +0100
committerfinnball <finn.ball@codethink.com>2018-05-14 14:10:38 +0100
commitaa0964bc061388b6404bab40d1fbc84de5b010ec (patch)
tree7d6119a26f3b54fbfc74c8aea038809dda351d13 /buildstream/_artifactcache
parentb9dea6663be401c5afe8494332328509b9425098 (diff)
downloadbuildstream-kill_element_normal_name.tar.gz
Removed element.normal_name.kill_element_normal_name
This fixes issue #288.
Diffstat (limited to 'buildstream/_artifactcache')
-rw-r--r--buildstream/_artifactcache/artifactcache.py5
-rw-r--r--buildstream/_artifactcache/ostreecache.py2
-rw-r--r--buildstream/_artifactcache/tarcache.py6
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