From 8307902395d075e834a53e4c7d87cd31c0fe863e Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Thu, 26 Sep 2013 12:12:25 +0000 Subject: Move helper script to scripts for use in cmdtests --- scripts/nullify-local-refs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 scripts/nullify-local-refs (limited to 'scripts') diff --git a/scripts/nullify-local-refs b/scripts/nullify-local-refs new file mode 100755 index 00000000..5db5c587 --- /dev/null +++ b/scripts/nullify-local-refs @@ -0,0 +1,18 @@ +#!/usr/bin/python + +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) -- cgit v1.2.1