aboutsummaryrefslogtreecommitdiff
path: root/buildtools
diff options
context:
space:
mode:
Diffstat (limited to 'buildtools')
-rwxr-xr-xbuildtools/subst-vars.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/buildtools/subst-vars.py b/buildtools/subst-vars.py
new file mode 100755
index 00000000..5083c2dd
--- /dev/null
+++ b/buildtools/subst-vars.py
@@ -0,0 +1,28 @@
+# $Id$
+
+"""
+Copyright (C) 2011 SPARTA, Inc., dba Cobham Analytic Solutions
+
+Permission to use, copy, modify, and distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+"""
+
+
+import os, sys
+
+# pull out all AC_* environment variables into a dict to substitute in the input file
+d = {}
+for v in os.environ:
+ if v.startswith('AC_'):
+ d[v] = os.environ[v]
+
+sys.stdout.write(sys.stdin.read() % d)