X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=rake%2Fconfiguretask.rb;h=1b24f7260fce6ab671088ada7c521d4efe0f6036;hb=6f0baf7ecfc693b12cb0485eb8b9f9851415833c;hp=9a20f794f59c7ed0445e40ccd9e13c67766b0961;hpb=310e91e26bebf168b6081e91da123b4a8cfb9b67;p=ruby-vorbistagger.git diff --git a/rake/configuretask.rb b/rake/configuretask.rb index 9a20f79..1b24f72 100644 --- a/rake/configuretask.rb +++ b/rake/configuretask.rb @@ -23,7 +23,6 @@ require "rake/tasklib" require "rake/clean" require "yaml" -require "tempfile" require "fileutils" module Rake @@ -140,20 +139,21 @@ module Rake protected def can_exec_binary?(bin) fork do - tf = Tempfile.open("configuretask") - STDOUT.reopen(tf) - STDERR.reopen(tf) + STDOUT.reopen("/dev/null") + STDERR.reopen("/dev/null") begin exec(bin) rescue SystemCallError - exit 0xb00bface + exit 255 + ensure + tf.close end end Process.wait - $?.exitstatus != 0xb00bface + $?.exitstatus != 255 end end @@ -203,14 +203,15 @@ module Rake def initialize(name, opts = {}) super - @command = "pkg-config --silence-errors" + @command = "pkg-config" end protected def lookup_flags(f) f = :modversion if f == :version - tmp = `#{@command} --#{f} #{@name}`.strip.tr("\n", "/") + tmp = `#{@command} --silence-errors --#{f} #{@name}`. + strip.tr("\n", "/") $?.exitstatus.zero? ? tmp : nil end end