From 8fb03838db90e8a0c614007c4d777b08c931de4b Mon Sep 17 00:00:00 2001 From: Rylan Polster Date: Thu, 11 Aug 2022 23:59:20 -0400 Subject: [PATCH] `bump-cask-pr`: fix `sha256` replacement with `arch` --- Library/Homebrew/dev-cmd/bump-cask-pr.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Library/Homebrew/dev-cmd/bump-cask-pr.rb b/Library/Homebrew/dev-cmd/bump-cask-pr.rb index cc33184b1a..a123af9da0 100644 --- a/Library/Homebrew/dev-cmd/bump-cask-pr.rb +++ b/Library/Homebrew/dev-cmd/bump-cask-pr.rb @@ -138,8 +138,10 @@ module Homebrew replacement_pairs << fetch_cask(tmp_contents, config: lang_config) end + # TODO: Use SimulateSystem once all casks use on_system blocks if tmp_contents.include?("Hardware::CPU.intel?") other_intel = !Hardware::CPU.intel? + Homebrew::SimulateSystem.arch = other_intel ? :intel : :arm other_contents = tmp_contents.gsub("Hardware::CPU.intel?", other_intel.to_s) other_cask = Cask::CaskLoader.load(other_contents) @@ -151,6 +153,8 @@ module Homebrew lang_config = other_cask.config.merge(Cask::Config.new(explicit: { languages: [language] })) replacement_pairs << fetch_cask(other_contents, config: lang_config) end + + Homebrew::SimulateSystem.clear end end end