From 9380729dbf168342d6a678bf700ba8cabdf3aec6 Mon Sep 17 00:00:00 2001 From: Bo Anderson Date: Mon, 31 May 2021 16:06:27 +0100 Subject: [PATCH] software_spec: fix wrong tab being fetched when bottle isn't unique --- Library/Homebrew/software_spec.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb index 5b7afa1901..7161c8a036 100644 --- a/Library/Homebrew/software_spec.rb +++ b/Library/Homebrew/software_spec.rb @@ -386,8 +386,11 @@ class Bottle raise ArgumentError, "Missing 'annotations' section." if manifests_annotations.blank? bottle_digest = @resource.checksum.hexdigest + image_ref = GitHubPackages.version_rebuild(@resource.version, rebuild, @tag.to_s) manifest_annotations = manifests_annotations.find do |m| - m["sh.brew.bottle.digest"] == bottle_digest + next if m["sh.brew.bottle.digest"] != bottle_digest + + m["org.opencontainers.image.ref.name"] == image_ref end raise ArgumentError, "Couldn't find manifest matching bottle checksum." if manifest_annotations.blank?