summaryrefslogtreecommitdiff
path: root/tool/runruby.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-26 07:02:51 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-26 07:02:51 +0000
commit9ee48c0a7ce6e7c497bba87c5702ac88d1373bfb (patch)
tree2dbc6299d1d6dce0ef6c9ed5eefd4513ccab205b /tool/runruby.rb
parent10ee38b6bc0b3a2dcb9a52dc4ef80de95e03eb9a (diff)
runruby.rb: no PRELOAD on multiarch [ci skip]
* tool/runruby.rb: do not set environment to preload on multiarch platforms, otherwise other external commands (e.g., /bin/sh) fail to run. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58900 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/runruby.rb')
-rwxr-xr-xtool/runruby.rb18
1 files changed, 10 insertions, 8 deletions
diff --git a/tool/runruby.rb b/tool/runruby.rb
index 9329ef72b6..74362338cc 100755
--- a/tool/runruby.rb
+++ b/tool/runruby.rb
@@ -70,8 +70,8 @@ config["bindir"] = abs_archdir
env = {}
runner = File.join(abs_archdir, "ruby-runner#{config['EXEEXT']}")
-runner = File.expand_path(ruby) unless File.exist?(runner)
-env["RUBY"] = runner
+runner = nil unless File.exist?(runner)
+env["RUBY"] = runner || File.expand_path(ruby)
env["PATH"] = [abs_archdir, ENV["PATH"]].compact.join(File::PATH_SEPARATOR)
if e = ENV["RUBYLIB"]
@@ -84,12 +84,14 @@ if File.file?(libruby_so)
if e = config['LIBPATHENV'] and !e.empty?
env[e] = [abs_archdir, ENV[e]].compact.join(File::PATH_SEPARATOR)
end
- if e = config['PRELOADENV']
- e = nil if e.empty?
- e ||= "LD_PRELOAD" if /linux/ =~ RUBY_PLATFORM
- end
- if e
- env[e] = [libruby_so, ENV[e]].compact.join(File::PATH_SEPARATOR)
+ unless runner
+ if e = config['PRELOADENV']
+ e = nil if e.empty?
+ e ||= "LD_PRELOAD" if /linux/ =~ RUBY_PLATFORM
+ end
+ if e
+ env[e] = [libruby_so, ENV[e]].compact.join(File::PATH_SEPARATOR)
+ end
end
end