From de1eabf22c0137e4e0ad8c34cc47fd86cb78e557 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sat, 29 Dec 2012 17:16:38 -0600 Subject: [PATCH] Fix some doublethink in the Xcode module Xcode.prefix and Xcode.installed? use slightly different heuristics to find Xcode. In fact, .installed? basically duplicates a portion of the .prefix logic. In practice, the methods results are usually consistent, but .installed? does not handle non-standard prefixes if mdfind cannot locate Xcode (for example, if the user has disabled Spotlight indexing). Since .installed? is essentially a subset of the .prefix logic, we can rely on the result from .prefix instead. Fixes Homebrew/homebrew#16790. --- Library/Homebrew/macos/xcode.rb | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Library/Homebrew/macos/xcode.rb b/Library/Homebrew/macos/xcode.rb index ab297f2c5c..552bc2c127 100644 --- a/Library/Homebrew/macos/xcode.rb +++ b/Library/Homebrew/macos/xcode.rb @@ -58,12 +58,7 @@ module MacOS::Xcode extend self end def installed? - # Telling us whether the Xcode.app is installed or not. - @installed ||= V4_BUNDLE_PATH.exist? || - V3_BUNDLE_PATH.exist? || - MacOS.app_with_bundle_id(V4_BUNDLE_ID) || - MacOS.app_with_bundle_id(V3_BUNDLE_ID) || - false + not prefix.nil? end def version