More deprecated/disabled updates

- remove odisabled
- move odeprecated to odisabled
This commit is contained in:
Mike McQuaid 2018-10-24 10:00:49 +01:00
parent 53ecfda2b7
commit fc418fd333
No known key found for this signature in database
GPG Key ID: 48A898132FD8EE70
15 changed files with 15 additions and 151 deletions

View File

@ -38,8 +38,6 @@ module Homebrew
def tap
if ARGV.include? "--repair"
Tap.each(&:link_completions_and_manpages)
elsif ARGV.include? "--list-official"
odisabled("brew tap --list-official")
elsif ARGV.include? "--list-pinned"
puts Tap.select(&:pinned?).map(&:name)
elsif ARGV.named.empty?

View File

@ -1,10 +1,6 @@
require "compat/os/mac"
require "compat/requirements/x11_requirement"
require "compat/requirements/xcode_requirement"
require "compat/dependable"
require "compat/dependency_collector"
require "compat/cask"
require "compat/download_strategy"
require "compat/fileutils"
require "compat/formula_support"
require "compat/cask"
require "compat/tap"

View File

@ -6,6 +6,8 @@ module Cask
module Compat
private
# TODO: can't delete this code until the merge of
# https://github.com/Homebrew/brew/pull/4730 or an equivalent.
def cask(header_token, **options, &block)
if header_token.is_a?(Hash) && header_token.key?(:v1)
odisabled %q("cask :v1 => 'token'"), %q("cask 'token'")

View File

@ -16,9 +16,7 @@ module Cask
end
def run
odeprecated "`brew cask --version`", "`brew --version`", disable_on: Time.new(2018, 10, 31)
ARGV.clear
Homebrew.__version
odisabled "`brew cask --version`", "`brew --version`"
end
def self.help

View File

@ -22,18 +22,7 @@ module Cask
end
def run
odeprecated "`brew cask cleanup`", "`brew cleanup`", disable_on: Time.new(2018, 9, 30)
cleanup = Homebrew::Cleanup.new
casks(alternative: -> { Cask.to_a }).each do |cask|
cleanup.cleanup_cask(cask)
end
return if cleanup.disk_cleanup_size.zero?
disk_space = disk_usage_readable(cleanup.disk_cleanup_size)
ohai "This operation has freed approximately #{disk_space} of disk space."
odisabled "`brew cask cleanup`", "`brew cleanup`"
end
end
end

View File

@ -6,8 +6,7 @@ module Cask
module Compat
class Search < AbstractCommand
def run
odeprecated "`brew cask search`", "`brew search`", disable_on: Time.new(2018, 9, 30)
Homebrew.search(args.empty? ? "--casks" : args)
odisabled "`brew cask search`", "`brew search`"
end
def self.visible

View File

@ -1,8 +1,11 @@
module Cask
class DSL
module Compat
# TODO: can't delete this code until the merge of
# https://github.com/Homebrew/brew/pull/4730 or an equivalent.
def gpg(*)
odeprecated "the `gpg` stanza", disable_on: Time.new(2018, 12, 31)
odisabled "the `gpg` stanza"
end
def license(*)
@ -10,7 +13,7 @@ module Cask
end
def accessibility_access(*)
odeprecated "the `accessibility_access` stanza"
odisabled "the `accessibility_access` stanza"
end
end

View File

@ -1,10 +0,0 @@
module Dependable
module Compat
def run?
odisabled "Dependable#run?"
tags.include? :run
end
end
prepend Compat
end

View File

@ -1,12 +0,0 @@
require "dependency_collector"
class DependencyCollector
module Compat
def parse_string_spec(spec, tags)
odisabled "'depends_on ... => :run'" if tags.include?(:run)
super
end
end
prepend Compat
end

View File

@ -2,16 +2,12 @@ require "fileutils"
module FileUtils
module Compat
def ruby(*args)
odeprecated "ruby", 'system "ruby"'
system RUBY_PATH, *args
def ruby(*)
odisabled "ruby", 'system "ruby"'
end
def mktemp(prefix = name, opts = {})
odeprecated("FileUtils.mktemp", "mktemp")
Mktemp.new(prefix, opts).run do |staging|
yield staging
end
def mktemp(*)
odisabled("FileUtils.mktemp", "mktemp")
end
module_function :mktemp
end

View File

@ -1,75 +0,0 @@
require "formula_support"
class KegOnlyReason
module Compat
def valid?
case @reason
when :provided_pre_mountain_lion
odisabled "keg_only :provided_pre_mountain_lion"
MacOS.version < :mountain_lion
when :provided_pre_mavericks
odisabled "keg_only :provided_pre_mavericks"
MacOS.version < :mavericks
when :provided_pre_el_capitan
odisabled "keg_only :provided_pre_el_capitan"
MacOS.version < :el_capitan
when :provided_pre_high_sierra
odisabled "keg_only :provided_pre_high_sierra"
MacOS.version < :high_sierra
when :provided_until_xcode43
odisabled "keg_only :provided_until_xcode43"
MacOS::Xcode.version < "4.3"
when :provided_until_xcode5
odisabled "keg_only :provided_until_xcode5"
MacOS::Xcode.version < "5.0"
else
super
end
end
def to_s
case @reason
when :provided_pre_mountain_lion
odisabled "keg_only :provided_pre_mountain_lion"
<<~EOS
macOS already provides this software in versions before Mountain Lion
EOS
when :provided_pre_mavericks
odisabled "keg_only :provided_pre_mavericks"
<<~EOS
macOS already provides this software in versions before Mavericks
EOS
when :provided_pre_el_capitan
odisabled "keg_only :provided_pre_el_capitan"
<<~EOS
macOS already provides this software in versions before El Capitan
EOS
when :provided_pre_high_sierra
odisabled "keg_only :provided_pre_high_sierra"
<<~EOS
macOS already provides this software in versions before High Sierra
EOS
when :provided_until_xcode43
odisabled "keg_only :provided_until_xcode43"
<<~EOS
Xcode provides this software prior to version 4.3
EOS
when :provided_until_xcode5
odisabled "keg_only :provided_until_xcode5"
<<~EOS
Xcode provides this software prior to version 5
EOS
else
super
end.to_s.strip
end
end
prepend Compat
end

View File

@ -1,14 +0,0 @@
module OS
module Mac
class << self
module Compat
def release
odisabled "MacOS.release", "MacOS.version"
version
end
end
prepend Compat
end
end
end

View File

@ -2532,7 +2532,6 @@ class Formula
# version '4.8.1'
# end</pre>
def fails_with(compiler, &block)
odisabled "fails_with :llvm" if compiler == :llvm
specs.each { |spec| spec.fails_with(compiler, &block) }
end

View File

@ -150,10 +150,6 @@ class Requirement
attr_reader :env_proc, :build
attr_rw :fatal, :cask, :download
def default_formula(_val = nil)
odisabled "Requirement.default_formula"
end
def satisfy(options = nil, &block)
return @satisfied if options.nil? && !block_given?

View File

@ -212,7 +212,6 @@ class SoftwareSpec
end
def fails_with(compiler, &block)
odisabled "fails_with :llvm" if compiler == :llvm
compiler_failures << CompilerFailure.create(compiler, &block)
end