mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
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>'
This commit is contained in:
parent
ec7530bcda
commit
31e5ed28d1
@ -111,16 +111,16 @@ module Superenv
|
|||||||
|
|
||||||
# Homebrew's apple-gcc42 will be outside the PATH in superenv,
|
# Homebrew's apple-gcc42 will be outside the PATH in superenv,
|
||||||
# so xcrun may not be able to find it
|
# so xcrun may not be able to find it
|
||||||
case homebrew_cc
|
begin
|
||||||
when "gcc-4.2"
|
case homebrew_cc
|
||||||
begin
|
when "gcc-4.2"
|
||||||
apple_gcc42 = Formulary.factory("apple-gcc42")
|
paths << Formulary.factory("apple-gcc42").opt_bin
|
||||||
rescue FormulaUnavailableError
|
when GNU_GCC_REGEXP
|
||||||
|
paths << gcc_version_formula($&).opt_bin
|
||||||
end
|
end
|
||||||
paths << apple_gcc42.opt_bin.to_s if apple_gcc42
|
rescue FormulaUnavailableError
|
||||||
when GNU_GCC_REGEXP
|
# Don't fail and don't add these formulae to the path if they don't exist.
|
||||||
gcc_formula = gcc_version_formula($&)
|
nil
|
||||||
paths << gcc_formula.opt_bin.to_s
|
|
||||||
end
|
end
|
||||||
|
|
||||||
paths.to_path_s
|
paths.to_path_s
|
||||||
|
Loading…
x
Reference in New Issue
Block a user