aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2015-06-22 21:00:40 -0400
committerJack Nagel2015-06-22 21:00:40 -0400
commit87e77350125602e6114e43ccc349f0287f8f5349 (patch)
treedb48634bd67c542d673145534625d967285c694b /Library
parent7a75bbd85a6abc9a5828d7d48aa13a27a43432e4 (diff)
downloadbrew-87e77350125602e6114e43ccc349f0287f8f5349.tar.bz2
Ask the formula object for the opt path
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/extend/ENV/shared.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/Library/Homebrew/extend/ENV/shared.rb b/Library/Homebrew/extend/ENV/shared.rb
index f75d40ecf..6256f8564 100644
--- a/Library/Homebrew/extend/ENV/shared.rb
+++ b/Library/Homebrew/extend/ENV/shared.rb
@@ -192,8 +192,9 @@ module SharedEnvExtension
version = name[GNU_GCC_REGEXP, 1]
gcc_version_name = "gcc#{version.delete('.')}"
- if HOMEBREW_PREFIX.join("opt", "gcc", "bin", name).exist?
- Formulary.factory("gcc")
+ gcc = Formulary.factory("gcc")
+ if gcc.opt_bin.join(name).exist?
+ gcc
else
Formulary.factory(gcc_version_name)
end