summaryrefslogtreecommitdiff
path: root/morphlib/localartifactcache.py
diff options
context:
space:
mode:
authorJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-04-18 16:49:24 +0100
committerJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-04-18 16:49:24 +0100
commit105c0dbbd14626a832ebc036c02bc0c9c60e43bc (patch)
tree9e9398e9e4d4bc8da54a63094142f941b881419e /morphlib/localartifactcache.py
parent605e21914f8c9536ff42ca31043b26200dab85e2 (diff)
downloadmorph-105c0dbbd14626a832ebc036c02bc0c9c60e43bc.tar.gz
Remove BuildGraph, compute cache keys based on Artifacts.
With this commit, the ArtifactResolver no longer computes the cache keys when creating Artifact objects. This will have to happen as a post-resolving step (e.g. prior to building or checking whether a local or remote artifact cache has any of the resolved artifacts). The CacheKeyComputer now takes an Artifact object and computes the cache keys using its dependencies. BuildGraph is no longer needed for the CacheKeyComputer unit tests.
Diffstat (limited to 'morphlib/localartifactcache.py')
-rw-r--r--morphlib/localartifactcache.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/morphlib/localartifactcache.py b/morphlib/localartifactcache.py
index 52b5772c..cf025210 100644
--- a/morphlib/localartifactcache.py
+++ b/morphlib/localartifactcache.py
@@ -60,17 +60,12 @@ class LocalArtifactCache(object):
filename = self._source_metadata_filename(source, cachekey, name)
return open(filename)
- def _artifact_basename(self, artifact):
- return '%s.%s.%s' % (artifact.cache_key,
- artifact.source.morphology['kind'],
- artifact.name)
-
def _artifact_filename(self, artifact):
- basename = self._artifact_basename(artifact)
+ basename = artifact.basename()
return os.path.join(self.cachedir, basename)
def _artifact_metadata_filename(self, artifact, name):
- basename = '%s.%s' % (self._artifact_basename(artifact), name)
+ basename = '%s.%s' % (artifact.basename(), name)
return os.path.join(self.cachedir, basename)