diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2013-09-26 11:20:34 +0000 |
---|---|---|
committer | Richard Maw <richard.maw@codethink.co.uk> | 2013-09-26 11:21:09 +0000 |
commit | 151050c5b15e83cbfc6ac9fcd786dcb957022185 (patch) | |
tree | c3da24c1a3d3b2f2f76fb7c012cd7149d8729262 /yarns/morph.shell-lib | |
parent | 6a216934edb2423c9aa347329ea029041927a413 (diff) | |
download | morph-151050c5b15e83cbfc6ac9fcd786dcb957022185.tar.gz |
Make branch commands work with null refs
Diffstat (limited to 'yarns/morph.shell-lib')
-rw-r--r-- | yarns/morph.shell-lib | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/yarns/morph.shell-lib b/yarns/morph.shell-lib index 4fb1eb10..41ffbbbd 100644 --- a/yarns/morph.shell-lib +++ b/yarns/morph.shell-lib @@ -144,6 +144,27 @@ assert_morphologies_are_petrified() } +nullify_local_refs() +{ + python -c 'import yaml, sys +repo = sys.argv[1] +ref = sys.argv[2] +for filename in sys.argv[3:]: + with open(filename, "r") as f: + d = yaml.load(f) + if "strata" in d: + for spec in d["strata"]: + if spec["repo"] == repo and spec["ref"] == ref: + spec["repo"] = spec["ref"] = None + if "build-depends" in d: + for spec in d["build-depends"]: + if spec["repo"] == repo and spec["ref"] == ref: + spec["repo"] = spec["ref"] = None + with open(filename, "w") as f: + yaml.dump(d, f) +' "$@" +} + # Currently, yarn isn't setting $SRCDIR to point at the project source # directory. We simulate this here. |