upgrade: don't upgrade unbottled dependents of upgraded formulae
We upgrade dependents of upgraded formulae to make sure that an upgrade doesn't break anything. However, this reasoning applies only when a dependent is bottled, since attempting a source build is just as likely to break things, if not more. I've opted not to restrict this to, say, users only on outdated versions of macOS in order to cleanly handle other cases where this change should also apply: Linux, or current versions of macOS in a non-default prefix.
This commit is contained in:
parent
e119bdc571
commit
4b36a0eee5
@ -276,6 +276,20 @@ module Homebrew
|
||||
installed_formulae.flat_map(&:runtime_installed_formula_dependents)
|
||||
.uniq
|
||||
.select(&:outdated?)
|
||||
|
||||
# Ensure we never attempt a source build for outdated dependents of upgraded formulae.
|
||||
outdated_dependents, skipped_dependents = outdated_dependents.partition do |dependent|
|
||||
dependent.bottled? && dependent.deps.all?(&:bottled?)
|
||||
end
|
||||
|
||||
if skipped_dependents.present?
|
||||
opoo <<~EOS
|
||||
The following dependents of upgraded formulae are outdated but will not
|
||||
be upgraded:
|
||||
#{skipped_dependents * "\n "}
|
||||
EOS
|
||||
end
|
||||
|
||||
return if outdated_dependents.blank? && already_broken_dependents.blank?
|
||||
|
||||
outdated_dependents -= installed_formulae if dry_run
|
||||
|
Loading…
x
Reference in New Issue
Block a user