summaryrefslogtreecommitdiff
path: root/morphlib/cachekeycomputer.py
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2014-01-08 14:29:14 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2014-01-16 16:58:24 +0000
commit90678ea8f8a0cbb95c049ef1fad9f40c3a2122a7 (patch)
tree5addd1f80f3890cad8b4967b7871768a4d918b84 /morphlib/cachekeycomputer.py
parentb5e881996901e9b5646afc58b7c7dadc82491059 (diff)
downloadmorph-90678ea8f8a0cbb95c049ef1fad9f40c3a2122a7.tar.gz
CacheKeyComputer: Include split rules in computation
Chunk artifacts need the [(artifact_name, [regular_expression])] so that if the default split rules change, or the blending rule changes, then an extra version field doesn't need to be added to the cache key computer. This is for future plans to allow the split rules to be configurable and allow us to more easily change them. System and Stratum artifact computations don't need this, since those splitting rules are already expressed in the dependencies information.
Diffstat (limited to 'morphlib/cachekeycomputer.py')
-rw-r--r--morphlib/cachekeycomputer.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/morphlib/cachekeycomputer.py b/morphlib/cachekeycomputer.py
index d7e2e3b1..2312abc3 100644
--- a/morphlib/cachekeycomputer.py
+++ b/morphlib/cachekeycomputer.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2013 Codethink Limited
+# Copyright (C) 2012-2014 Codethink Limited
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -90,6 +90,8 @@ class CacheKeyComputer(object):
keys['build-mode'] = artifact.source.build_mode
keys['prefix'] = artifact.source.prefix
keys['tree'] = artifact.source.tree
+ keys['split-rules'] = [(a, [rgx.pattern for rgx in r._regexes])
+ for (a, r) in artifact.source.split_rules]
elif kind in ('system', 'stratum'):
morphology = artifact.source.morphology
le_dict = dict((k, morphology[k]) for k in morphology.keys())