From b2b7072fbebfde45c20bd6b9b3db094f29dec47c Mon Sep 17 00:00:00 2001 From: Alexander Regueiro Date: Sat, 21 Jan 2023 18:44:57 +0000 Subject: [PATCH] Permit multiple `uninstall` stanzas in casks (temp) Longer-term solution is described [here](https://github.com/Homebrew/brew/issues/14365#issuecomment-1398214354). --- Library/Homebrew/cask/audit.rb | 4 ---- Library/Homebrew/test/cask/audit_spec.rb | 22 ---------------------- 2 files changed, 26 deletions(-) diff --git a/Library/Homebrew/cask/audit.rb b/Library/Homebrew/cask/audit.rb index 6322db89e8..a2af227785 100644 --- a/Library/Homebrew/cask/audit.rb +++ b/Library/Homebrew/cask/audit.rb @@ -185,10 +185,6 @@ module Cask def check_single_uninstall_zap odebug "Auditing single uninstall_* and zap stanzas" - if cask.artifacts.count { |k| k.is_a?(Artifact::Uninstall) } > 1 - add_error "only a single uninstall stanza is allowed" - end - count = cask.artifacts.count do |k| k.is_a?(Artifact::PreflightBlock) && k.directives.key?(:uninstall_preflight) diff --git a/Library/Homebrew/test/cask/audit_spec.rb b/Library/Homebrew/test/cask/audit_spec.rb index e01de0e554..7c2d13603e 100644 --- a/Library/Homebrew/test/cask/audit_spec.rb +++ b/Library/Homebrew/test/cask/audit_spec.rb @@ -600,28 +600,6 @@ describe Cask::Audit, :cask do end end - describe "uninstall stanza checks" do - let(:message) { "only a single uninstall stanza is allowed" } - - context "when the Cask has no uninstall stanza" do - let(:cask_token) { "with-zap-rmdir" } - - it { is_expected.not_to fail_with(message) } - end - - context "when the Cask has only one uninstall stanza" do - let(:cask_token) { "with-uninstall-rmdir" } - - it { is_expected.not_to fail_with(message) } - end - - context "when the Cask has multiple uninstall stanzas" do - let(:cask_token) { "with-uninstall-multi" } - - it { is_expected.to fail_with(message) } - end - end - describe "uninstall_preflight stanza checks" do let(:message) { "only a single uninstall_preflight stanza is allowed" }