audit: fix non-core versioned formulae handling/

Fixes issue mentioned in #9016.
This commit is contained in:
Mike McQuaid 2020-11-02 11:25:51 +00:00
parent dcba99c7d1
commit bd7969c2b2
No known key found for this signature in database
GPG Key ID: 48A898132FD8EE70

View File

@ -281,7 +281,7 @@ module Homebrew
problem "#{formula} is versioned but no #{unversioned_name} formula exists"
end
elsif @build_stable && formula.stable? &&
!(versioned_formulae = formula.versioned_formulae).empty?
(versioned_formulae = formula.versioned_formulae - [formula]).present?
versioned_aliases = formula.aliases.grep(/.@\d/)
_, last_alias_version = versioned_formulae.map(&:name).last.split("@")
alias_name_major = "#{formula.name}@#{formula.version.major}"