summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--morphlib/artifact.py6
-rw-r--r--morphlib/builder2.py1
-rw-r--r--morphlib/cachekeycomputer.py3
3 files changed, 6 insertions, 4 deletions
diff --git a/morphlib/artifact.py b/morphlib/artifact.py
index 2f9c65df..20fdb185 100644
--- a/morphlib/artifact.py
+++ b/morphlib/artifact.py
@@ -24,9 +24,11 @@ class Artifact(object):
* ``name`` -- the name of the artifact
* ``cache_key`` -- a cache key to uniquely identify the artifact
* ``cache_id`` -- a dict describing the components of the cache key
- * ``contents`` -- a list of the installed files or chunks in the artifact
* ``dependencies`` -- list of Artifacts that need to be built beforehand
* ``dependents`` -- list of Artifacts that need this Artifact to be built
+ * ``metadata_version`` -- When the format of the artifact metadata
+ changes, this version number is raised causing
+ any existing cached artifacts to be invalidated
The ``dependencies`` and ``dependents`` lists MUST be modified by
the ``add_dependencies`` and ``add_dependent`` methods only.
@@ -40,7 +42,7 @@ class Artifact(object):
self.cache_key = None
self.dependencies = []
self.dependents = []
- self.contents = []
+ self.metadata_version = 1
def add_dependency(self, artifact):
'''Add ``artifact`` to the dependency list.'''
diff --git a/morphlib/builder2.py b/morphlib/builder2.py
index cff74a8e..086b3033 100644
--- a/morphlib/builder2.py
+++ b/morphlib/builder2.py
@@ -215,7 +215,6 @@ class BuilderBase(object):
'version': morphlib.gitversion.version,
},
'contents': contents,
- 'metadata-version': 1,
}
return meta
diff --git a/morphlib/cachekeycomputer.py b/morphlib/cachekeycomputer.py
index 6acf654b..d7e2e3b1 100644
--- a/morphlib/cachekeycomputer.py
+++ b/morphlib/cachekeycomputer.py
@@ -81,7 +81,8 @@ class CacheKeyComputer(object):
keys = {
'env': self._filterenv(self._build_env.env),
'filename': artifact.source.filename,
- 'kids': [self.compute_key(x) for x in artifact.dependencies]
+ 'kids': [self.compute_key(x) for x in artifact.dependencies],
+ 'metadata-version': artifact.metadata_version
}
kind = artifact.source.morphology['kind']