Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permit multiple uninstall stanzas in casks (short-term fix) #14398

Merged
merged 1 commit into from
Jan 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 0 additions & 4 deletions Library/Homebrew/cask/audit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,6 @@ def check_single_pre_postflight
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)
Expand Down
22 changes: 0 additions & 22 deletions Library/Homebrew/test/cask/audit_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -600,28 +600,6 @@ def tmp_cask(name, text)
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" }

Expand Down