From 105c0dbbd14626a832ebc036c02bc0c9c60e43bc Mon Sep 17 00:00:00 2001 From: Jannis Pohlmann Date: Wed, 18 Apr 2012 16:49:24 +0100 Subject: 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. --- morphlib/localartifactcache.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'morphlib/localartifactcache.py') 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) -- cgit v1.2.1