ruby-changes:12227
From: nobu <ko1@a...>
Date: Tue, 30 Jun 2009 16:55:52 +0900 (JST)
Subject: [ruby-changes:12227] Ruby:r23913 (trunk): * tool/mkconfig.rb (RbConfig.expand): get rid of exceptions on
nobu 2009-06-30 16:55:36 +0900 (Tue, 30 Jun 2009) New Revision: 23913 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=23913 Log: * tool/mkconfig.rb (RbConfig.expand): get rid of exceptions on frozen strings unless really changed. Modified files: trunk/ChangeLog trunk/tool/mkconfig.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 23912) +++ ChangeLog (revision 23913) @@ -1,5 +1,8 @@ -Tue Jun 30 16:53:17 2009 Nobuyoshi Nakada <nobu@r...> +Tue Jun 30 16:55:32 2009 Nobuyoshi Nakada <nobu@r...> + * tool/mkconfig.rb (RbConfig.expand): get rid of exceptions on + frozen strings unless really changed. + * tool/file2lastrev.rb: get rid of global variables. * tool/compile_prelude.rb: use US-ASCII name. Index: tool/mkconfig.rb =================================================================== --- tool/mkconfig.rb (revision 23912) +++ tool/mkconfig.rb (revision 23913) @@ -181,21 +181,21 @@ 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| -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/