Merge pull request #10056 from MikeMcQuaid/more-deprecations
More deprecations
This commit is contained in:
		
						commit
						603a0599cb
					
				@ -11,12 +11,6 @@ class BuildOptions
 | 
			
		||||
    @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"
 | 
			
		||||
  #
 | 
			
		||||
@ -33,9 +27,9 @@ class BuildOptions
 | 
			
		||||
 | 
			
		||||
    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
 | 
			
		||||
@ -50,7 +44,7 @@ class BuildOptions
 | 
			
		||||
 | 
			
		||||
  # 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}.
 | 
			
		||||
@ -61,7 +55,7 @@ class BuildOptions
 | 
			
		||||
  #   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}.
 | 
			
		||||
@ -71,18 +65,6 @@ class BuildOptions
 | 
			
		||||
    !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?
 | 
			
		||||
    !@args.empty? || !@options.empty?
 | 
			
		||||
@ -100,8 +82,7 @@ class BuildOptions
 | 
			
		||||
 | 
			
		||||
  private
 | 
			
		||||
 | 
			
		||||
  # TODO: rename to include? when include? is removed.
 | 
			
		||||
  def private_include?(name)
 | 
			
		||||
  def include?(name)
 | 
			
		||||
    @args.include?("--#{name}")
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -174,7 +174,7 @@ module Cask
 | 
			
		||||
                      [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?
 | 
			
		||||
 | 
			
		||||
@ -64,42 +64,6 @@ module Homebrew
 | 
			
		||||
        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
 | 
			
		||||
 | 
			
		||||
@ -57,7 +57,7 @@ module Homebrew
 | 
			
		||||
      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?
 | 
			
		||||
@ -94,14 +94,6 @@ module Homebrew
 | 
			
		||||
    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?
 | 
			
		||||
 | 
			
		||||
@ -115,8 +115,7 @@ module Homebrew
 | 
			
		||||
      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?
 | 
			
		||||
 | 
			
		||||
@ -49,9 +49,9 @@ module Homebrew
 | 
			
		||||
    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?
 | 
			
		||||
 | 
			
		||||
@ -78,7 +78,7 @@ module Homebrew
 | 
			
		||||
 | 
			
		||||
        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
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -25,41 +25,8 @@ module Homebrew
 | 
			
		||||
  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
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,2 @@
 | 
			
		||||
# typed: strict
 | 
			
		||||
# frozen_string_literal: true
 | 
			
		||||
 | 
			
		||||
require "compat/cli/parser"
 | 
			
		||||
require "compat/formula"
 | 
			
		||||
require "compat/global"
 | 
			
		||||
 | 
			
		||||
@ -1,20 +0,0 @@
 | 
			
		||||
# typed: true
 | 
			
		||||
# frozen_string_literal: true
 | 
			
		||||
 | 
			
		||||
require "compat/global"
 | 
			
		||||
 | 
			
		||||
module Homebrew
 | 
			
		||||
  module CLI
 | 
			
		||||
    class Parser
 | 
			
		||||
      module Compat
 | 
			
		||||
        def parse(*)
 | 
			
		||||
          args = super
 | 
			
		||||
          Homebrew.args = args.dup
 | 
			
		||||
          args
 | 
			
		||||
        end
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      prepend Compat
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
@ -1,15 +0,0 @@
 | 
			
		||||
# typed: strict
 | 
			
		||||
 | 
			
		||||
module Homebrew
 | 
			
		||||
  module CLI
 | 
			
		||||
    class Parser
 | 
			
		||||
      module Compat
 | 
			
		||||
        include Kernel
 | 
			
		||||
 | 
			
		||||
        module DeprecatedArgs
 | 
			
		||||
          include Kernel
 | 
			
		||||
        end
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
@ -1,24 +0,0 @@
 | 
			
		||||
# typed: true
 | 
			
		||||
# frozen_string_literal: true
 | 
			
		||||
 | 
			
		||||
class Formula
 | 
			
		||||
  module Compat
 | 
			
		||||
    def installed_prefix
 | 
			
		||||
      odisabled "Formula#installed_prefix",
 | 
			
		||||
                "Formula#latest_installed_prefix (or Formula#any_installed_prefix)"
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    # The currently installed version for this formula. Will raise an exception
 | 
			
		||||
    # if the formula is not installed.
 | 
			
		||||
    # @private
 | 
			
		||||
    def installed_version
 | 
			
		||||
      odisabled "Formula#installed_version"
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    def opt_or_installed_prefix_keg
 | 
			
		||||
      odisabled "Formula#opt_or_installed_prefix_keg", "Formula#any_installed_keg"
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  prepend Compat
 | 
			
		||||
end
 | 
			
		||||
@ -1,11 +0,0 @@
 | 
			
		||||
# typed: strict
 | 
			
		||||
 | 
			
		||||
class Formula
 | 
			
		||||
  module Compat
 | 
			
		||||
    include Kernel
 | 
			
		||||
 | 
			
		||||
    def any_installed_keg; end
 | 
			
		||||
 | 
			
		||||
    def latest_installed_prefix; end
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
@ -1,20 +0,0 @@
 | 
			
		||||
# typed: true
 | 
			
		||||
# frozen_string_literal: true
 | 
			
		||||
 | 
			
		||||
module Homebrew
 | 
			
		||||
  module Compat
 | 
			
		||||
    attr_writer :args
 | 
			
		||||
 | 
			
		||||
    def args
 | 
			
		||||
      unless @printed_args_warning
 | 
			
		||||
        odisabled "Homebrew.args", "`args = <command>_args.parse` and pass `args` along the call chain"
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      @args ||= CLI::Args.new
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  class << self
 | 
			
		||||
    prepend Compat
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
@ -1,8 +0,0 @@
 | 
			
		||||
# typed: strict
 | 
			
		||||
# frozen_string_literal: true
 | 
			
		||||
 | 
			
		||||
module Homebrew
 | 
			
		||||
  module Compat
 | 
			
		||||
    include Kernel
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
@ -1,12 +0,0 @@
 | 
			
		||||
# typed: true
 | 
			
		||||
# frozen_string_literal: true
 | 
			
		||||
 | 
			
		||||
module Language
 | 
			
		||||
  module Haskell
 | 
			
		||||
    module Cabal
 | 
			
		||||
      def self.included(_)
 | 
			
		||||
        odisabled "include Language::Haskell::Cabal"
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
@ -30,51 +30,8 @@ module Homebrew
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def diy
 | 
			
		||||
    args = diy_args.parse
 | 
			
		||||
    diy_args.parse
 | 
			
		||||
 | 
			
		||||
    odeprecated "`brew diy`"
 | 
			
		||||
 | 
			
		||||
    path = Pathname.getwd
 | 
			
		||||
 | 
			
		||||
    version = args.version || detect_version(path)
 | 
			
		||||
    name = args.name || detect_name(path, version)
 | 
			
		||||
 | 
			
		||||
    prefix = HOMEBREW_CELLAR/name/version
 | 
			
		||||
 | 
			
		||||
    if File.file? "CMakeLists.txt"
 | 
			
		||||
      puts "-DCMAKE_INSTALL_PREFIX=#{prefix}"
 | 
			
		||||
    elsif File.file? "configure"
 | 
			
		||||
      puts "--prefix=#{prefix}"
 | 
			
		||||
    elsif File.file? "meson.build"
 | 
			
		||||
      puts "-Dprefix=#{prefix}"
 | 
			
		||||
    else
 | 
			
		||||
      raise "Couldn't determine build system. You can manually put files into #{prefix}"
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def detect_version(path)
 | 
			
		||||
    version = path.version.to_s
 | 
			
		||||
    raise "Couldn't determine version, set it with --version=<version>" if version.empty?
 | 
			
		||||
 | 
			
		||||
    version
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def detect_name(path, version)
 | 
			
		||||
    basename = path.basename.to_s
 | 
			
		||||
    detected_name = basename[/(.*?)-?#{Regexp.escape(version)}/, 1] || basename
 | 
			
		||||
    detected_name.downcase!
 | 
			
		||||
 | 
			
		||||
    canonical_name = Formulary.canonical_name(detected_name)
 | 
			
		||||
 | 
			
		||||
    odie <<~EOS if detected_name != canonical_name
 | 
			
		||||
      The detected name #{detected_name.inspect} exists in Homebrew as an alias
 | 
			
		||||
      of #{canonical_name.inspect}. Consider using the canonical name instead:
 | 
			
		||||
        brew diy --name=#{canonical_name}
 | 
			
		||||
 | 
			
		||||
      To continue using the detected name, pass it explicitly:
 | 
			
		||||
        brew diy --name=#{detected_name}
 | 
			
		||||
    EOS
 | 
			
		||||
 | 
			
		||||
    detected_name
 | 
			
		||||
    odisabled "`brew diy`"
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
@ -361,7 +361,7 @@ module Homebrew
 | 
			
		||||
  def pr_pull
 | 
			
		||||
    args = pr_pull_args.parse
 | 
			
		||||
 | 
			
		||||
    odeprecated "`brew pr-pull --workflow`", "`brew pr-pull --workflows=`" if args.workflow.presence
 | 
			
		||||
    odisabled "`brew pr-pull --workflow`", "`brew pr-pull --workflows=`" if args.workflow.presence
 | 
			
		||||
 | 
			
		||||
    workflows = if args.workflow.blank?
 | 
			
		||||
      args.workflows.presence || ["tests.yml"]
 | 
			
		||||
 | 
			
		||||
@ -155,10 +155,6 @@ module Homebrew
 | 
			
		||||
                     "of Ruby is new enough.",
 | 
			
		||||
        boolean:     true,
 | 
			
		||||
      },
 | 
			
		||||
      HOMEBREW_GITHUB_API_PASSWORD:           {
 | 
			
		||||
        description: "Use this password for authentication with the GitHub API, for features " \
 | 
			
		||||
                     "such as `brew search`. This is deprecated in favour of using `HOMEBREW_GITHUB_API_TOKEN`.",
 | 
			
		||||
      },
 | 
			
		||||
      HOMEBREW_GITHUB_API_TOKEN:              {
 | 
			
		||||
        description: "Use this personal access token for the GitHub API, for features such as " \
 | 
			
		||||
                     "`brew search`. You can create one at <https://github.com/settings/tokens>. If set, " \
 | 
			
		||||
@ -167,10 +163,6 @@ module Homebrew
 | 
			
		||||
                     "\n\n    *Note:* Homebrew doesn't require permissions for any of the scopes, but some " \
 | 
			
		||||
                     "developer commands may require additional permissions.",
 | 
			
		||||
      },
 | 
			
		||||
      HOMEBREW_GITHUB_API_USERNAME:           {
 | 
			
		||||
        description: "Use this username for authentication with the GitHub API, for features " \
 | 
			
		||||
                     "such as `brew search`. This is deprecated in favour of using `HOMEBREW_GITHUB_API_TOKEN`.",
 | 
			
		||||
      },
 | 
			
		||||
      HOMEBREW_GIT_EMAIL:                     {
 | 
			
		||||
        description: "Set the Git author and committer email to this value.",
 | 
			
		||||
      },
 | 
			
		||||
 | 
			
		||||
@ -99,6 +99,8 @@ module Stdenv
 | 
			
		||||
 | 
			
		||||
  %w[O3 O2 O1 O0 Os].each do |opt|
 | 
			
		||||
    define_method opt do
 | 
			
		||||
      odeprecated "ENV.#{opt}"
 | 
			
		||||
 | 
			
		||||
      send(:remove_from_cflags, /-O./)
 | 
			
		||||
      send(:append_to_cflags, "-#{opt}")
 | 
			
		||||
    end
 | 
			
		||||
@ -139,18 +141,24 @@ module Stdenv
 | 
			
		||||
 | 
			
		||||
  sig { void }
 | 
			
		||||
  def m64
 | 
			
		||||
    odeprecated "ENV.m64"
 | 
			
		||||
 | 
			
		||||
    append_to_cflags "-m64"
 | 
			
		||||
    append "LDFLAGS", "-arch #{Hardware::CPU.arch_64_bit}"
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  sig { void }
 | 
			
		||||
  def m32
 | 
			
		||||
    odeprecated "ENV.m32"
 | 
			
		||||
 | 
			
		||||
    append_to_cflags "-m32"
 | 
			
		||||
    append "LDFLAGS", "-arch #{Hardware::CPU.arch_32_bit}"
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  sig { void }
 | 
			
		||||
  def universal_binary
 | 
			
		||||
    odeprecated "ENV.universal_binary"
 | 
			
		||||
 | 
			
		||||
    check_for_compiler_universal_support
 | 
			
		||||
 | 
			
		||||
    append_to_cflags Hardware::CPU.universal_archs.as_arch_flags
 | 
			
		||||
@ -176,6 +184,8 @@ module Stdenv
 | 
			
		||||
 | 
			
		||||
  sig { void }
 | 
			
		||||
  def libstdcxx
 | 
			
		||||
    odeprecated "ENV.libstdcxx"
 | 
			
		||||
 | 
			
		||||
    append "CXX", "-stdlib=libstdc++" if compiler == :clang
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -294,6 +294,8 @@ module Superenv
 | 
			
		||||
 | 
			
		||||
  sig { void }
 | 
			
		||||
  def universal_binary
 | 
			
		||||
    odeprecated "ENV.universal_binary"
 | 
			
		||||
 | 
			
		||||
    check_for_compiler_universal_support
 | 
			
		||||
 | 
			
		||||
    self["HOMEBREW_ARCHFLAGS"] = Hardware::CPU.universal_archs.as_arch_flags
 | 
			
		||||
@ -306,11 +308,15 @@ module Superenv
 | 
			
		||||
 | 
			
		||||
  sig { void }
 | 
			
		||||
  def m32
 | 
			
		||||
    odeprecated "ENV.m32"
 | 
			
		||||
 | 
			
		||||
    append "HOMEBREW_ARCHFLAGS", "-m32"
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  sig { void }
 | 
			
		||||
  def m64
 | 
			
		||||
    odeprecated "ENV.m64"
 | 
			
		||||
 | 
			
		||||
    append "HOMEBREW_ARCHFLAGS", "-m64"
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
@ -327,6 +333,8 @@ module Superenv
 | 
			
		||||
 | 
			
		||||
  sig { void }
 | 
			
		||||
  def libstdcxx
 | 
			
		||||
    odeprecated "ENV.libstdcxx"
 | 
			
		||||
 | 
			
		||||
    append_to_cccfg "h" if compiler == :clang
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
@ -338,6 +346,8 @@ module Superenv
 | 
			
		||||
 | 
			
		||||
  %w[O3 O2 O1 O0 Os].each do |opt|
 | 
			
		||||
    define_method opt do
 | 
			
		||||
      odeprecated "ENV.#{opt}"
 | 
			
		||||
 | 
			
		||||
      send(:[]=, "HOMEBREW_OPTIMIZATION_LEVEL", opt)
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
@ -26,23 +26,8 @@ class JavaRequirement < Requirement
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def java_home_cmd
 | 
			
		||||
    # TODO: disable for all macOS versions and Linux on next minor release
 | 
			
		||||
    #       but --version with ranges is broken on Big Sur today.
 | 
			
		||||
    if MacOS.version >= :big_sur && @version&.end_with?("+")
 | 
			
		||||
      odisabled %Q(depends_on java: "#{@version}"),
 | 
			
		||||
                'depends_on "openjdk@11", depends_on "openjdk@8" or depends_on "openjdk"'
 | 
			
		||||
    end
 | 
			
		||||
    odeprecated "depends_on :java",
 | 
			
		||||
                'depends_on "openjdk@11", depends_on "openjdk@8" or depends_on "openjdk"'
 | 
			
		||||
 | 
			
		||||
    return unless File.executable?("/usr/libexec/java_home")
 | 
			
		||||
 | 
			
		||||
    args = %w[--failfast]
 | 
			
		||||
    args << "--version" << @version.to_s if @version
 | 
			
		||||
    java_home = Utils.popen_read("/usr/libexec/java_home", *args).chomp
 | 
			
		||||
    return unless $CHILD_STATUS.success?
 | 
			
		||||
 | 
			
		||||
    Pathname.new(java_home)/"bin/java"
 | 
			
		||||
    odisabled "depends_on :java",
 | 
			
		||||
              'depends_on "openjdk@11", depends_on "openjdk@8" or depends_on "openjdk"'
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def env_apple
 | 
			
		||||
 | 
			
		||||
@ -2278,7 +2278,6 @@ class Formula
 | 
			
		||||
      if args.nil?
 | 
			
		||||
        @licenses
 | 
			
		||||
      else
 | 
			
		||||
        odisabled "`license [...]`", "`license any_of: [...]`" if args.is_a? Array
 | 
			
		||||
        @licenses = args
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
@ -33,13 +33,10 @@ class JavaRequirement < Requirement
 | 
			
		||||
    next true
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def initialize(tags = [])
 | 
			
		||||
    odeprecated "depends_on :java",
 | 
			
		||||
                '"depends_on "openjdk@11", "depends_on "openjdk@8" or "depends_on "openjdk"'
 | 
			
		||||
 | 
			
		||||
    @version = tags.shift if tags.first&.match?(/^\d/)
 | 
			
		||||
    super(tags)
 | 
			
		||||
    @cask = suggestion.token
 | 
			
		||||
  def initialize(_tags = [])
 | 
			
		||||
    odisabled "depends_on :java",
 | 
			
		||||
              '"depends_on "openjdk@11", "depends_on "openjdk@8" or "depends_on "openjdk"'
 | 
			
		||||
    super
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  sig { returns(String) }
 | 
			
		||||
 | 
			
		||||
@ -232,14 +232,6 @@ class Tab < OpenStruct
 | 
			
		||||
    used_options.include? opt
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def universal?
 | 
			
		||||
    odisabled "Tab#universal?"
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def cxx11?
 | 
			
		||||
    odisabled "Tab#cxx11?"
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def head?
 | 
			
		||||
    spec == :head
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
@ -15,12 +15,6 @@ describe Cask::Cmd, :cask do
 | 
			
		||||
      allow(Homebrew).to receive(:raise_deprecation_exceptions?).and_return(false)
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    it "prints help output when subcommand receives `--help` flag" do
 | 
			
		||||
      expect {
 | 
			
		||||
        described_class.run("info", "--help")
 | 
			
		||||
      }.to output(/Displays information about the given cask/).to_stdout
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    it "exits with a status of 1 when something goes wrong" do
 | 
			
		||||
      allow(described_class).to receive(:lookup_command).and_raise(Cask::CaskError)
 | 
			
		||||
      command = described_class.new("noop")
 | 
			
		||||
 | 
			
		||||
@ -1,12 +0,0 @@
 | 
			
		||||
# typed: false
 | 
			
		||||
# frozen_string_literal: true
 | 
			
		||||
 | 
			
		||||
describe "brew cask", :integration_test, :needs_macos, :needs_network do
 | 
			
		||||
  describe "list" do
 | 
			
		||||
    it "returns a list of installed Casks" do
 | 
			
		||||
      setup_remote_tap "homebrew/cask"
 | 
			
		||||
 | 
			
		||||
      expect { brew "cask", "list" }.to be_a_success
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
@ -88,10 +88,8 @@ module Utils
 | 
			
		||||
      Utils.popen_read(git, "-C", repo, "show", "#{commit}:#{relative_file}")
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    def commit_message(repo, commit = nil)
 | 
			
		||||
      odeprecated "Utils::Git.commit_message(repo)", "Pathname(repo).git_commit_message"
 | 
			
		||||
      commit ||= "HEAD"
 | 
			
		||||
      Pathname(repo).extend(GitRepositoryExtension).git_commit_message(commit)
 | 
			
		||||
    def commit_message(_repo, _commit = nil)
 | 
			
		||||
      odisabled "Utils::Git.commit_message(repo)", "Pathname(repo).git_commit_message"
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    def ensure_installed!
 | 
			
		||||
@ -135,14 +133,12 @@ module Utils
 | 
			
		||||
                        .prepend(Formula["gnupg"].opt_bin)
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    def origin_branch(repo)
 | 
			
		||||
      odeprecated "Utils::Git.origin_branch(repo)", "Pathname(repo).git_origin_branch"
 | 
			
		||||
      Pathname(repo).extend(GitRepositoryExtension).git_origin_branch
 | 
			
		||||
    def origin_branch(_repo)
 | 
			
		||||
      odisabled "Utils::Git.origin_branch(repo)", "Pathname(repo).git_origin_branch"
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    def current_branch(repo)
 | 
			
		||||
      odeprecated "Utils::Git.current_branch(repo)", "Pathname(repo).git_branch"
 | 
			
		||||
      Pathname(repo).extend(GitRepositoryExtension).git_branch
 | 
			
		||||
    def current_branch(_repo)
 | 
			
		||||
      odisabled "Utils::Git.current_branch(repo)", "Pathname(repo).git_branch"
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    # Special case of `git cherry-pick` that permits non-verbose output and
 | 
			
		||||
 | 
			
		||||
@ -92,13 +92,6 @@ module GitHub
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def env_username_password
 | 
			
		||||
    return unless Homebrew::EnvConfig.github_api_username
 | 
			
		||||
    return unless Homebrew::EnvConfig.github_api_password
 | 
			
		||||
 | 
			
		||||
    odisabled "the GitHub API with HOMEBREW_GITHUB_API_PASSWORD", "HOMEBREW_GITHUB_API_TOKEN"
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  # Gets the password field from `git-credential-osxkeychain` for github.com,
 | 
			
		||||
  # but only if that password looks like a GitHub Personal Access Token.
 | 
			
		||||
  sig { returns(T.nilable(String)) }
 | 
			
		||||
@ -128,7 +121,7 @@ module GitHub
 | 
			
		||||
 | 
			
		||||
  def api_credentials
 | 
			
		||||
    @api_credentials ||= begin
 | 
			
		||||
      Homebrew::EnvConfig.github_api_token || env_username_password || keychain_username_password
 | 
			
		||||
      Homebrew::EnvConfig.github_api_token || keychain_username_password
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
@ -136,8 +129,6 @@ module GitHub
 | 
			
		||||
  def api_credentials_type
 | 
			
		||||
    if Homebrew::EnvConfig.github_api_token
 | 
			
		||||
      :env_token
 | 
			
		||||
    elsif env_username_password
 | 
			
		||||
      :env_username_password
 | 
			
		||||
    elsif keychain_username_password
 | 
			
		||||
      :keychain_username_password
 | 
			
		||||
    else
 | 
			
		||||
 | 
			
		||||
@ -1773,17 +1773,11 @@ example, run `export HOMEBREW_NO_INSECURE_REDIRECT=1` rather than just
 | 
			
		||||
- `HOMEBREW_FORCE_VENDOR_RUBY`
 | 
			
		||||
  <br>If set, always use Homebrew's vendored, relocatable Ruby version even if the system version of Ruby is new enough.
 | 
			
		||||
 | 
			
		||||
- `HOMEBREW_GITHUB_API_PASSWORD`
 | 
			
		||||
  <br>Use this password for authentication with the GitHub API, for features such as `brew search`. This is deprecated in favour of using `HOMEBREW_GITHUB_API_TOKEN`.
 | 
			
		||||
 | 
			
		||||
- `HOMEBREW_GITHUB_API_TOKEN`
 | 
			
		||||
  <br>Use this personal access token for the GitHub API, for features such as `brew search`. You can create one at <https://github.com/settings/tokens>. If set, GitHub will allow you a greater number of API requests. For more information, see: <https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting>
 | 
			
		||||
 | 
			
		||||
    *Note:* Homebrew doesn't require permissions for any of the scopes, but some developer commands may require additional permissions.
 | 
			
		||||
 | 
			
		||||
- `HOMEBREW_GITHUB_API_USERNAME`
 | 
			
		||||
  <br>Use this username for authentication with the GitHub API, for features such as `brew search`. This is deprecated in favour of using `HOMEBREW_GITHUB_API_TOKEN`.
 | 
			
		||||
 | 
			
		||||
- `HOMEBREW_GIT_EMAIL`
 | 
			
		||||
  <br>Set the Git author and committer email to this value.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -2524,12 +2524,6 @@ If set, running Homebrew on Linux will use URLs for macOS\. This is useful when
 | 
			
		||||
If set, always use Homebrew\'s vendored, relocatable Ruby version even if the system version of Ruby is new enough\.
 | 
			
		||||
.
 | 
			
		||||
.TP
 | 
			
		||||
\fBHOMEBREW_GITHUB_API_PASSWORD\fR
 | 
			
		||||
.
 | 
			
		||||
.br
 | 
			
		||||
Use this password for authentication with the GitHub API, for features such as \fBbrew search\fR\. This is deprecated in favour of using \fBHOMEBREW_GITHUB_API_TOKEN\fR\.
 | 
			
		||||
.
 | 
			
		||||
.TP
 | 
			
		||||
\fBHOMEBREW_GITHUB_API_TOKEN\fR
 | 
			
		||||
.
 | 
			
		||||
.br
 | 
			
		||||
@ -2539,12 +2533,6 @@ Use this personal access token for the GitHub API, for features such as \fBbrew
 | 
			
		||||
\fINote:\fR Homebrew doesn\'t require permissions for any of the scopes, but some developer commands may require additional permissions\.
 | 
			
		||||
.
 | 
			
		||||
.TP
 | 
			
		||||
\fBHOMEBREW_GITHUB_API_USERNAME\fR
 | 
			
		||||
.
 | 
			
		||||
.br
 | 
			
		||||
Use this username for authentication with the GitHub API, for features such as \fBbrew search\fR\. This is deprecated in favour of using \fBHOMEBREW_GITHUB_API_TOKEN\fR\.
 | 
			
		||||
.
 | 
			
		||||
.TP
 | 
			
		||||
\fBHOMEBREW_GIT_EMAIL\fR
 | 
			
		||||
.
 | 
			
		||||
.br
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user