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

More deprecations #10056

Merged
merged 1 commit into from
Dec 18, 2020
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 5 additions & 24 deletions Library/Homebrew/build_options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@ def initialize(args, options)
@options = options
end

# TODO: rename private_include? when include? is removed.
# @deprecated
def include?(_)
odisabled "BuildOptions#include?"
end

# True if a {Formula} is being built with a specific option.
# <pre>args << "--i-want-spam" if build.with? "spam"
#
Expand All @@ -33,9 +27,9 @@ def with?(val)

option_names.any? do |name|
if option_defined? "with-#{name}"
private_include? "with-#{name}"
include? "with-#{name}"
elsif option_defined? "without-#{name}"
!private_include? "without-#{name}"
!include? "without-#{name}" # rubocop:disable Rails/NegateInclude
else
false
end
Expand All @@ -50,7 +44,7 @@ def without?(val)

# True if a {Formula} is being built as a bottle (i.e. binary package).
def bottle?
private_include? "build-bottle"
include? "build-bottle"
end

# True if a {Formula} is being built with {Formula.head} instead of {Formula.stable}.
Expand All @@ -61,7 +55,7 @@ def bottle?
# args << "--and-a-cold-beer" if build.with? "cold-beer"
# end</pre>
def head?
private_include? "HEAD"
include? "HEAD"
end

# True if a {Formula} is being built with {Formula.stable} instead of {Formula.head}.
Expand All @@ -71,18 +65,6 @@ def stable?
!head?
end

# True if a {Formula} is being built universally.
# e.g. on newer Intel Macs this means a combined x86_64/x86 binary/library.
# <pre>args << "--universal-binary" if build.universal?</pre>
def universal?
odisabled "BuildOptions#universal?"
end

# True if a {Formula} is being built in C++11 mode.
def cxx11?
odisabled "BuildOptions#cxx11?"
end

# True if the build has any arguments or options specified.
def any_args_or_options?
[email protected]? || [email protected]?
Expand All @@ -100,8 +82,7 @@ def unused_options

private

# TODO: rename to include? when include? is removed.
def private_include?(name)
def include?(name)
@args.include?("--#{name}")
end

Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/cask/cmd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def run
[args.remaining.empty? ? NullCommand : UnknownSubcommand.new(args.remaining.first), argv]

if (replacement = DEPRECATED_COMMANDS[command])
odeprecated "brew cask #{command.command_name}", replacement
odisabled "brew cask #{command.command_name}", replacement
end

if args.help?
Expand Down
36 changes: 0 additions & 36 deletions Library/Homebrew/cli/args.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,42 +64,6 @@ def no_named?
named.blank?
end

def formulae
odisabled "args.formulae", "args.named.to_formulae"
end

def formulae_and_casks
odisabled "args.formulae_and_casks", "args.named.to_formulae_and_casks"
end

def resolved_formulae
odisabled "args.resolved_formulae", "args.named.to_resolved_formulae"
end

def resolved_formulae_casks
odisabled "args.resolved_formulae_casks", "args.named.to_resolved_formulae_to_casks"
end

def formulae_paths
odisabled "args.formulae_paths", "args.named.to_formulae_paths"
end

def casks
odisabled "args.casks", "args.named.homebrew_tap_cask_names"
end

def loaded_casks
odisabled "args.loaded_casks", "args.named.to_cask"
end

def kegs
odisabled "args.kegs", "args.named.to_kegs"
end

def kegs_casks
odisabled "args.kegs", "args.named.to_kegs_to_casks"
end

def build_stable?
!HEAD?
end
Expand Down
10 changes: 1 addition & 9 deletions Library/Homebrew/cmd/gist-logs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def gistify_logs(f, args:)
files["00.tap.out"] = { content: tap }
end

odisabled "`brew gist-logs` with a password", "HOMEBREW_GITHUB_API_TOKEN" if GitHub.api_credentials_type == :none
odie "`brew gist-logs` requires HOMEBREW_GITHUB_API_TOKEN to be set!" if GitHub.api_credentials_type == :none

