ruby-changes:34505
From: nobu <ko1@a...>
Date: Sat, 28 Jun 2014 00:35:29 +0900 (JST)
Subject: [ruby-changes:34505] nobu:r46586 (trunk): mkconfig.rb: fix empty prefix
nobu 2014-06-28 00:35:15 +0900 (Sat, 28 Jun 2014) New Revision: 46586 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=46586 Log: mkconfig.rb: fix empty prefix * tool/mkconfig.rb: fix empty RbConfig::CONFIG["prefix"] when configured --with-rubyarchprefix, remove prefix from rubyarchdir after expansion for the case it does not start with '$(prefix)'. [fix GH-643] Modified files: trunk/ChangeLog trunk/tool/mkconfig.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 46585) +++ ChangeLog (revision 46586) @@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Sat Jun 28 00:35:10 2014 Lauri Tirkkonen <lotheac@i...> + + * tool/mkconfig.rb: fix empty RbConfig::CONFIG["prefix"] when + configured --with-rubyarchprefix, remove prefix from rubyarchdir + after expansion for the case it does not start with '$(prefix)'. + [fix GH-643] + Fri Jun 27 15:20:12 2014 SHIBATA Hiroshi <shibata.hiroshi@g...> * lib/rubygems/test_case.rb: rescue Gem::LoadError in Gem::TestCase. Index: tool/mkconfig.rb =================================================================== --- tool/mkconfig.rb (revision 46585) +++ tool/mkconfig.rb (revision 46586) @@ -167,10 +167,10 @@ def vars.expand(val, config = self) https://github.com/ruby/ruby/blob/trunk/tool/mkconfig.rb#L167 val.replace(newval) unless newval == val val end -vars["prefix"] = "" -vars["exec_prefix"] = "" -prefix = vars.expand(vars["rubyarchdir"]) -print " TOPDIR = File.dirname(__FILE__).chomp!(#{prefix.dump})\n" +prefix = vars.expand(vars["prefix"]) +rubyarchdir = vars.expand(vars["rubyarchdir"]) +relative_archdir = rubyarchdir.rindex(prefix, 0) ? rubyarchdir[prefix.size..-1] : rubyarchdir +print " TOPDIR = File.dirname(__FILE__).chomp!(#{relative_archdir.dump})\n" print " DESTDIR = ", (drive ? "TOPDIR && TOPDIR[/\\A[a-z]:/i] || " : ""), "'' unless defined? DESTDIR\n" print <<'ARCH' if universal arch_flag = ENV['ARCHFLAGS'] || ((e = ENV['RC_ARCHS']) && e.split.uniq.map {|a| "-arch #{a}"}.join(' ')) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/