aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2014-05-05 13:39:10 +0100
committerMike McQuaid2014-05-06 16:45:50 +0100
commit0cea93702317ac93b1413690c3742eea5c92c021 (patch)
treef8a6f39fca7dbfa38b54b171bb764fc39396093b /Library
parentd970b87c15ff1a346e15800d93e7862f4f8bdca7 (diff)
downloadhomebrew-0cea93702317ac93b1413690c3742eea5c92c021.tar.bz2
shared: don't use Formula.factory unnecessarily.
Instead check if the path exists by using opt.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/extend/ENV/shared.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/Library/Homebrew/extend/ENV/shared.rb b/Library/Homebrew/extend/ENV/shared.rb
index 31904c280..d0102f520 100644
--- a/Library/Homebrew/extend/ENV/shared.rb
+++ b/Library/Homebrew/extend/ENV/shared.rb
@@ -98,9 +98,7 @@ module SharedEnvExtension
end
end
elsif ARGV.include? '--use-gcc'
- gcc_installed = Formula.factory('apple-gcc42').installed? rescue false
- # fall back to something else on systems without Apple gcc
- if MacOS.locate('gcc-4.2') || gcc_installed
+ if MacOS.locate("gcc-4.2") || HOMEBREW_PREFIX.join("opt/apple-gcc42/bin/gcc-4.2").exist?
:gcc
else
raise "gcc-4.2 not found!"