1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
nobu 2009-06-30 07:55:36 +00:00
parent 99c8ded878
commit 9ae3b070c1
2 changed files with 8 additions and 5 deletions

View file

@ -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.

View file

@ -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|