Remove more tap pinning code.
This was deprecated and removed a while ago.
This commit is contained in:
parent
4f502daf90
commit
fb0a6338b1
@ -69,7 +69,6 @@ module Homebrew
|
|||||||
puts unless i.zero?
|
puts unless i.zero?
|
||||||
info = "#{tap}: "
|
info = "#{tap}: "
|
||||||
if tap.installed?
|
if tap.installed?
|
||||||
info += tap.pinned? ? "pinned" : "unpinned"
|
|
||||||
info += ", private" if tap.private?
|
info += ", private" if tap.private?
|
||||||
info += if (contents = tap.contents).empty?
|
info += if (contents = tap.contents).empty?
|
||||||
", no commands/casks/formulae"
|
", no commands/casks/formulae"
|
||||||
|
|||||||
@ -247,17 +247,6 @@ class TapAlreadyTappedError < RuntimeError
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class TapPinStatusError < RuntimeError
|
|
||||||
attr_reader :name, :pinned
|
|
||||||
|
|
||||||
def initialize(name, pinned)
|
|
||||||
@name = name
|
|
||||||
@pinned = pinned
|
|
||||||
|
|
||||||
super pinned ? "#{name} is already pinned." : "#{name} is already unpinned."
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
class OperationInProgressError < RuntimeError
|
class OperationInProgressError < RuntimeError
|
||||||
def initialize(name)
|
def initialize(name)
|
||||||
message = <<~EOS
|
message = <<~EOS
|
||||||
|
|||||||
@ -500,26 +500,6 @@ class Tap
|
|||||||
@pinned = pinned_symlink_path.directory?
|
@pinned = pinned_symlink_path.directory?
|
||||||
end
|
end
|
||||||
|
|
||||||
# Pin this {Tap}.
|
|
||||||
def pin
|
|
||||||
raise TapUnavailableError, name unless installed?
|
|
||||||
raise TapPinStatusError.new(name, true) if pinned?
|
|
||||||
|
|
||||||
pinned_symlink_path.make_relative_symlink(path)
|
|
||||||
@pinned = true
|
|
||||||
end
|
|
||||||
|
|
||||||
# Unpin this {Tap}.
|
|
||||||
def unpin
|
|
||||||
raise TapUnavailableError, name unless installed?
|
|
||||||
raise TapPinStatusError.new(name, false) unless pinned?
|
|
||||||
|
|
||||||
pinned_symlink_path.delete
|
|
||||||
pinned_symlink_path.parent.rmdir_if_possible
|
|
||||||
pinned_symlink_path.parent.parent.rmdir_if_possible
|
|
||||||
@pinned = false
|
|
||||||
end
|
|
||||||
|
|
||||||
def to_hash
|
def to_hash
|
||||||
hash = {
|
hash = {
|
||||||
"name" => name,
|
"name" => name,
|
||||||
@ -533,7 +513,6 @@ class Tap
|
|||||||
"cask_tokens" => cask_tokens,
|
"cask_tokens" => cask_tokens,
|
||||||
"cask_files" => cask_files.map(&:to_s),
|
"cask_files" => cask_files.map(&:to_s),
|
||||||
"command_files" => command_files.map(&:to_s),
|
"command_files" => command_files.map(&:to_s),
|
||||||
"pinned" => pinned?,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if installed?
|
if installed?
|
||||||
|
|||||||
@ -117,20 +117,6 @@ describe TapAlreadyTappedError do
|
|||||||
its(:to_s) { is_expected.to eq("Tap foo already tapped.\n") }
|
its(:to_s) { is_expected.to eq("Tap foo already tapped.\n") }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe TapPinStatusError do
|
|
||||||
context "pinned" do
|
|
||||||
subject { described_class.new("foo", true) }
|
|
||||||
|
|
||||||
its(:to_s) { is_expected.to eq("foo is already pinned.") }
|
|
||||||
end
|
|
||||||
|
|
||||||
context "unpinned" do
|
|
||||||
subject { described_class.new("foo", false) }
|
|
||||||
|
|
||||||
its(:to_s) { is_expected.to eq("foo is already unpinned.") }
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
describe BuildError do
|
describe BuildError do
|
||||||
subject { described_class.new(formula, "badprg", %w[arg1 arg2], {}) }
|
subject { described_class.new(formula, "badprg", %w[arg1 arg2], {}) }
|
||||||
|
|
||||||
|
|||||||
@ -304,16 +304,6 @@ describe Tap do
|
|||||||
(HOMEBREW_PREFIX/"share").rmtree if (HOMEBREW_PREFIX/"share").exist?
|
(HOMEBREW_PREFIX/"share").rmtree if (HOMEBREW_PREFIX/"share").exist?
|
||||||
end
|
end
|
||||||
|
|
||||||
specify "#pin and #unpin" do
|
|
||||||
expect(subject).not_to be_pinned
|
|
||||||
expect { subject.unpin }.to raise_error(TapPinStatusError)
|
|
||||||
subject.pin
|
|
||||||
expect(subject).to be_pinned
|
|
||||||
expect { subject.pin }.to raise_error(TapPinStatusError)
|
|
||||||
subject.unpin
|
|
||||||
expect(subject).not_to be_pinned
|
|
||||||
end
|
|
||||||
|
|
||||||
specify "#config" do
|
specify "#config" do
|
||||||
setup_git_repo
|
setup_git_repo
|
||||||
|
|
||||||
|
|||||||
@ -876,7 +876,6 @@ _brew() {
|
|||||||
switch) _brew_switch ;;
|
switch) _brew_switch ;;
|
||||||
tap) _brew_tap ;;
|
tap) _brew_tap ;;
|
||||||
tap-info) _brew_tap_info ;;
|
tap-info) _brew_tap_info ;;
|
||||||
tap-pin) __brew_complete_tapped ;;
|
|
||||||
tap-new) _brew_tap_new ;;
|
tap-new) _brew_tap_new ;;
|
||||||
tap-unpin) _brew_tap_unpin ;;
|
tap-unpin) _brew_tap_unpin ;;
|
||||||
test) __brew_complete_installed ;;
|
test) __brew_complete_installed ;;
|
||||||
|
|||||||
@ -532,14 +532,6 @@ __fish_brew_complete_arg 'tap-info; and not __fish_brew_opt --installed' -l inst
|
|||||||
__fish_brew_complete_arg 'tap-info; and not __fish_brew_opt --json=v1' -l json=v1 -d "Format output in JSON format"
|
__fish_brew_complete_arg 'tap-info; and not __fish_brew_opt --json=v1' -l json=v1 -d "Format output in JSON format"
|
||||||
|
|
||||||
|
|
||||||
__fish_brew_complete_cmd 'tap-pin' "Prioritize tap's formulae over core"
|
|
||||||
__fish_brew_complete_arg 'tap-pin' -a '(__fish_brew_suggest_taps_installed)'
|
|
||||||
|
|
||||||
|
|
||||||
__fish_brew_complete_cmd 'tap-unpin' "Don't prioritize tap's formulae over core anymore"
|
|
||||||
__fish_brew_complete_arg 'tap-unpin' -a '(__fish_brew_suggest_taps_pinned)'
|
|
||||||
|
|
||||||
|
|
||||||
__fish_brew_complete_cmd 'uninstall' "Uninstall formula"
|
__fish_brew_complete_cmd 'uninstall' "Uninstall formula"
|
||||||
# FIXME: uninstall has a weird alias uninstal (with single l), probably it should also be supported
|
# FIXME: uninstall has a weird alias uninstal (with single l), probably it should also be supported
|
||||||
__fish_brew_complete_arg 'uninstall remove rm' -a '(__fish_brew_suggest_formulae_installed)'
|
__fish_brew_complete_arg 'uninstall remove rm' -a '(__fish_brew_suggest_formulae_installed)'
|
||||||
|
|||||||
@ -123,8 +123,6 @@ __brew_common_commands() {
|
|||||||
'switch:switch between different versions of a formula'
|
'switch:switch between different versions of a formula'
|
||||||
'tap:tap a new formula repository from GitHub, or list existing taps'
|
'tap:tap a new formula repository from GitHub, or list existing taps'
|
||||||
'tap-info:information about a tap'
|
'tap-info:information about a tap'
|
||||||
'tap-pin:pin a tap'
|
|
||||||
'tap-unpin:unpin a tap'
|
|
||||||
'test-bot:test a formula and build a bottle'
|
'test-bot:test a formula and build a bottle'
|
||||||
'uninstall:uninstall a formula'
|
'uninstall:uninstall a formula'
|
||||||
'unlink:unlink a formula'
|
'unlink:unlink a formula'
|
||||||
@ -679,11 +677,6 @@ _brew_tap_info() {
|
|||||||
'(--installed)*:taps:__brew_installed_taps'
|
'(--installed)*:taps:__brew_installed_taps'
|
||||||
}
|
}
|
||||||
|
|
||||||
# brew tap-pin tap:
|
|
||||||
_brew_tap_pin() {
|
|
||||||
__brew_installed_taps
|
|
||||||
}
|
|
||||||
|
|
||||||
# brew tap_readme [-v] name:
|
# brew tap_readme [-v] name:
|
||||||
# TODO missing argument docs (verbose perhaps)
|
# TODO missing argument docs (verbose perhaps)
|
||||||
_brew_tap_readme() {
|
_brew_tap_readme() {
|
||||||
@ -692,11 +685,6 @@ _brew_tap_readme() {
|
|||||||
':name: '
|
':name: '
|
||||||
}
|
}
|
||||||
|
|
||||||
# brew tap-unpin tap:
|
|
||||||
_brew_tap_unpin() {
|
|
||||||
__brew_pinned_taps
|
|
||||||
}
|
|
||||||
|
|
||||||
# brew test [--devel|--HEAD] [--debug] [--keep-tmp] formulae:
|
# brew test [--devel|--HEAD] [--debug] [--keep-tmp] formulae:
|
||||||
_brew_test() {
|
_brew_test() {
|
||||||
_arguments \
|
_arguments \
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user