From fb415a15e909a74e8c8407829b7af8ced506be34 Mon Sep 17 00:00:00 2001 From: xxyzz Date: Tue, 21 Dec 2021 16:12:29 +0800 Subject: [PATCH 1/3] bump-cask-pr: avoid replacing sha256 twice on multilang cask this script always get `inreplace failed` on cask like firefox because the default sha256 is replaced twice --- Library/Homebrew/dev-cmd/bump-cask-pr.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/dev-cmd/bump-cask-pr.rb b/Library/Homebrew/dev-cmd/bump-cask-pr.rb index a0707980d0..7b9294d092 100644 --- a/Library/Homebrew/dev-cmd/bump-cask-pr.rb +++ b/Library/Homebrew/dev-cmd/bump-cask-pr.rb @@ -153,7 +153,7 @@ module Homebrew end end - if new_hash.present? + if new_hash.present? && cask.language.blank? hash_regex = old_hash == :no_check ? ":no_check" : "[\"']#{Regexp.escape(old_hash.to_s)}[\"']" replacement_pairs << [ From 4cf996bcdf3d9b05040401bf5fb73d07beff8889 Mon Sep 17 00:00:00 2001 From: xxyzz Date: Tue, 21 Dec 2021 18:01:49 +0800 Subject: [PATCH 2/3] add comment --- Library/Homebrew/dev-cmd/bump-cask-pr.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/dev-cmd/bump-cask-pr.rb b/Library/Homebrew/dev-cmd/bump-cask-pr.rb index 7b9294d092..2691700856 100644 --- a/Library/Homebrew/dev-cmd/bump-cask-pr.rb +++ b/Library/Homebrew/dev-cmd/bump-cask-pr.rb @@ -153,7 +153,7 @@ module Homebrew end end - if new_hash.present? && cask.language.blank? + if new_hash.present? && cask.language.blank? # avoid repeated replacement for multilanguage cask hash_regex = old_hash == :no_check ? ":no_check" : "[\"']#{Regexp.escape(old_hash.to_s)}[\"']" replacement_pairs << [ From 5f3a69c227d4a1214d51da9355813d2f6cc13707 Mon Sep 17 00:00:00 2001 From: xxyzz Date: Sat, 25 Dec 2021 15:01:49 +0800 Subject: [PATCH 3/3] don't skip any language --- Library/Homebrew/dev-cmd/bump-cask-pr.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/Library/Homebrew/dev-cmd/bump-cask-pr.rb b/Library/Homebrew/dev-cmd/bump-cask-pr.rb index 2691700856..94d8b17781 100644 --- a/Library/Homebrew/dev-cmd/bump-cask-pr.rb +++ b/Library/Homebrew/dev-cmd/bump-cask-pr.rb @@ -145,8 +145,6 @@ module Homebrew end cask.languages.each do |language| - next if language == cask.language - lang_config = tmp_config.merge(Cask::Config.new(explicit: { languages: [language] })) replacement_pairs << fetch_cask(tmp_contents, config: lang_config) end