From bb0252875e0a4f1100532231a2a8c6594e2ddd9e Mon Sep 17 00:00:00 2001 From: Bo Anderson Date: Sat, 30 Mar 2024 03:29:51 +0000 Subject: [PATCH] utils/bottles: fix outdated bottle check --- Library/Homebrew/software_spec.rb | 2 +- Library/Homebrew/utils/bottles.rb | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb index 978522a42d..96592eb4dc 100644 --- a/Library/Homebrew/software_spec.rb +++ b/Library/Homebrew/software_spec.rb @@ -340,7 +340,7 @@ class Bottle extend Forwardable - attr_reader :name, :resource, :cellar, :rebuild + attr_reader :name, :resource, :tag, :cellar, :rebuild def_delegators :resource, :url, :verify_download_integrity def_delegators :resource, :cached_download diff --git a/Library/Homebrew/utils/bottles.rb b/Library/Homebrew/utils/bottles.rb index 06cb02b602..20f1f965fe 100644 --- a/Library/Homebrew/utils/bottles.rb +++ b/Library/Homebrew/utils/bottles.rb @@ -33,16 +33,15 @@ module Utils end def file_outdated?(formula, file) + file = file.resolved_path + filename = file.basename.to_s return false if formula.bottle.blank? - bottle_ext, bottle_tag, = extname_tag_rebuild(filename) - return false if bottle_ext.blank? - return false if bottle_tag != tag.to_s + _, bottle_tag, bottle_rebuild = extname_tag_rebuild(filename) + return false if bottle_tag.blank? - bottle_url_ext, = extname_tag_rebuild(formula.bottle.url) - - bottle_ext && bottle_url_ext && bottle_ext != bottle_url_ext + bottle_tag != formula.bottle.tag.to_s || bottle_rebuild.to_i != formula.bottle.rebuild end def extname_tag_rebuild(filename)