aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-01 06:10:25 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-01 06:10:25 +0000
commit29530757d471c786afa57c2bd147e2fe6dcde7dd (patch)
tree1cb095abbfbf9b60c0ff7a656d10692289cbac71
parent23819ba46addef53e57cc4f5e21743ebb5917d36 (diff)
downloadruby-29530757d471c786afa57c2bd147e2fe6dcde7dd.tar.gz
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
-rwxr-xr-xtool/rbinstall.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb
index 5cab72fd2b..0d7ec57912 100755
--- a/tool/rbinstall.rb
+++ b/tool/rbinstall.rb
@@ -418,16 +418,16 @@ install?(:doc, :capi) do
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]