mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* runruby.rb: refactored to modify ENV as once.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0c835afac0
commit
9216dd7e32
2 changed files with 17 additions and 5 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
Sun Dec 28 00:43:33 2008 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* runruby.rb: refactored to modify ENV as once.
|
||||||
|
|
||||||
Sat Dec 27 22:41:02 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Sat Dec 27 22:41:02 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* test/rdoc/test_rdoc_info_formatting.rb (setup, teadown): uses
|
* test/rdoc/test_rdoc_info_formatting.rb (setup, teadown): uses
|
||||||
|
|
18
runruby.rb
18
runruby.rb
|
@ -44,28 +44,36 @@ if extout
|
||||||
end
|
end
|
||||||
libs << File.expand_path("lib", srcdir)
|
libs << File.expand_path("lib", srcdir)
|
||||||
config["bindir"] = abs_archdir
|
config["bindir"] = abs_archdir
|
||||||
ENV["RUBY"] = File.expand_path(ruby)
|
|
||||||
ENV["PATH"] = [abs_archdir, ENV["PATH"]].compact.join(File::PATH_SEPARATOR)
|
env = {}
|
||||||
|
|
||||||
|
env["RUBY"] = File.expand_path(ruby)
|
||||||
|
env["PATH"] = [abs_archdir, ENV["PATH"]].compact.join(File::PATH_SEPARATOR)
|
||||||
|
|
||||||
if pure
|
if pure
|
||||||
libs << File.expand_path("ext", srcdir) << "-"
|
libs << File.expand_path("ext", srcdir) << "-"
|
||||||
elsif e = ENV["RUBYLIB"]
|
elsif e = ENV["RUBYLIB"]
|
||||||
libs |= e.split(File::PATH_SEPARATOR)
|
libs |= e.split(File::PATH_SEPARATOR)
|
||||||
end
|
end
|
||||||
ENV["RUBYLIB"] = $:.replace(libs).join(File::PATH_SEPARATOR)
|
env["RUBYLIB"] = $:.replace(libs).join(File::PATH_SEPARATOR)
|
||||||
|
|
||||||
libruby_so = File.join(abs_archdir, config['LIBRUBY_SO'])
|
libruby_so = File.join(abs_archdir, config['LIBRUBY_SO'])
|
||||||
if File.file?(libruby_so)
|
if File.file?(libruby_so)
|
||||||
if e = config['LIBPATHENV'] and !e.empty?
|
if e = config['LIBPATHENV'] and !e.empty?
|
||||||
ENV[e] = [abs_archdir, ENV[e]].compact.join(File::PATH_SEPARATOR)
|
env[e] = [abs_archdir, ENV[e]].compact.join(File::PATH_SEPARATOR)
|
||||||
end
|
end
|
||||||
if /linux/ =~ RUBY_PLATFORM
|
if /linux/ =~ RUBY_PLATFORM
|
||||||
ENV["LD_PRELOAD"] = [libruby_so, ENV["LD_PRELOAD"]].compact.join(' ')
|
env["LD_PRELOAD"] = [libruby_so, ENV["LD_PRELOAD"]].compact.join(' ')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
ENV.update env
|
||||||
|
|
||||||
cmd = [ruby]
|
cmd = [ruby]
|
||||||
cmd << "-rpurelib.rb" if pure
|
cmd << "-rpurelib.rb" if pure
|
||||||
cmd.concat(ARGV)
|
cmd.concat(ARGV)
|
||||||
cmd.unshift(*debugger) if debugger
|
cmd.unshift(*debugger) if debugger
|
||||||
|
|
||||||
|
#require 'shellwords'; puts Shellwords.join(env.map {|k,v| "#{k}=#{v}" } + cmd)
|
||||||
|
|
||||||
exec(*cmd)
|
exec(*cmd)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue