* instruby.rb (parse_args), ext/extmk.rb (parse_args): Detect -n
and emulate a dry run. Use 'make' in case no --make argument is given. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
171df94c27
commit
91758efa95
@ -1,3 +1,9 @@
|
||||
Sun Jan 26 17:53:04 2003 Akinori MUSHA <knu@iDaemons.org>
|
||||
|
||||
* instruby.rb (parse_args), ext/extmk.rb (parse_args): Detect -n
|
||||
and emulate a dry run. Use 'make' in case no --make argument is
|
||||
given.
|
||||
|
||||
Sun Jan 26 07:18:42 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||
|
||||
* instruby.rb: re-define individual methods verbosely rather than
|
||||
|
23
ext/extmk.rb
23
ext/extmk.rb
@ -121,7 +121,7 @@ def parse_args()
|
||||
$dryrun = $OPT['n']
|
||||
$force_static = $OPT['extstatic'] == 'static'
|
||||
$destdir = $OPT['dest-dir'] || ''
|
||||
$make = $OPT['make'] || $make
|
||||
$make = $OPT['make'] || $make || 'make'
|
||||
make_flags = ($OPT['make-flags'] || '').strip
|
||||
mflags = ($OPT['mflags'] || '').strip
|
||||
|
||||
@ -136,15 +136,24 @@ def parse_args()
|
||||
$make, *rest = Shellwords.shellwords($make)
|
||||
$mflags.unshift(*rest) unless rest.empty?
|
||||
|
||||
$mflags << '-n' if $dryrun
|
||||
def $mflags.set?(flag)
|
||||
# Only nmake puts flags together
|
||||
if $nmake == ?m
|
||||
grep(/^-(?!-).*#{'%c' % flag}/i) { return true }
|
||||
else
|
||||
include?('-%c' % flag)
|
||||
end
|
||||
end
|
||||
|
||||
if $mflags.set?(?n)
|
||||
$dryrun = true
|
||||
else
|
||||
$mflags << '-n' if $dryrun
|
||||
end
|
||||
|
||||
$mflags << "DESTDIR=#{$destdir}"
|
||||
|
||||
# Most make implementations put each flag separated in MAKEFLAGS, so
|
||||
# we can just search for an option with exact match. Only nmake
|
||||
# puts flags together, but nmake does not propagate -k via MAKEFLAGS
|
||||
# anyway.
|
||||
$continue = $mflags.include?('-k')
|
||||
$continue = $mflags.set?(?k)
|
||||
end
|
||||
|
||||
parse_args()
|
||||
|
22
instruby.rb
22
instruby.rb
@ -18,7 +18,7 @@ def parse_args()
|
||||
|
||||
$dryrun = $OPT['n']
|
||||
$destdir = $OPT['dest-dir'] || ''
|
||||
$make = $OPT['make'] || $make
|
||||
$make = $OPT['make'] || $make || 'make'
|
||||
make_flags = ($OPT['make-flags'] || '').strip
|
||||
mflags = ($OPT['mflags'] || '').strip
|
||||
$mantype = $OPT["mantype"]
|
||||
@ -34,14 +34,24 @@ def parse_args()
|
||||
$make, *rest = Shellwords.shellwords($make)
|
||||
$mflags.unshift(*rest) unless rest.empty?
|
||||
|
||||
$mflags << '-n' if $dryrun
|
||||
def $mflags.set?(flag)
|
||||
# Only nmake puts flags together
|
||||
if $nmake == ?m
|
||||
grep(/^-(?!-).*#{'%c' % flag}/i) { return true }
|
||||
else
|
||||
include?('-%c' % flag)
|
||||
end
|
||||
end
|
||||
|
||||
if $mflags.set?(?n)
|
||||
$dryrun = true
|
||||
else
|
||||
$mflags << '-n' if $dryrun
|
||||
end
|
||||
|
||||
$mflags << "DESTDIR=#{$destdir}"
|
||||
|
||||
# Most make implementations put each flag separated in MAKEFLAGS, so
|
||||
# we can just search with exact match. Only nmake puts flags
|
||||
# together, but nmake does not propagate -k via MAKEFLAGS anyway.
|
||||
$continue = $mflags.include?('-k')
|
||||
$continue = $mflags.set?(?k)
|
||||
end
|
||||
|
||||
parse_args()
|
||||
|
Loading…
x
Reference in New Issue
Block a user