* lib/mkmf.rb: it's an issue of test/mkmf.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-11-04 01:31:09 +00:00
Родитель 9801be68a9
Коммит 051127abec
1 изменённых файлов: 6 добавлений и 15 удалений

Просмотреть файл

@ -382,9 +382,7 @@ module MakeMakefile
nil while command.gsub!(varpat) {vars[$1||$2]} nil while command.gsub!(varpat) {vars[$1||$2]}
end end
Logging::open do Logging::open do
msg = command.quote puts command.quote
puts msg
Logging.message "%s\n", msg
if opts and opts[:werror] if opts and opts[:werror]
result = nil result = nil
Logging.postpone do |log| Logging.postpone do |log|
@ -401,15 +399,11 @@ module MakeMakefile
def xpopen command, *mode, &block def xpopen command, *mode, &block
Logging::open do Logging::open do
msg = case mode[0] case mode[0]
when nil, /^r/ when nil, /^r/
"#{command} |" puts "#{command} |"
else else
"| #{command}" puts "| #{command}"
end
if msg
puts msg
Logging.message "%s\n", msg
end end
IO.popen(libpath_env, command, *mode, &block) IO.popen(libpath_env, command, *mode, &block)
end end
@ -814,16 +808,13 @@ SRC
xpopen(cpp_command('', opt)) do |f| xpopen(cpp_command('', opt)) do |f|
if Regexp === pat if Regexp === pat
puts(" ruby -ne 'print if #{pat.inspect}'") puts(" ruby -ne 'print if #{pat.inspect}'")
Logging::message(" ruby -ne 'print if %p'\n", pat)
f.grep(pat) {|l| f.grep(pat) {|l|
puts "#{f.lineno}: #{l}" puts "#{f.lineno}: #{l}"
Logging::message "%d: %s", f.lineno, l
return true return true
} }
false false
else else
puts(" egrep '#{pat}'") puts(" egrep '#{pat}'")
Logging::message(" egrep '%s'\n", pat)
begin begin
stdin = $stdin.dup stdin = $stdin.dup
$stdin.reopen(f) $stdin.reopen(f)
@ -1801,7 +1792,7 @@ SRC
pkgconfig = $PKGCONFIG pkgconfig = $PKGCONFIG
get = proc {|opt| get = proc {|opt|
opt = xpopen("#{$PKGCONFIG} --#{opt} #{pkg}", err:[:child, :out], &:read) opt = xpopen("#{$PKGCONFIG} --#{opt} #{pkg}", err:[:child, :out], &:read)
Logging.open {opt.each_line.map{|s|Logging.message "=> %p\n", s}} Logging.open {puts opt.each_line.map{|s|"=> #{s.inspect}"}}
opt.strip if $?.success? opt.strip if $?.success?
} }
elsif find_executable0(pkgconfig = "#{pkg}-config") elsif find_executable0(pkgconfig = "#{pkg}-config")
@ -1812,7 +1803,7 @@ SRC
if pkgconfig if pkgconfig
get ||= proc {|opt| get ||= proc {|opt|
opt = xpopen("#{pkgconfig} --#{opt}", err:[:child, :out], &:read) opt = xpopen("#{pkgconfig} --#{opt}", err:[:child, :out], &:read)
Logging.open {opt.each_line.map{|s|Logging.message "=> %p\n", s}} Logging.open {puts opt.each_line.map{|s|"=> #{s.inspect}"}}
opt.strip if $?.success? opt.strip if $?.success?
} }
end end