From 72a346e6c80bd9343f28f6cdb9d909ba866bd2f0 Mon Sep 17 00:00:00 2001 From: Cheng XU Date: Tue, 22 Dec 2020 15:32:05 -0800 Subject: [PATCH] cask/installer: do not install tap during conflict checking If the tap of the conflicted cask is not installed, we should just skip it. This matches the behavior of formula installation. Without this, running `brew install dropbox` would result to install the `homebrew/cask-versions` tap. Fixes #9125. --- Library/Homebrew/cask/installer.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Library/Homebrew/cask/installer.rb b/Library/Homebrew/cask/installer.rb index 318cb045ba..e7219ef9f0 100644 --- a/Library/Homebrew/cask/installer.rb +++ b/Library/Homebrew/cask/installer.rb @@ -120,6 +120,11 @@ module Cask return unless @cask.conflicts_with @cask.conflicts_with[:cask].each do |conflicting_cask| + if (match = conflicting_cask.match(HOMEBREW_TAP_CASK_REGEX)) + conflicting_cask_tap = Tap.fetch(match[1], match[2]) + next unless conflicting_cask_tap.installed? + end + conflicting_cask = CaskLoader.load(conflicting_cask) raise CaskConflictError.new(@cask, conflicting_cask) if conflicting_cask.installed? rescue CaskUnavailableError