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

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.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2016-09-01 06:10:25 +00:00
parent e3590ddb86
commit c929094b31

View file

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