From 9ee48c0a7ce6e7c497bba87c5702ac88d1373bfb Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 26 May 2017 07:02:51 +0000 Subject: 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 --- tool/runruby.rb | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'tool/runruby.rb') 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 -- cgit v1.2.3