From 4dde88b6d3e17cd9a9b5bbe6ac300a1f8a148a40 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Fri, 27 Jul 2012 02:38:10 -0500 Subject: [PATCH] Un-break MacOS.sdk_path MacOS.sdk_path is meant to return the SDK path that matches the version argument, so store the result in a hash. Fixes Homebrew/homebrew#13623. Signed-off-by: Jack Nagel --- Library/Homebrew/macos.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/macos.rb b/Library/Homebrew/macos.rb index 21c3bc7afb..80f8b3d2d2 100644 --- a/Library/Homebrew/macos.rb +++ b/Library/Homebrew/macos.rb @@ -92,10 +92,11 @@ module MacOS extend self end def sdk_path v=version - @sdk_path ||= begin + @sdk_path ||= {} + @sdk_path[v.to_s] ||= begin path = if not Xcode.bad_xcode_select_path? and File.executable? "#{Xcode.folder}/usr/bin/make" `#{locate('xcodebuild')} -version -sdk macosx#{v} Path 2>/dev/null`.strip - elsif File.directory? '/Developer/SDKs/MacOS#{v}.sdk' + elsif File.directory? "/Developer/SDKs/MacOS#{v}.sdk" # the old default (or wild wild west style) "/Developer/SDKs/MacOS#{v}.sdk" elsif File.directory? "#{Xcode.prefix}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX#{v}.sdk"