diff --git a/Library/Homebrew/cask_dependent.rb b/Library/Homebrew/cask_dependent.rb index e1f3f6bd34..cb9841fb8b 100644 --- a/Library/Homebrew/cask_dependent.rb +++ b/Library/Homebrew/cask_dependent.rb @@ -45,8 +45,8 @@ class CaskDependent end end - def recursive_dependencies(ignore_missing: false, &block) - Dependency.expand(self, ignore_missing: ignore_missing, &block) + def recursive_dependencies(&block) + Dependency.expand(self, &block) end def recursive_requirements(&block) diff --git a/Library/Homebrew/cmd/reinstall.rb b/Library/Homebrew/cmd/reinstall.rb index e4b692afab..fa0f68f0b4 100644 --- a/Library/Homebrew/cmd/reinstall.rb +++ b/Library/Homebrew/cmd/reinstall.rb @@ -88,22 +88,6 @@ module Homebrew def reinstall args = reinstall_args.parse - # We need to use the bottle API instead of just using the formula file - # from an installed keg because it will not contain bottle information. - # As a consequence, `brew reinstall` will also upgrade outdated formulae - if Homebrew::EnvConfig.install_from_api? - args.named.each do |name| - formula = Formulary.factory(name) - next unless formula.any_version_installed? - next if formula.tap.present? && !formula.core_formula? - next unless Homebrew::API::Bottle.available?(name) - - Homebrew::API::Bottle.fetch_bottles(name) - rescue FormulaUnavailableError - next - end - end - formulae, casks = args.named.to_formulae_and_casks(method: :resolve) .partition { |o| o.is_a?(Formula) } diff --git a/Library/Homebrew/dependency.rb b/Library/Homebrew/dependency.rb index 2b3f9b2013..609d6fd84a 100644 --- a/Library/Homebrew/dependency.rb +++ b/Library/Homebrew/dependency.rb @@ -46,15 +46,6 @@ class Dependency formula end - def unavailable_core_formula? - to_formula - false - rescue CoreTapFormulaUnavailableError - true - rescue - false - end - def installed? to_formula.latest_version_installed? end @@ -98,7 +89,7 @@ class Dependency # the list. # The default filter, which is applied when a block is not given, omits # optionals and recommendeds based on what the dependent has asked for - def expand(dependent, deps = dependent.deps, cache_key: nil, ignore_missing: false, &block) + def expand(dependent, deps = dependent.deps, cache_key: nil, &block) # Keep track dependencies to avoid infinite cyclic dependency recursion. @expand_stack ||= [] @expand_stack.push dependent.name @@ -115,19 +106,19 @@ class Dependency # avoid downloading build dependency bottles next if dep.build? && dependent.pour_bottle? && Homebrew::EnvConfig.install_from_api? - case action(dependent, dep, ignore_missing: ignore_missing, &block) + case action(dependent, dep, &block) when :prune next when :skip next if @expand_stack.include? dep.name - expanded_deps.concat(expand(dep.to_formula, cache_key: cache_key, ignore_missing: ignore_missing, &block)) + expanded_deps.concat(expand(dep.to_formula, cache_key: cache_key, &block)) when :keep_but_prune_recursive_deps expanded_deps << dep else next if @expand_stack.include? dep.name - expanded_deps.concat(expand(dep.to_formula, cache_key: cache_key, ignore_missing: ignore_missing, &block)) + expanded_deps.concat(expand(dep.to_formula, cache_key: cache_key, &block)) expanded_deps << dep end end @@ -139,10 +130,8 @@ class Dependency @expand_stack.pop end - def action(dependent, dep, ignore_missing: false, &block) + def action(dependent, dep, &block) catch(:action) do - prune if ignore_missing && dep.unavailable_core_formula? - if block yield dependent, dep elsif dep.optional? || dep.recommended? diff --git a/Library/Homebrew/exceptions.rb b/Library/Homebrew/exceptions.rb index 4e1d0387f9..6f83563226 100644 --- a/Library/Homebrew/exceptions.rb +++ b/Library/Homebrew/exceptions.rb @@ -234,13 +234,6 @@ class TapFormulaUnavailableError < FormulaUnavailableError end end -# Raised when a formula in a the core tap is unavailable. -class CoreTapFormulaUnavailableError < TapFormulaUnavailableError - def initialize(name) - super CoreTap.instance, name - end -end - # Raised when a formula in a specific tap does not contain a formula class. class TapFormulaClassUnavailableError < TapFormulaUnavailableError include FormulaClassUnavailableErrorModule diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 149c501ddc..53b72b9428 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -218,11 +218,6 @@ class FormulaInstaller def verify_deps_exist begin compute_dependencies - rescue CoreTapFormulaUnavailableError => e - raise unless Homebrew::API::Bottle.available? e.name - - Homebrew::API::Bottle.fetch_bottles(e.name) - retry rescue TapFormulaUnavailableError => e raise if e.tap.installed? diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb index 28db63820b..bcdb6abfb1 100644 --- a/Library/Homebrew/formulary.rb +++ b/Library/Homebrew/formulary.rb @@ -447,10 +447,6 @@ module Formulary rescue FormulaClassUnavailableError => e raise TapFormulaClassUnavailableError.new(tap, name, e.path, e.class_name, e.class_list), "", e.backtrace rescue FormulaUnavailableError => e - if tap.core_tap? && Homebrew::EnvConfig.install_from_api? - raise CoreTapFormulaUnavailableError.new(name), "", e.backtrace - end - raise TapFormulaUnavailableError.new(tap, name), "", e.backtrace end @@ -469,10 +465,6 @@ module Formulary end def get_formula(*) - if !CoreTap.instance.installed? && Homebrew::EnvConfig.install_from_api? - raise CoreTapFormulaUnavailableError, name - end - raise FormulaUnavailableError, name end end