mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/extmk.rb (extmake): Use Logging.open to switch stdout and
stderr. Delay Logging::log_close until the failure message is written. Write the failure message only if log file is opened. * lib/mkmf.rb (Logging.log_opened?): New method. [ruby-dev:47215] [Bug #8209] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9089f57207
commit
1d339ff212
3 changed files with 21 additions and 13 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
Wed Apr 3 18:53:58 2013 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* ext/extmk.rb (extmake): Use Logging.open to switch stdout and
|
||||
stderr. Delay Logging::log_close until the failure message is
|
||||
written. Write the failure message only if log file is opened.
|
||||
|
||||
* lib/mkmf.rb (Logging.log_opened?): New method.
|
||||
|
||||
[ruby-dev:47215] [Bug #8209]
|
||||
|
||||
Wed Apr 3 17:11:15 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* win32/win32.c (constat_apply): pass through unknown sequence which
|
||||
|
|
20
ext/extmk.rb
20
ext/extmk.rb
|
@ -193,19 +193,11 @@ def extmake(target)
|
|||
Logging::logfile 'mkmf.log'
|
||||
rm_f makefile
|
||||
if conf
|
||||
stdout = $stdout.dup
|
||||
stderr = $stderr.dup
|
||||
unless verbose?
|
||||
$stderr.reopen($stdout.reopen(@null))
|
||||
end
|
||||
begin
|
||||
Logging.open do
|
||||
unless verbose?
|
||||
$stderr.reopen($stdout.reopen(@null))
|
||||
end
|
||||
load $0 = conf
|
||||
ensure
|
||||
Logging::log_close
|
||||
$stderr.reopen(stderr)
|
||||
$stdout.reopen(stdout)
|
||||
stdout.close
|
||||
stderr.close
|
||||
end
|
||||
else
|
||||
create_makefile(target)
|
||||
|
@ -235,11 +227,13 @@ def extmake(target)
|
|||
mess = "#{error}\n#{mess}"
|
||||
end
|
||||
|
||||
Logging::message(mess)
|
||||
Logging::message(mess) if Logging.log_opened?
|
||||
print(mess)
|
||||
$stdout.flush
|
||||
Logging::log_close
|
||||
return true
|
||||
end
|
||||
Logging::log_close
|
||||
args = sysquote($mflags)
|
||||
unless $destdir.to_s.empty? or $mflags.defined?("DESTDIR")
|
||||
args += [sysquote("DESTDIR=" + relative_from($destdir, "../"+prefix))]
|
||||
|
|
|
@ -310,6 +310,10 @@ module MakeMakefile
|
|||
@log.sync = true
|
||||
end
|
||||
|
||||
def self::log_opened?
|
||||
@log and not @log.closed?
|
||||
end
|
||||
|
||||
def self::open
|
||||
log_open
|
||||
$stderr.reopen(@log)
|
||||
|
|
Loading…
Reference in a new issue