Merge pull request #12394 from Bo98/bottle-pkg_version-fix

dev-cmd/bottle: fix pkg_version comparison on merge
This commit is contained in:
Bo Anderson 2021-11-08 04:04:01 +00:00 committed by GitHub
commit fbe8f40ea2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -626,9 +626,15 @@ module Homebrew
path = HOMEBREW_REPOSITORY/bottle_hash["formula"]["path"]
formula = Formulary.factory(path)
old_bottle_spec = formula.bottle_specification
old_pkg_version = formula.pkg_version
FormulaVersions.new(formula).formula_at_revision("origin/HEAD") do |upstream_f|
old_pkg_version = upstream_f.pkg_version
end
old_bottle_spec_matches = old_bottle_spec &&
bottle_hash["formula"]["pkg_version"] == formula.pkg_version.to_s &&
bottle_hash["formula"]["pkg_version"] == old_pkg_version.to_s &&
bottle.root_url == old_bottle_spec.root_url &&
old_bottle_spec.collector.tags.present?