From eb360dbbb054dd047b3c522c88c2c894442d8a5e Mon Sep 17 00:00:00 2001 From: Bo Anderson Date: Mon, 27 Sep 2021 03:44:33 +0100 Subject: [PATCH] utils/bottle: fix local JSON handling for bottle rebuilds --- Library/Homebrew/utils/bottles.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/utils/bottles.rb b/Library/Homebrew/utils/bottles.rb index faf350f5f6..6f8332a83c 100644 --- a/Library/Homebrew/utils/bottles.rb +++ b/Library/Homebrew/utils/bottles.rb @@ -59,7 +59,7 @@ module Utils receipt_file = file_from_bottle(bottle_file, receipt_file_path) tap = Tab.from_file_content(receipt_file, "#{bottle_file}/#{receipt_file_path}").tap "#{tap}/#{name}" if tap.present? && !tap.core_tap? - elsif (bottle_json_path = Pathname(bottle_file.sub(/\.tar\.gz$/, ".json"))) && + elsif (bottle_json_path = Pathname(bottle_file.sub(/\.(\d+\.)?tar\.gz$/, ".json"))) && bottle_json_path.exist? && (bottle_json_path_contents = bottle_json_path.read.presence) && (bottle_json = JSON.parse(bottle_json_path_contents).presence) && @@ -98,7 +98,7 @@ module Utils def load_tab(formula) keg = Keg.new(formula.prefix) tabfile = keg/Tab::FILENAME - bottle_json_path = formula.local_bottle_path&.sub(/\.tar\.gz$/, ".json") + bottle_json_path = formula.local_bottle_path&.sub(/\.(\d+\.)?tar\.gz$/, ".json") if (tab_attributes = formula.bottle_tab_attributes.presence) Tab.from_file_content(tab_attributes.to_json, tabfile)