summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog12
-rw-r--r--ext/extmk.rb20
-rw-r--r--instruby.rb6
-rw-r--r--lib/fileutils.rb2
4 files changed, 25 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index 8f170c56e0..45f836873f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+Sun Jan 5 14:46:46 2003 WATANABE Hirofumi <eban@ruby-lang.org>
+
+ * instruby.rb: need paren in regexp(make -n install).
+
+ * ext/extmk.rb (sysquote): do not need to quote on mswin/bccwin/mingw.
+
+ * ext/extm.rb ($mflags): uniq items and remove '-' and '--'.
+ move options to the lead.
+
+ * lib/fileutils.rb (install): model on the real install
+ command(message).
+
Sun Jan 5 09:36:46 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* ruby.c (ruby_init_loadpath): under Windows, get the module
diff --git a/ext/extmk.rb b/ext/extmk.rb
index c13c6e3f69..1280daf118 100644
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -28,11 +28,9 @@ $topdir = File.expand_path(".")
$top_srcdir = srcdir
$hdrdir = $top_srcdir
-$quote =
- /mswin|bccwin|mingw|human|os2|macos/ =~ (CROSS_COMPILING || RUBY_PLATFORM)
-
def sysquote(x)
- $quote ? x.quote : x
+ @quote ||= /human|os2|macos/ =~ (CROSS_COMPILING || RUBY_PLATFORM)
+ @quote ? x.quote : x
end
def extmake(target)
@@ -113,11 +111,13 @@ getopts('', 'extstatic', 'make:', 'make-flags:')
$force_static = $OPT['extstatic'] == 'static'
$make = $OPT['make'] || $make
-$mflags = Shellwords.shellwords($OPT['make-flags'] || "")
+$mflags = Shellwords.shellwords($OPT['make-flags'] || "").uniq
$mflags[0].sub!(/^\w+$/, '-\&') unless $mflags.empty?
$make, *$mflags[0, 0] = Shellwords.shellwords($make)
-mflags = $mflags.grep(/^-([^-].*)/) {$1}.join
+$mflags.delete_if{|x| x == '-' || x == '--'}
+
+mflags = $mflags.grep(/^-([^-])/){$1}.join
mflags.downcase! if $nmake == ?m
$continue = mflags.include?(?k)
$dryrun = mflags.include?(?n)
@@ -141,6 +141,8 @@ unless $message
end
end
+$mflags = $mflags.partition{|x| x[0] == ?-}.flatten!
+
EXEEXT = CONFIG['EXEEXT']
if CROSS_COMPILING
$ruby = CONFIG['MINIRUBY']
@@ -237,11 +239,7 @@ puts "making #{rubies.join(', ')}"
$stdout.flush
$mflags.concat(rubies)
-if $quote
- system($make, *$mflags.quote) or exit($?.exitstatus)
-else
- exec($make, *$mflags)
-end
+system($make, *sysquote($mflags)) or exit($?.exitstatus)
#Local variables:
# mode: ruby
diff --git a/instruby.rb b/instruby.rb
index c07a3ff56d..c05ef2076c 100644
--- a/instruby.rb
+++ b/instruby.rb
@@ -12,10 +12,10 @@ File.umask(0)
getopts("n", "make:", "make-flags:")
$dryrun = $OPT["n"]
-mflags = Shellwords.shellwords($OPT["make-flags"] || "")
-mflags[0].sub!(/^(?=\w+)$/, "-") unless mflags.empty?
+mflags = Shellwords.shellwords($OPT["make-flags"] || "").uniq
+mflags[0].sub!(/^\w+$/, '-\&') unless mflags.empty?
make, *mflags[0, 0] = Shellwords.shellwords($OPT['make'] || ENV["MAKE"] || "")
-mflags = mflags.grep(/^-[^-]*/) {$1}.join
+mflags = mflags.grep(/^-([^-])/){$1}.join
mflags.downcase! if /nmake/i == make
$dryrun = true if mflags.include?(?n)
diff --git a/lib/fileutils.rb b/lib/fileutils.rb
index b0fd62b0f2..c416213e43 100644
--- a/lib/fileutils.rb
+++ b/lib/fileutils.rb
@@ -590,7 +590,7 @@ module FileUtils
def install( src, dest, mode, *options )
noop, verbose, = fu_parseargs(options, :noop, :verbose)
- fu_output_message "install#{mode ? ' %o'%mode : ''} #{[src,dest].flatten.join ' '}" if verbose
+ fu_output_message "install -c#{mode ? ' -m 0%o'%mode : ''} #{[src,dest].flatten.join ' '}" if verbose
return if noop
fu_each_src_dest(src, dest) do |s,d|