From 026363e1edff723217d72d9ac0d38f699d9ed850 Mon Sep 17 00:00:00 2001 From: Martin Afanasjew Date: Wed, 20 Jan 2016 05:46:23 +0100 Subject: [PATCH] diagnostic: fix autoconf check Xcode can only provide autotools if it is installed, thus check that first. Skipping this check will try to compare a `nil` Xcode version to 4.3, the first version of Xcode to not provide autotools. Fixes Homebrew/homebrew#48208. Closes Homebrew/homebrew#48278. Signed-off-by: Martin Afanasjew --- Library/Homebrew/diagnostic.rb | 1 + Library/Homebrew/test/test_diagnostic.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb index 6b8330f231..0743c6e031 100644 --- a/Library/Homebrew/diagnostic.rb +++ b/Library/Homebrew/diagnostic.rb @@ -1044,6 +1044,7 @@ module Homebrew end def check_for_autoconf + return unless MacOS::Xcode.installed? return unless MacOS::Xcode.provides_autotools? autoconf = which("autoconf") diff --git a/Library/Homebrew/test/test_diagnostic.rb b/Library/Homebrew/test/test_diagnostic.rb index 8aa2c6f674..07bae8329e 100644 --- a/Library/Homebrew/test/test_diagnostic.rb +++ b/Library/Homebrew/test/test_diagnostic.rb @@ -205,6 +205,7 @@ class DiagnosticChecksTest < Homebrew::TestCase end def test_check_for_autoconf + MacOS::Xcode.stubs(:installed?).returns true MacOS::Xcode.stubs(:provides_autotools?).returns true mktmpdir do |path| file = "#{path}/autoconf"