summaryrefslogtreecommitdiffstats
path: root/site_scons/site_tools/replace_strings.py
diff options
context:
space:
mode:
authorbradnelson@chromium.org <bradnelson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-04 19:35:47 +0000
committerbradnelson@chromium.org <bradnelson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-04 19:35:47 +0000
commit5a17959168f700202c3ee498e88cca7bcfa43a97 (patch)
treef0c8d497ded5551516310cebec76c3395880c19c /site_scons/site_tools/replace_strings.py
parentaedd85af7d7d0c90ed343ece4c66660db00841ec (diff)
downloadchromium_src-5a17959168f700202c3ee498e88cca7bcfa43a97.zip
chromium_src-5a17959168f700202c3ee498e88cca7bcfa43a97.tar.gz
chromium_src-5a17959168f700202c3ee498e88cca7bcfa43a97.tar.bz2
Pulling in hammer changes.
Review URL: http://codereview.chromium.org/13134 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6370 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'site_scons/site_tools/replace_strings.py')
-rw-r--r--site_scons/site_tools/replace_strings.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/site_scons/site_tools/replace_strings.py b/site_scons/site_tools/replace_strings.py
index c31f685..1c92772 100644
--- a/site_scons/site_tools/replace_strings.py
+++ b/site_scons/site_tools/replace_strings.py
@@ -46,7 +46,8 @@ def ReplaceStrings(target, source, env):
From env:
REPLACE_STRINGS: A list of pairs of regex search and replacement strings.
The body of the source file has substitution performed on each
- pair (search_regex, replacement) in order.
+ pair (search_regex, replacement) in order. SCons variables in the
+ replacement strings will be evaluated.
Returns:
The target node, a file with contents from source, with the substitutions
@@ -64,7 +65,7 @@ def ReplaceStrings(target, source, env):
fh.close()
# Do replacements.
for r in env['REPLACE_STRINGS']:
- text = re.sub(r[0], r[1], text)
+ text = re.sub(r[0], env.subst(r[1]), text)
# Write it out.
fh = open(target[0].abspath, 'wb')
fh.write(text)