Skip to content

Commit

Permalink
Deprecations/disables for 3.3.0/4.0.0.
Browse files Browse the repository at this point in the history
Deprecate, disable and remove code for Homebrew 3.3.0 or 4.0.0
(whichever the next release ends up being).
  • Loading branch information
MikeMcQuaid committed Oct 19, 2021
1 parent ff2985c commit f65d525
Show file tree
Hide file tree
Showing 14 changed files with 13 additions and 125 deletions.
5 changes: 2 additions & 3 deletions Library/Homebrew/cli/named_args.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,8 @@ def load_formula_or_cask(name, only: nil, method: nil, prefer_loading_from_api:
when :default_kegs
resolve_default_keg(name)
when :keg
odeprecated "`load_formula_or_cask` with `method: :keg`",
"`load_formula_or_cask` with `method: :default_kegs`"
resolve_default_keg(name)
odisabled "`load_formula_or_cask` with `method: :keg`",
"`load_formula_or_cask` with `method: :default_kegs`"
when :kegs
_, kegs = resolve_kegs(name)
kegs
Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/cmd/tap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ def tap
elsif args.no_named?
puts Tap.names
else
odeprecated "`brew tap --full`" if args.full?
odisabled "`brew tap --full`" if args.full?

odeprecated "`brew tap --shallow`" if args.shallow?
odisabled "`brew tap --shallow`" if args.shallow?

tap = Tap.fetch(args.named.first)
begin
Expand Down
3 changes: 1 addition & 2 deletions Library/Homebrew/dev-cmd/bump-formula-pr.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ def use_correct_linux_tap(formula, args:)
def bump_formula_pr
args = bump_formula_pr_args.parse

# TODO: deprecate in Homebrew 3.3.0
# odeprecated "`brew bump-formula-pr --write`", "`brew bump-formula-pr --write-only`" if args.write?
odeprecated "`brew bump-formula-pr --write`", "`brew bump-formula-pr --write-only`" if args.write?

if args.revision.present? && args.tag.nil? && args.version.nil?
raise UsageError, "`--revision` must be passed with either `--tag` or `--version`!"
Expand Down
29 changes: 0 additions & 29 deletions Library/Homebrew/dev-cmd/man.rb

This file was deleted.

2 changes: 1 addition & 1 deletion Library/Homebrew/dev-cmd/pr-automerge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def pr_automerge_args
def pr_automerge
args = pr_automerge_args.parse

odeprecated "`brew pr-automerge --autosquash`", "`brew pr-automerge`" if args.autosquash?
odisabled "`brew pr-automerge --autosquash`", "`brew pr-automerge`" if args.autosquash?

without_labels = args.without_labels || [
"do not merge",
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/dev-cmd/pr-publish.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def pr_publish
workflow = args.workflow || "publish-commit-bottles.yml"
ref = args.branch || "master"

odeprecated "`brew pr-publish --autosquash`", "`brew pr-publish`" if args.autosquash?
odisabled "`brew pr-publish --autosquash`", "`brew pr-publish`" if args.autosquash?

extra_args = []
extra_args << "--autosquash" unless args.no_autosquash?
Expand Down
39 changes: 0 additions & 39 deletions Library/Homebrew/formula_assertions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,45 +18,6 @@ def assertions
@assertions ||= 0
end

# Test::Unit backwards compatibility methods
{
assert_include: :assert_includes,
assert_path_exist: :assert_path_exists,
assert_raise: :assert_raises,
assert_throw: :assert_throws,
assert_not_empty: :refute_empty,
assert_not_equal: :refute_equal,
assert_not_in_delta: :refute_in_delta,
assert_not_in_epsilon: :refute_in_epsilon,
assert_not_include: :refute_includes,
assert_not_includes: :refute_includes,
assert_not_instance_of: :refute_instance_of,
assert_not_kind_of: :refute_kind_of,
assert_not_match: :refute_match,
assert_no_match: :refute_match,
assert_not_nil: :refute_nil,
assert_not_operator: :refute_operator,
assert_path_not_exist: :refute_path_exists,
assert_not_predicate: :refute_predicate,
assert_not_respond_to: :refute_respond_to,
assert_not_same: :refute_same,
}.each do |old_method, new_method|
define_method(old_method) do |*args|
odisabled old_method, new_method
send(new_method, *args)
end
end

def assert_true(act, msg = nil)
odisabled "assert_true", "assert(...) or assert_equal(true, ...)"
assert_equal(true, act, msg)
end

def assert_false(act, msg = nil)
odisabled "assert_false", "assert(!...) or assert_equal(false, ...)"
assert_equal(false, act, msg)
end

# Returns the output of running cmd, and asserts the exit status.
# @api public
def shell_output(cmd, result = 0)
Expand Down
4 changes: 1 addition & 3 deletions Library/Homebrew/formula_support.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@ class BottleDisableReason
def initialize(type, reason)
@type = type
@reason = reason
# TODO: 3.3.0: deprecate this behaviour as it was only needed for
# Homebrew/core (where we don't want unneeded or disabled bottles any more)
# odeprecated "bottle :#{@type}" if valid?
odeprecated "bottle :#{@type}" if valid?
end

def unneeded?
Expand Down
24 changes: 1 addition & 23 deletions Library/Homebrew/software_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -495,13 +495,6 @@ def root_url(var = nil, specs = {})
end
end

def cellar(_val = nil)
odisabled(
"`cellar` in a bottle block",
"`brew style --fix` on the formula to update the style or use `sha256` with a `cellar:` argument",
)
end

sig { params(tag: Utils::Bottles::Tag).returns(T::Boolean) }
def compatible_locations?(tag: Utils::Bottles.tag)
spec = collector.specification_for(tag)
Expand Down Expand Up @@ -548,22 +541,7 @@ def sha256(hash)
key.is_a?(Symbol) && value.is_a?(String) && value.match?(sha256_regex)
end

if digest && tag
# the cellar hash key only exists on the new format
cellar = hash[:cellar]
else
# otherwise, find old `sha256 "69489ae397e4645..." => :big_sur` format
digest, tag = hash.find do |key, value|
key.is_a?(String) && value.is_a?(Symbol) && key.match?(sha256_regex)
end

if digest && tag
odisabled(
'`sha256 "digest" => :tag` in a bottle block',
'`brew style --fix` on the formula to update the style or use `sha256 tag: "digest"`',
)
end
end
cellar = hash[:cellar] if digest && tag

tag = Utils::Bottles::Tag.from_symbol(tag)

Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion completions/fish/brew.fish
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,7 @@ __fish_brew_complete_arg 'ls; and not __fish_seen_argument -l cask -l casks' -a
__fish_brew_complete_arg 'ls; and not __fish_seen_argument -l formula -l formulae' -a '(__fish_brew_suggest_casks_installed)'


__fish_brew_complete_cmd 'man' 'Generate Homebrew\'s manpages'
__fish_brew_complete_cmd 'man' 'Generate Homebrew\'s manpages and shell completions'
__fish_brew_complete_arg 'man' -l debug -d 'Display any debugging information'
__fish_brew_complete_arg 'man' -l fail-if-not-changed -d 'Return a failing status code if no changes are detected in the manpage outputs. This can be used to notify CI when the manpages are out of date. Additionally, the date used in new manpages will match those in the existing manpages (to allow comparison without factoring in the date)'
__fish_brew_complete_arg 'man' -l help -d 'Show this message'
Expand Down
2 changes: 1 addition & 1 deletion completions/zsh/_brew
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ __brew_list_aliases() {
'-v' '--version'
lc livecheck
tc typecheck
man generate-man-completions
)
echo "${aliases}"
}
Expand Down Expand Up @@ -176,7 +177,6 @@ __brew_internal_commands() {
'list:List all installed formulae and casks'
'livecheck:Check for newer versions of formulae and/or casks from upstream'
'log:Show the `git log` for formula or cask, or show the log for the Homebrew repository if no formula or cask is provided'
'man:Generate Homebrew'\''s manpages'
'migrate:Migrate renamed packages to new names, where formula are old names of packages'
'missing:Check the given formula kegs for missing dependencies'
'options:Show install options specific to formula'
Expand Down
2 changes: 1 addition & 1 deletion docs/Manpage.md
Original file line number Diff line number Diff line change
Expand Up @@ -1133,7 +1133,7 @@ a formula from a tap that is not `homebrew/core` use its fully-qualified form of

Display the path where *`formula`* is located.

### `generate-man-completions` [*`--fail-if-not-changed`*]
### `generate-man-completions`, `man` [*`--fail-if-not-changed`*]

Generate Homebrew's manpages and shell completions.

Expand Down
2 changes: 1 addition & 1 deletion manpages/brew.1
Original file line number Diff line number Diff line change
Expand Up @@ -1607,7 +1607,7 @@ Overwrite the destination formula if it already exists\.
.SS "\fBformula\fR \fIformula\fR [\.\.\.]"
Display the path where \fIformula\fR is located\.
.
.SS "\fBgenerate\-man\-completions\fR [\fI\-\-fail\-if\-not\-changed\fR]"
.SS "\fBgenerate\-man\-completions\fR, \fBman\fR [\fI\-\-fail\-if\-not\-changed\fR]"
Generate Homebrew\'s manpages and shell completions\.
.
.TP
Expand Down

0 comments on commit f65d525

Please sign in to comment.