diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-09-01 06:10:25 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-09-01 06:10:25 +0000 |
commit | c929094b31e1a59d7a752dabb0c0d2388638541b (patch) | |
tree | 1cb095abbfbf9b60c0ff7a656d10692289cbac71 | |
parent | e3590ddb8683963e6e1274915d18ca59432f6fdc (diff) | |
download | ruby-c929094b31e1a59d7a752dabb0c0d2388638541b.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-x | tool/rbinstall.rb | 8 |
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] |