# Description formatted to work well as page title when viewing gist
descr = if f.core_formula?
Expand Down Expand Up @@ -94,14 +94,6 @@ def noecho_gets
result
end

def login!
print "GitHub User: "
ENV["HOMEBREW_GITHUB_API_USERNAME"] = $stdin.gets.chomp
print "Password: "
ENV["HOMEBREW_GITHUB_API_PASSWORD"] = noecho_gets.chomp
puts
end

def load_logs(dir)
logs = {}
if dir.exist?
Expand Down
3 changes: 1 addition & 2 deletions Library/Homebrew/cmd/list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@ def list
ls_args << "-t" if args.t?

if !$stdout.tty? && !args.formula? && !args.cask?
odeprecated "`brew list` to only list formulae", "`brew list --formula`"
safe_system "ls", *ls_args, HOMEBREW_CELLAR
odisabled "`brew list` to only list formulae", "`brew list --formula`"
else
safe_system "ls", *ls_args, HOMEBREW_CELLAR unless args.cask?
list_casks(args: args) unless args.formula?
Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/cmd/outdated.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ def outdated
args = outdated_args.parse

case (j = json_version(args.json))
when :v1, :default
when :v1
odisabled "brew outdated --json#{j == :v1 ? "=v1" : ""}", "brew outdated --json=v2"
when :v2
when :v2, :default
formulae, casks = if args.formula?
[outdated_formulae(args: args), []]
elsif args.cask?
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/cmd/search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def search

puts Formatter.columns(Cask::Cask.to_a.map(&:full_name).sort)
else
# odeprecated "'brew search' with no arguments to output formulae", "'brew formulae'"
odeprecated "'brew search' with no arguments to output formulae", "'brew formulae'"
puts Formatter.columns(Formula.full_names.sort)
end

Expand Down
37 changes: 2 additions & 35 deletions Library/Homebrew/cmd/switch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,41 +25,8 @@ def switch_args
end

def switch
args = switch_args.parse
switch_args.parse

name = args.named.first
rack = Formulary.to_rack(name)

odie "#{name} not found in the Cellar." unless rack.directory?

odeprecated "`brew switch`", "`brew link` @-versioned formulae"

versions = rack.subdirs
.map { |d| Keg.new(d).version }
.sort
.join(", ")
version = args.named.second

odie <<~EOS unless (rack/version).directory?
#{name} does not have a version \"#{version}\" in the Cellar.
#{name}'s installed versions: #{versions}
EOS

# Unlink all existing versions
rack.subdirs.each do |v|
keg = Keg.new(v)
puts "Cleaning #{keg}"
keg.unlink
end

keg = Keg.new(rack/version)

# Link new version, if not keg-only
if Formulary.keg_only?(rack)
keg.optlink(verbose: args.verbose?)
puts "Opt link created for #{keg}"
else
puts "#{keg.link} links created for #{keg}"
end
odisabled "`brew switch`", "`brew link` @-versioned formulae"
end
end
4 changes: 0 additions & 4 deletions Library/Homebrew/compat.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
# typed: strict
# frozen_string_literal: true

require "compat/cli/parser"
require "compat/formula"
require "compat/global"
20 changes: 0 additions & 20 deletions Library/Homebrew/compat/cli/parser.rb

This file was deleted.

15 changes: 0 additions & 15 deletions Library/Homebrew/compat/cli/parser.rbi

This file was deleted.

24 changes: 0 additions & 24 deletions Library/Homebrew/compat/formula.rb

This file was deleted.

11 changes: 0 additions & 11 deletions Library/Homebrew/compat/formula.rbi

This file was deleted.

20 changes: 0 additions & 20 deletions Library/Homebrew/compat/global.rb

This file was deleted.

8 changes: 0 additions & 8 deletions Library/Homebrew/compat/global.rbi

This file was deleted.

12 changes: 0 additions & 12 deletions Library/Homebrew/compat/language/haskell.rb

This file was deleted.

Loading