summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-30 07:55:36 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-30 07:55:36 +0000
commit9ae3b070c12851600273463fff14bb79b101440d (patch)
tree949db184b25902d574bb3c8613031bc95831d663
parent99c8ded878ba60391fb5439a2b17adefa607a3dd (diff)
* tool/mkconfig.rb (RbConfig.expand): get rid of exceptions on
frozen strings unless really changed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rwxr-xr-xtool/mkconfig.rb8
2 files changed, 8 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index a8139240283..fd3d8826e1f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,7 @@
-Tue Jun 30 16:53:17 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Tue Jun 30 16:55:32 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * tool/mkconfig.rb (RbConfig.expand): get rid of exceptions on
+ frozen strings unless really changed.
* tool/file2lastrev.rb: get rid of global variables.
diff --git a/tool/mkconfig.rb b/tool/mkconfig.rb
index 116791dafe1..a66a20f3e8b 100755
--- a/tool/mkconfig.rb
+++ b/tool/mkconfig.rb
@@ -181,21 +181,21 @@ print <<EOS
MAKEFILE_CONFIG = {}
CONFIG.each{|k,v| MAKEFILE_CONFIG[k] = v.dup}
def RbConfig::expand(val, config = CONFIG)
- val.gsub!(/\\$\\$|\\$\\(([^()]+)\\)|\\$\\{([^{}]+)\\}/) do
+ newval = val.gsub(/\\$\\$|\\$\\(([^()]+)\\)|\\$\\{([^{}]+)\\}/) {
var = $&
if !(v = $1 || $2)
'$'
elsif key = config[v = v[/\\A[^:]+(?=(?::(.*?)=(.*))?\\z)/]]
pat, sub = $1, $2
config[v] = false
- RbConfig::expand(key, config)
- config[v] = key
+ config[v] = RbConfig::expand(key, config)
key = key.gsub(/\#{Regexp.quote(pat)}(?=\\s|\\z)/n) {sub} if pat
key
else
var
end
- end
+ }
+ val.replace(newval) unless newval == val
val
end
CONFIG.each_value do |val|