summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2014-01-22 14:48:29 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2014-01-22 15:48:06 +0000
commite30b0c73cb6805689c58b3ed9d5dd091218e2df3 (patch)
tree44ad4e0a87c20cfd1635c691dbbb26c99a66bdd9 /scripts
parent52e2b4aa1463e0247b6d1ef1653bbacc5dc0e02c (diff)
downloadmorph-e30b0c73cb6805689c58b3ed9d5dd091218e2df3.tar.gz
yarns: Add regression test for cache-key clash
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/edit-morph18
1 files changed, 18 insertions, 0 deletions
diff --git a/scripts/edit-morph b/scripts/edit-morph
index acb33b7e..2970cc6e 100755
--- a/scripts/edit-morph
+++ b/scripts/edit-morph
@@ -227,4 +227,22 @@ class EditMorph(cliapp.Application):
with open(file_path, "w") as f:
yaml.dump(d, f)
+ def cmd_set_stratum_match_rules(self, (file_path, match_rules)):
+ '''Set a stratum's match rules.
+
+ Usage: FILE_PATH MATCH_RULES_YAML
+
+ This sets the stratum's "products" field, which is used to
+ determine which chunk artifacts go into which stratum artifacts
+ the stratum produces.
+
+ The match rules must be a string that yaml can parse.
+
+ '''
+ with open(file_path, "r") as f:
+ d = yaml.load(f)
+ d['products'] = yaml.load(match_rules)
+ with open(file_path, "w") as f:
+ yaml.dump(d, f)
+
EditMorph().run()