[前][次][番号順一覧][スレッド一覧]

ruby-changes:43982

From: nobu <ko1@a...>
Date: Thu, 1 Sep 2016 15:10:29 +0900 (JST)
Subject: [ruby-changes:43982] nobu:r56055 (trunk): rbinstall.rb: prefix with space [ci skip]

nobu	2016-09-01 15:10:25 +0900 (Thu, 01 Sep 2016)

  New Revision: 56055

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56055

  Log:
    rbinstall.rb: prefix with space [ci skip]
    
    * tool/rbinstall.rb (bin): exec via /bin/sh if the prefix contains
      space charaters, because shebang does not support that case in
      general.

  Modified files:
    trunk/tool/rbinstall.rb
Index: tool/rbinstall.rb
===================================================================
--- tool/rbinstall.rb	(revision 56054)
+++ tool/rbinstall.rb	(revision 56055)
@@ -418,16 +418,16 @@ install?(:doc, :capi) do https://github.com/ruby/ruby/blob/trunk/tool/rbinstall.rb#L418
   install_recursive "doc/capi", docdir+"/capi", :mode => $data_mode
 end
 
-if load_relative
+if load_relative or /\s/ =~ bindir
   PROLOG_SCRIPT = <<EOS
 #!/bin/sh\n# -*- ruby -*-
-bindir="${0%/*}"
+bindir="#{load_relative ? '${0%/*}' : bindir.gsub(/\"/, '\\\\"')}"
 EOS
   if CONFIG["LIBRUBY_RELATIVE"] != 'yes' and libpathenv = CONFIG["LIBPATHENV"]
     pathsep = File::PATH_SEPARATOR
     PROLOG_SCRIPT << <<EOS
-prefix="${bindir%/bin}"
-export #{libpathenv}="$prefix/lib${#{libpathenv}:+#{pathsep}$#{libpathenv}}"
+libdir="#{load_relative ? '${bindir%/bin}/lib' : libdir.gsub(/\"/, '\\\\"')}"
+export #{libpathenv}="$libdir${#{libpathenv}:+#{pathsep}$#{libpathenv}}"
 EOS
   end
   PROLOG_SCRIPT << %Q[exec "$bindir/#{ruby_install_name}" -x "$0" "$@"\n]

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]