aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorShaun Jackman2017-03-06 09:51:15 -0800
committerShaun Jackman2017-03-07 09:03:33 -0800
commit31e5ed28d19c5d15d8c283bf4df726f9d11d2f7a (patch)
treeff7b4802320d1300bc68a748d14370aad79650de /Library
parentec7530bcda24ae3039a73285adbbccdf88b5d4e2 (diff)
downloadbrew-31e5ed28d19c5d15d8c283bf4df726f9d11d2f7a.tar.bz2
determine_path: Fix tests FormulaUnavailableError
Fix the brew tests error: InstallTests#test_a_basic_install: FormulaUnavailableError: No available formula with the name "gcc" Library/Homebrew/formulary.rb:231:in `get_formula' Library/Homebrew/formulary.rb:259:in `factory' Library/Homebrew/extend/ENV/shared.rb:287:in `gcc_version_formula' Library/Homebrew/extend/ENV/super.rb:124:in `determine_path' Library/Homebrew/extend/ENV/super.rb:44:in `setup_build_environment' Library/Homebrew/build.rb:87:in `install' Library/Homebrew/build.rb:201:in `<main>'
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/extend/ENV/super.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/Library/Homebrew/extend/ENV/super.rb b/Library/Homebrew/extend/ENV/super.rb
index 1a5f420f6..0935647f5 100644
--- a/Library/Homebrew/extend/ENV/super.rb
+++ b/Library/Homebrew/extend/ENV/super.rb
@@ -111,16 +111,16 @@ module Superenv
# Homebrew's apple-gcc42 will be outside the PATH in superenv,
# so xcrun may not be able to find it
- case homebrew_cc
- when "gcc-4.2"
- begin
- apple_gcc42 = Formulary.factory("apple-gcc42")
- rescue FormulaUnavailableError
+ begin
+ case homebrew_cc
+ when "gcc-4.2"
+ paths << Formulary.factory("apple-gcc42").opt_bin
+ when GNU_GCC_REGEXP
+ paths << gcc_version_formula($&).opt_bin
end
- paths << apple_gcc42.opt_bin.to_s if apple_gcc42
- when GNU_GCC_REGEXP
- gcc_formula = gcc_version_formula($&)
- paths << gcc_formula.opt_bin.to_s
+ rescue FormulaUnavailableError
+ # Don't fail and don't add these formulae to the path if they don't exist.
+ nil
end
paths.to_path_s