diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-02-23 00:16:39 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-02-23 00:16:39 +0000 |
commit | fc6bc28c5719d4e44bb9c1ca4a215d93d46cb264 (patch) | |
tree | 6d8d158bb0403a2ff2d60bdc4834e1b89db41089 /instruby.rb | |
parent | 72d18ad34d93cfa152458ec401d4cd0867cf84cb (diff) |
* instruby.rb (DOSISH): embedded path in batch files should not be
prefixed by DESTDIR. [ruby-core:02186]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@5811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'instruby.rb')
-rw-r--r-- | instruby.rb | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/instruby.rb b/instruby.rb index c5a906a7c5..3eb8fcea72 100644 --- a/instruby.rb +++ b/instruby.rb @@ -71,19 +71,24 @@ def makedirs(dirs) super(dirs, :mode => 0755, :verbose => true) unless dirs.empty? end +def with_destdir(dir) + dir = dir.sub(/\A\w:/, '') if File::PATH_SEPARATOR == ';' + $destdir + dir +end + exeext = CONFIG["EXEEXT"] ruby_install_name = CONFIG["ruby_install_name"] rubyw_install_name = CONFIG["rubyw_install_name"] version = CONFIG["ruby_version"] -bindir = $destdir+CONFIG["bindir"] -libdir = $destdir+CONFIG["libdir"] -rubylibdir = $destdir+CONFIG["rubylibdir"] -archlibdir = $destdir+CONFIG["archdir"] -sitelibdir = $destdir+CONFIG["sitelibdir"] -sitearchlibdir = $destdir+CONFIG["sitearchdir"] -mandir = File.join($destdir+CONFIG["mandir"], "man") +bindir = with_destdir(CONFIG["bindir"]) +libdir = with_destdir(CONFIG["libdir"]) +rubylibdir = with_destdir(CONFIG["rubylibdir"]) +archlibdir = with_destdir(CONFIG["archdir"]) +sitelibdir = with_destdir(CONFIG["sitelibdir"]) +sitearchlibdir = with_destdir(CONFIG["sitearchdir"]) +mandir = with_destdir(File.join(CONFIG["mandir"], "man")) configure_args = Shellwords.shellwords(CONFIG["configure_args"]) enable_shared = CONFIG["ENABLE_SHARED"] == 'yes' dll = CONFIG["LIBRUBY_SO"] @@ -118,6 +123,9 @@ end Dir.chdir CONFIG["srcdir"] ruby_shebang = File.join(CONFIG["bindir"], ruby_install_name) +if File::ALT_SEPARATOR + ruby_bin_dosish = ruby_shebang.tr(File::SEPARATOR, File::ALT_SEPARATOR) +end for src in Dir["bin/*"] next unless File.file?(src) next if /\/[.#]|(\.(old|bak|orig|rej|diff|patch|core)|~|\/core)$/i =~ src @@ -142,10 +150,9 @@ for src in Dir["bin/*"] end } - if RUBY_PLATFORM =~ /mswin32|mingw|bccwin32/ - ruby_bin_dosish = ruby_bin.gsub(Regexp.compile(File::SEPARATOR), File::ALT_SEPARATOR) - batfile = dest + ".bat" - open(batfile, "w") { |b| + if ruby_bin_dosish + batfile = File.join(CONFIG["bindir"], name + ".bat") + open(with_destdir(batfile), "w") { |b| b.print <<EOH, shebang, body, <<EOF @echo off if "%OS%" == "Windows_NT" goto WinNT |