outdated: handle fully qualified tapped formulae.
Previously if I did `brew install boxen/brews/imagemagick` and then `brew upgrade boxen/brews/imagemagick` and the version of `imagemagick` in `boxen/brews` was older than the version in `Homebrew/homebrew` then it would install the correct version from the `boxen/brews` tap and then try to immediately upgrade it to the version from `Homebrew/homebrew`. I'd argue fairly strongly that this behaviour is pretty unintuitive; when you fully specify a formula from a tap then it should be prioritised by `brew upgrade` and `brew outdated. This commit makes `brew upgrade boxen/brews/imagemagick` only upgrade the version of `imagemagick` if the version in the `boxen/brews` tap is newer. Similarly `brew outdated imagemagick` and `brew outdated boxen/brews/imagemagick` will show different results if the newer version differs between `boxen/brews` and `Homebrew/homebrew`. Closes Homebrew/homebrew#36699. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
parent
2320c0a6c1
commit
988ec8de98
@ -17,9 +17,21 @@ module Homebrew
|
||||
|
||||
def outdated_brews(formulae)
|
||||
formulae.map do |f|
|
||||
versions = f.rack.subdirs.map { |d| Keg.new(d).version }.sort!
|
||||
if versions.all? { |version| f.pkg_version > version }
|
||||
yield f, versions if block_given?
|
||||
all_versions = []
|
||||
same_tap_versions = []
|
||||
f.rack.subdirs.each do |dir|
|
||||
keg = Keg.new dir
|
||||
version = keg.version
|
||||
all_versions << version
|
||||
|
||||
tap = Tab.for_keg(keg).tapped_from
|
||||
if f.tap == tap || f.version == version
|
||||
same_tap_versions << version
|
||||
end
|
||||
end
|
||||
|
||||
if same_tap_versions.all? { |version| f.pkg_version > version }
|
||||
yield f, all_versions if block_given?
|
||||
f
|
||||
end
|
||||
end.compact
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user