diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-11-09 22:20:12 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-11-09 22:20:12 +0000 |
commit | 536e266e58e6fda550e781d7a88317fdfe149cfa (patch) | |
tree | 5f8b7d80d8817989496ab5eb36cd1c64815de0be /tool/rbinstall.rb | |
parent | 5ddcc93a3f9ffaeed5a78aa0fa7a847880102600 (diff) | |
download | ruby-536e266e58e6fda550e781d7a88317fdfe149cfa.tar.gz |
* cygwin/GNUmakefile.in (scriptbin): make executable file from
scripts with stub.
* ruby.c (load_file_internal): assume xflag for exe file as well
as no-shebang file.
* tool/rbinstall.rb: install script programs.
* win32/mkexports.rb (Exports#initialize): alias ruby_sysinit for
stub.
* win32/stub.c: stub for scripts. [EXPERIMENTAL]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/rbinstall.rb')
-rwxr-xr-x | tool/rbinstall.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb index eec790b3ee..908b586934 100755 --- a/tool/rbinstall.rb +++ b/tool/rbinstall.rb @@ -36,7 +36,9 @@ def parse_args(argv = ARGV) $dir_mode = nil $script_mode = nil $strip = false - $cmdtype = ('bat' if File::ALT_SEPARATOR == '\\') + $cmdtype = (if File::ALT_SEPARATOR == '\\' + File.exist?("rubystub.exe") ? 'exe' : 'bat' + end) mflags = [] opt = OptionParser.new opt.on('-n', '--dry-run') {$dryrun = true} @@ -405,6 +407,9 @@ install?(:local, :comm, :bin, :'bin-comm') do ruby_shebang = File.join(bindir, ruby_install_name) if File::ALT_SEPARATOR ruby_bin = ruby_shebang.tr(File::SEPARATOR, File::ALT_SEPARATOR) + if $cmdtype == 'exe' + stub = File.open("rubystub.exe", "rb") {|f| f.read} << "\n" rescue nil + end end if trans = CONFIG["program_transform_name"] exp = [] @@ -456,6 +461,8 @@ install?(:local, :comm, :bin, :'bin-comm') do cmd << ".#{$cmdtype}" if $cmdtype open_for_install(cmd, $script_mode) do case $cmdtype + when "exe" + stub + shebang + body when "bat" [<<-"EOH".gsub(/^\s+/, ''), shebang, body, "__END__\n:endofruby\n"].join.gsub(/$/, "\r") @echo off |