audit: don't suggest non-stable versioned alias.

Additionally handle the case where a formula has been installed as
devel/HEAD rather than just e.g. `brew audit --devel`.
This commit is contained in:
Mike McQuaid 2017-07-07 09:30:18 +01:00
parent e499925c7d
commit bddafe4d54

View File

@ -309,7 +309,7 @@ class FormulaAuditor
unversioned_name = unversioned_formula.basename(".rb")
problem "#{formula} is versioned but no #{unversioned_name} formula exists"
end
elsif ARGV.build_stable? &&
elsif ARGV.build_stable? && formula.stable? &&
!(versioned_formulae = Dir[formula.path.to_s.gsub(/\.rb$/, "@*.rb")]).empty?
versioned_aliases = formula.aliases.grep(/.@\d/)
_, last_alias_version =