From 5e1f40467b4133fbea14e446564f020a7ed45647 Mon Sep 17 00:00:00 2001 From: Bo Anderson Date: Thu, 30 Nov 2023 02:45:00 +0000 Subject: [PATCH] dev-cmd/bump-cask-pr: fix --sha256 --- Library/Homebrew/dev-cmd/bump-cask-pr.rb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Library/Homebrew/dev-cmd/bump-cask-pr.rb b/Library/Homebrew/dev-cmd/bump-cask-pr.rb index 71f377afda..bedc3c078c 100644 --- a/Library/Homebrew/dev-cmd/bump-cask-pr.rb +++ b/Library/Homebrew/dev-cmd/bump-cask-pr.rb @@ -208,10 +208,10 @@ module Homebrew replacement_pairs << [/"#{old_hash}"/, ":no_check"] if old_hash != :no_check elsif old_hash == :no_check && new_hash != :no_check replacement_pairs << [":no_check", "\"#{new_hash}\""] if new_hash.is_a?(String) + elsif new_hash && !cask.on_system_blocks_exist? && cask.languages.empty? + replacement_pairs << [old_hash.to_s, new_hash.to_s] elsif old_hash != :no_check - if new_hash && cask.languages.present? - opoo "Multiple checksum replacements required; ignoring specified `--sha256` argument." - end + opoo "Multiple checksum replacements required; ignoring specified `--sha256` argument." if new_hash languages = if cask.languages.empty? [nil] else @@ -232,9 +232,6 @@ module Homebrew download.sha256] end end - elsif new_hash - opoo "Cask contains multiple hashes; only updating hash for current arch." if cask.on_system_blocks_exist? - replacement_pairs << [old_hash.to_s, new_hash.to_s] end end end