summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--instruby.rb29
2 files changed, 23 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 89d33d3e6b..61fc593022 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Feb 23 09:16:35 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * instruby.rb (DOSISH): embedded path in batch files should not be
+ prefixed by DESTDIR. [ruby-core:02186]
+
Sat Feb 22 09:54:00 2004 Gavin Sinclair <gsinclair@soyabean.com.au>
* re.c: corrected documentation format (again)
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