1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* instruby.rb: Rewrite installed scripts' shebang lines.

* instruby.rb: Use File.join() where appropriate.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
knu 2002-11-18 17:26:03 +00:00
parent c3a31863c5
commit c15d3e6bff
2 changed files with 27 additions and 10 deletions

View file

@ -1,3 +1,9 @@
Tue Nov 19 02:24:10 2002 Akinori MUSHA <knu@iDaemons.org>
* instruby.rb: Rewrite installed scripts' shebang lines.
* instruby.rb: Use File.join() where appropriate.
Tue Nov 19 01:53:35 2002 Akinori MUSHA <knu@iDaemons.org>
* bin/irb: Moved from sample/irb.rb.

View file

@ -18,7 +18,7 @@ while arg = ARGV.shift
end
destdir ||= ''
$:.unshift CONFIG["srcdir"]+"/lib"
$:.unshift File.join(CONFIG["srcdir"], "lib")
require 'ftools'
require 'shellwords'
@ -66,7 +66,7 @@ rubylibdir = destdir+CONFIG["rubylibdir"]
archlibdir = destdir+CONFIG["archdir"]
sitelibdir = destdir+CONFIG["sitelibdir"]
sitearchlibdir = destdir+CONFIG["sitearchdir"]
mandir = destdir+CONFIG["mandir"] + "/man1"
mandir = File.join(destdir+CONFIG["mandir"], "man1")
configure_args = Shellwords.shellwords(CONFIG["configure_args"])
enable_shared = CONFIG["ENABLE_SHARED"] == 'yes'
dll = CONFIG["LIBRUBY_SO"]
@ -75,7 +75,7 @@ arc = CONFIG["LIBRUBY_A"]
Installer.makedirs bindir, libdir, rubylibdir, archlibdir, sitelibdir, sitearchlibdir, mandir, true
Installer.install ruby_install_name+exeext, bindir+"/"+ruby_install_name+exeext, 0755, true
Installer.install ruby_install_name+exeext, File.join(bindir, ruby_install_name+exeext), 0755, true
if rubyw_install_name and !rubyw_install_name.empty?
Installer.install rubyw_install_name+exeext, bindir, 0755, true
end
@ -98,12 +98,23 @@ end
Dir.chdir CONFIG["srcdir"]
for f in Dir["bin/*"]
next unless File.file?(f)
for src in Dir["bin/*"]
next unless File.file?(src)
name = ruby_install_name.sub(/ruby/, File.basename(f))
name = ruby_install_name.sub(/ruby/, File.basename(src))
dest = File.join(bindir, name)
Installer.install f, File.join(bindir, name), 0755, true
Installer.install src, dest, 0755, true
open(dest, "r+") { |f|
shebang = f.gets
body = f.readlines
f.rewind
f.print shebang.sub(/ruby/, "ruby17"), *body
f.truncate(f.pos)
}
end
Dir.glob("lib/**/*{.rb,help-message}") do |f|
@ -116,11 +127,11 @@ for f in Dir["*.h"]
Installer.install f, archlibdir, 0644, true
end
if RUBY_PLATFORM =~ /mswin32|mingw|bccwin32/
Installer.makedirs archlibdir + "/win32", true
Installer.install "win32/win32.h", archlibdir + "/win32", 0644, true
Installer.makedirs File.join(archlibdir, "win32"), true
Installer.install "win32/win32.h", File.join(archlibdir, "win32"), 0644, true
end
Installer.makedirs mandir, true
Installer.install "ruby.1", mandir+"/"+ruby_install_name+".1", 0644, true
Installer.install "ruby.1", File.join(mandir, ruby_install_name+".1"), 0644, true
# vi:set sw=2: