Fix cases of core taps being unnecessarily installed
This commit is contained in:
parent
ba02c669e1
commit
beaa6c32a0
@ -179,9 +179,7 @@ module Homebrew
|
|||||||
next unless name =~ HOMEBREW_TAP_FORMULA_REGEX
|
next unless name =~ HOMEBREW_TAP_FORMULA_REGEX
|
||||||
|
|
||||||
tap = Tap.fetch(Regexp.last_match(1), Regexp.last_match(2))
|
tap = Tap.fetch(Regexp.last_match(1), Regexp.last_match(2))
|
||||||
next if (tap.core_tap? || tap == "homebrew/cask") && !EnvConfig.no_install_from_api?
|
tap.ensure_installed!
|
||||||
|
|
||||||
tap.install unless tap.installed?
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if args.ignore_dependencies?
|
if args.ignore_dependencies?
|
||||||
|
|||||||
@ -600,7 +600,7 @@ class Reporter
|
|||||||
next unless (HOMEBREW_PREFIX/"Caskroom"/new_name).exist?
|
next unless (HOMEBREW_PREFIX/"Caskroom"/new_name).exist?
|
||||||
|
|
||||||
new_tap = Tap.fetch(new_tap_name)
|
new_tap = Tap.fetch(new_tap_name)
|
||||||
new_tap.install unless new_tap.installed?
|
new_tap.ensure_installed!
|
||||||
ohai "#{name} has been moved to Homebrew.", <<~EOS
|
ohai "#{name} has been moved to Homebrew.", <<~EOS
|
||||||
To uninstall the cask, run:
|
To uninstall the cask, run:
|
||||||
brew uninstall --cask --force #{name}
|
brew uninstall --cask --force #{name}
|
||||||
@ -650,7 +650,7 @@ class Reporter
|
|||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
new_tap.install unless new_tap.installed?
|
new_tap.ensure_installed!
|
||||||
# update tap for each Tab
|
# update tap for each Tab
|
||||||
tabs.each { |tab| tab.tap = new_tap }
|
tabs.each { |tab| tab.tap = new_tap }
|
||||||
tabs.each(&:write)
|
tabs.each(&:write)
|
||||||
|
|||||||
@ -107,6 +107,7 @@ module Homebrew
|
|||||||
destination_tap = Tap.fetch(args.named.second)
|
destination_tap = Tap.fetch(args.named.second)
|
||||||
unless Homebrew::EnvConfig.developer?
|
unless Homebrew::EnvConfig.developer?
|
||||||
odie "Cannot extract formula to homebrew/core!" if destination_tap.core_tap?
|
odie "Cannot extract formula to homebrew/core!" if destination_tap.core_tap?
|
||||||
|
odie "Cannot extract formula to homebrew/cask!" if destination_tap.core_cask_tap?
|
||||||
odie "Cannot extract formula to the same tap!" if destination_tap == source_tap
|
odie "Cannot extract formula to the same tap!" if destination_tap == source_tap
|
||||||
end
|
end
|
||||||
destination_tap.install unless destination_tap.installed?
|
destination_tap.install unless destination_tap.installed?
|
||||||
|
|||||||
@ -229,8 +229,8 @@ class FormulaInstaller
|
|||||||
rescue TapFormulaUnavailableError => e
|
rescue TapFormulaUnavailableError => e
|
||||||
raise if e.tap.installed?
|
raise if e.tap.installed?
|
||||||
|
|
||||||
e.tap.install
|
e.tap.ensure_installed!
|
||||||
retry
|
retry if e.tap.installed? # It may have not installed if it's a core tap.
|
||||||
end
|
end
|
||||||
rescue FormulaUnavailableError => e
|
rescue FormulaUnavailableError => e
|
||||||
e.dependent = formula.full_name
|
e.dependent = formula.full_name
|
||||||
|
|||||||
@ -626,7 +626,7 @@ module Formulary
|
|||||||
new_tap_user, new_tap_repo, = new_tap_name.split("/")
|
new_tap_user, new_tap_repo, = new_tap_name.split("/")
|
||||||
new_tap_name = "#{new_tap_user}/#{new_tap_repo}"
|
new_tap_name = "#{new_tap_user}/#{new_tap_repo}"
|
||||||
new_tap = Tap.fetch new_tap_name
|
new_tap = Tap.fetch new_tap_name
|
||||||
new_tap.install unless new_tap.installed?
|
new_tap.ensure_installed!
|
||||||
new_tapped_name = "#{new_tap_name}/#{name}"
|
new_tapped_name = "#{new_tap_name}/#{name}"
|
||||||
name, path = formula_name_path(new_tapped_name, warn: false)
|
name, path = formula_name_path(new_tapped_name, warn: false)
|
||||||
old_name = tapped_name
|
old_name = tapped_name
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user