diff --git a/Library/Homebrew/build_options.rb b/Library/Homebrew/build_options.rb index be0da2a8efe5a779b30e9691ef0f439c8f0e379b..f4f51be48d688ae577738d2f32ade76d8400251c 100644 --- a/Library/Homebrew/build_options.rb +++ b/Library/Homebrew/build_options.rb @@ -10,11 +10,11 @@ class BuildOptions @options = options end - # True if a {Formula} is being built with a specific option - # (which isn't named `with-*` or `without-*`). + # TODO: rename private_include? when include? is removed. # @deprecated def include?(name) - @args.include?("--#{name}") + odeprecated "BuildOptions#include?" + private_include?("--#{name}") end # True if a {Formula} is being built with a specific option. @@ -33,9 +33,9 @@ class BuildOptions option_names.any? do |name| if option_defined? "with-#{name}" - include? "with-#{name}" + private_include? "with-#{name}" elsif option_defined? "without-#{name}" - !include? "without-#{name}" + !private_include? "without-#{name}" else false end @@ -50,7 +50,7 @@ class BuildOptions # True if a {Formula} is being built as a bottle (i.e. binary package). def bottle? - include? "build-bottle" + private_include? "build-bottle" end # True if a {Formula} is being built with {Formula.head} instead of {Formula.stable}. @@ -61,32 +61,33 @@ class BuildOptions # args << "--and-a-cold-beer" if build.with? "cold-beer" # end</pre> def head? - include? "HEAD" + private_include? "HEAD" end - # True if a {Formula} is being built with {Formula.devel} instead of {Formula.stable}. - # <pre>args << "--some-beta" if build.devel?</pre> + # @private def devel? - include? "devel" + odisabled "BuildOptions#devel?" end - # True if a {Formula} is being built with {Formula.stable} instead of {Formula.devel} - # or {Formula.head}. This is the default. - # <pre>args << "--some-beta" if build.devel?</pre> + # True if a {Formula} is being built with {Formula.stable} instead of {Formula.head}. + # This is the default. + # <pre>args << "--some-beta" if build.head?</pre> def stable? - !(head? || devel?) + !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? - include?("universal") && option_defined?("universal") + odeprecated "BuildOptions#universal?" + private_include?("universal") && option_defined?("universal") end # True if a {Formula} is being built in C++11 mode. def cxx11? - include?("c++11") && option_defined?("c++11") + odeprecated "BuildOptions#cxx11?" + private_include?("c++11") && option_defined?("c++11") end # True if the build has any arguments or options specified. @@ -106,6 +107,11 @@ class BuildOptions private + # TODO: rename to include? when include? is removed. + def private_include?(name) + @args.include?("--#{name}") + end + def option_defined?(name) @options.include? name end diff --git a/Library/Homebrew/cask/cmd.rb b/Library/Homebrew/cask/cmd.rb index b353a79fc67f94edfffbdf105b2c08937ba56008..5ef9a9f634290dbd69c28dab52dcb1d7b648a934 100644 --- a/Library/Homebrew/cask/cmd.rb +++ b/Library/Homebrew/cask/cmd.rb @@ -227,10 +227,9 @@ module Cask detect_external_command(*argv) || [args.remaining.empty? ? NullCommand : UnknownSubcommand.new(args.remaining.first), argv] - # TODO: enable for next major/minor release - # if (replacement = DEPRECATED_COMMANDS[command]) - # odeprecated "brew cask #{command.command_name}", replacement - # end + if (replacement = DEPRECATED_COMMANDS[command]) + odeprecated "brew cask #{command.command_name}", replacement + end if args.help? puts command.help diff --git a/Library/Homebrew/cli/args.rb b/Library/Homebrew/cli/args.rb index f8061d7e14c70c3a2ac1b44ace5f41f9e455aa4f..ed8a15c3e57171d7ef890b319742a6668955795d 100644 --- a/Library/Homebrew/cli/args.rb +++ b/Library/Homebrew/cli/args.rb @@ -57,66 +57,57 @@ module Homebrew end def formulae - # TODO: enable for next major/minor release - # odeprecated "args.formulae", "args.named.to_formulae" + odeprecated "args.formulae", "args.named.to_formulae" named.to_formulae end def formulae_and_casks - # TODO: enable for next major/minor release - # odeprecated "args.formulae_and_casks", "args.named.to_formulae_and_casks" + odeprecated "args.formulae_and_casks", "args.named.to_formulae_and_casks" named.to_formulae_and_casks end def resolved_formulae - # TODO: enable for next major/minor release - # odeprecated "args.resolved_formulae", "args.named.to_resolved_formulae" + odeprecated "args.resolved_formulae", "args.named.to_resolved_formulae" named.to_resolved_formulae end def resolved_formulae_casks - # TODO: enable for next major/minor release - # odeprecated "args.resolved_formulae_casks", "args.named.to_resolved_formulae_to_casks" + odeprecated "args.resolved_formulae_casks", "args.named.to_resolved_formulae_to_casks" named.to_resolved_formulae_to_casks end def formulae_paths - # TODO: enable for next major/minor release - # odeprecated "args.formulae_paths", "args.named.to_formulae_paths" + odeprecated "args.formulae_paths", "args.named.to_formulae_paths" named.to_formulae_paths end def casks - # TODO: enable for next major/minor release - # odeprecated "args.casks", "args.named.homebrew_tap_cask_names" + odeprecated "args.casks", "args.named.homebrew_tap_cask_names" named.homebrew_tap_cask_names end def loaded_casks - # TODO: enable for next major/minor release - # odeprecated "args.loaded_casks", "args.named.to_cask" + odeprecated "args.loaded_casks", "args.named.to_cask" named.to_casks end def kegs - # TODO: enable for next major/minor release - # odeprecated "args.kegs", "args.named.to_kegs" + odeprecated "args.kegs", "args.named.to_kegs" named.to_kegs end def kegs_casks - # TODO: enable for next major/minor release - # odeprecated "args.kegs", "args.named.to_kegs_to_casks" + odeprecated "args.kegs", "args.named.to_kegs_to_casks" named.to_kegs_to_casks end def build_stable? - !(HEAD? || devel?) + !HEAD? end def build_from_source_formulae if build_from_source? || build_bottle? - formulae.map(&:full_name) + named.to_formulae.map(&:full_name) else [] end @@ -124,7 +115,7 @@ module Homebrew def include_test_formulae if include_test? - formulae.map(&:full_name) + named.to_formulae.map(&:full_name) else [] end @@ -171,8 +162,6 @@ module Homebrew def spec(default = :stable) if HEAD? :head - elsif devel? - :devel else default end diff --git a/Library/Homebrew/cli/parser.rb b/Library/Homebrew/cli/parser.rb index 6b86cff43a7dcfbc7243b8a06e5754e668febf64..be94c98aa0b3b8088ee3b2250a16ce2d355b9d96 100644 --- a/Library/Homebrew/cli/parser.rb +++ b/Library/Homebrew/cli/parser.rb @@ -410,8 +410,6 @@ module Homebrew named_args = argv.reject { |arg| arg.start_with?("-") } + non_options spec = if argv.include?("--HEAD") :head - elsif argv.include?("--devel") - :devel else :stable end diff --git a/Library/Homebrew/cmd/info.rb b/Library/Homebrew/cmd/info.rb index f9757b7af0c98616a6abb19c45647d4e095f4866..ba2b7a26b38aadf0cf558957c0a8207cb70de865 100644 --- a/Library/Homebrew/cmd/info.rb +++ b/Library/Homebrew/cmd/info.rb @@ -166,10 +166,6 @@ module Homebrew specs << s end - if devel = f.devel - specs << "devel #{devel.version}" - end - specs << "HEAD" if f.head attrs = [] @@ -229,7 +225,7 @@ module Homebrew end end - if !f.options.empty? || f.head || f.devel + if !f.options.empty? || f.head ohai "Options" Options.dump_for_formula f end diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index 5dad52493e1b16069033af12c7d1043b38957f2a..f9464abbcc081f7bee205978e409b8fb59543469 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -54,8 +54,6 @@ module Homebrew "macOS, even if it would not normally be used for installation." switch "--include-test", description: "Install testing dependencies required to run `brew test` <formula>." - switch "--devel", - description: "If <formula> defines it, install the development version." switch "--HEAD", description: "If <formula> defines it, install the HEAD version, aka. master, trunk, unstable." switch "--fetch-HEAD", @@ -133,31 +131,16 @@ module Homebrew args.named.to_formulae.each do |f| # head-only without --HEAD is an error - if !args.HEAD? && f.stable.nil? && f.devel.nil? + if !args.HEAD? && f.stable.nil? raise <<~EOS #{f.full_name} is a head-only formula Install with `brew install --HEAD #{f.full_name}` EOS end - # devel-only without --devel is an error - if !args.devel? && f.stable.nil? && f.head.nil? - raise <<~EOS - #{f.full_name} is a devel-only formula - Install with `brew install --devel #{f.full_name}` - EOS - end - - if !(args.HEAD? || args.devel?) && f.stable.nil? - raise "#{f.full_name} has no stable download, please choose --devel or --HEAD" - end - # --HEAD, fail with no head defined raise "No head is defined for #{f.full_name}" if args.HEAD? && f.head.nil? - # --devel, fail with no devel defined - raise "No devel block is defined for #{f.full_name}" if args.devel? && f.devel.nil? - installed_head_version = f.latest_head_version if installed_head_version && !f.head_version_outdated?(installed_head_version, fetch_head: args.fetch_HEAD?) diff --git a/Library/Homebrew/cmd/outdated.rb b/Library/Homebrew/cmd/outdated.rb index d567d0f418ee48d4405209db11a5631536ce2947..a0d6b9eaf3f824c4d1ece9e8a371d7bd53cf47a5 100644 --- a/Library/Homebrew/cmd/outdated.rb +++ b/Library/Homebrew/cmd/outdated.rb @@ -44,10 +44,9 @@ module Homebrew def outdated args = outdated_args.parse - case json_version(args.json) + case (j = json_version(args.json)) when :v1, :default - # TODO: enable for next major/minor release - # odeprecated "brew outdated --json#{json_version == :v1 ? "=v1" : ""}", "brew outdated --json=v2" + odeprecated "brew outdated --json#{j == :v1 ? "=v1" : ""}", "brew outdated --json=v2" outdated = if args.formula? || !args.cask? outdated_formulae args: args diff --git a/Library/Homebrew/cmd/uses.rb b/Library/Homebrew/cmd/uses.rb index d45a2d6cc7c92b6ba49ec06eb588e28733d60fb4..d9085b745f5c3eccdc2621367d6b2ee770f5a49b 100644 --- a/Library/Homebrew/cmd/uses.rb +++ b/Library/Homebrew/cmd/uses.rb @@ -36,12 +36,6 @@ module Homebrew description: "Include all formulae that specify <formula> as `:optional` type dependency." switch "--skip-recommended", description: "Skip all formulae that specify <formula> as `:recommended` type dependency." - switch "--devel", - description: "Show usage of <formula> by development builds." - switch "--HEAD", - description: "Show usage of <formula> by HEAD builds." - - conflicts "--devel", "--HEAD" min_named :formula end end @@ -49,9 +43,6 @@ module Homebrew def uses args = uses_args.parse - odeprecated "brew uses --devel" if args.devel? - odeprecated "brew uses --HEAD" if args.HEAD? - Formulary.enable_factory_cache! used_formulae_missing = false diff --git a/Library/Homebrew/compat/dependencies_helpers.rb b/Library/Homebrew/compat/dependencies_helpers.rb index 095c89101187d914686de5c8abc31ce457b9ff4c..5bb5461c0938c18a36e3d54151bd139071744fd2 100644 --- a/Library/Homebrew/compat/dependencies_helpers.rb +++ b/Library/Homebrew/compat/dependencies_helpers.rb @@ -6,7 +6,7 @@ module DependenciesHelpers module Compat def argv_includes_ignores(argv = nil) unless @printed_includes_ignores_warning - odeprecated "Homebrew.argv_includes_ignores", "Homebrew.args_includes_ignores" + odisabled "Homebrew.argv_includes_ignores", "Homebrew.args_includes_ignores" @printed_includes_ignores_warning = true end args_includes_ignores(argv ? Homebrew::CLI::Args.new : Homebrew.args) diff --git a/Library/Homebrew/compat/extend/nil.rb b/Library/Homebrew/compat/extend/nil.rb index 0fa14795588dcf0f94b91a67e223d7327e07ec73..0e5bb0289489d73128ddcfbc979b023668a6e174 100644 --- a/Library/Homebrew/compat/extend/nil.rb +++ b/Library/Homebrew/compat/extend/nil.rb @@ -3,7 +3,7 @@ class NilClass module Compat def chuzzle - odeprecated "chuzzle", "chomp.presence" + odisabled ".chuzzle", "&.chomp.presence" end end diff --git a/Library/Homebrew/compat/extend/string.rb b/Library/Homebrew/compat/extend/string.rb index 78baab5073ab0a2f19fb4da71bd22a3dd2c063e8..a786035a8e5df377a28b0360127580ac2ec55d81 100644 --- a/Library/Homebrew/compat/extend/string.rb +++ b/Library/Homebrew/compat/extend/string.rb @@ -2,12 +2,8 @@ class String module Compat - # String.chomp, but if result is empty: returns nil instead. - # Allows `chuzzle || foo` short-circuits. def chuzzle - odeprecated "chuzzle", "chomp.presence" - s = chomp - s unless s.empty? + odisabled ".chuzzle", "&.chomp.presence" end end diff --git a/Library/Homebrew/compat/formula.rb b/Library/Homebrew/compat/formula.rb index 2759d9a7f937894bb3ea8dc0598802767b78a29c..c5eb84301bd63b533ed3f00af637a1f697a79f3f 100644 --- a/Library/Homebrew/compat/formula.rb +++ b/Library/Homebrew/compat/formula.rb @@ -3,24 +3,17 @@ class Formula module Compat def installed? - odeprecated "Formula#installed?", - "Formula#latest_version_installed? (or Formula#any_version_installed? )" - latest_version_installed? + odisabled "Formula#installed?", + "Formula#latest_version_installed? (or Formula#any_version_installed? )" end def prepare_patches - if respond_to?(:patches) - active_spec.add_legacy_patches(patches) - odeprecated "patches", "patch do" - end - - super + odisabled "patches", "patch do" if respond_to?(:patches) end def installed_prefix - # TODO: deprecate for Homebrew 2.5 - # odeprecated "Formula#installed_prefix", - # "Formula#latest_installed_prefix (or Formula#any_installed_prefix)" + odeprecated "Formula#installed_prefix", + "Formula#latest_installed_prefix (or Formula#any_installed_prefix)" latest_installed_prefix end @@ -28,14 +21,12 @@ class Formula # if the formula is not installed. # @private def installed_version - # TODO: deprecate for Homebrew 2.5 - # odeprecated "Formula#installed_version" + odeprecated "Formula#installed_version" Keg.new(latest_installed_prefix).version end def opt_or_installed_prefix_keg - # TODO: deprecate for Homebrew 2.5 - # odeprecated "Formula#opt_or_installed_prefix_keg", "Formula#any_installed_keg" + odeprecated "Formula#opt_or_installed_prefix_keg", "Formula#any_installed_keg" any_installed_keg end end diff --git a/Library/Homebrew/compat/language/haskell.rb b/Library/Homebrew/compat/language/haskell.rb index bea5f40de9be8398f6641b78bd26e5dbecf0086f..b03fb503e18a4f9f5b9c283621352a3a0ef5b0d2 100644 --- a/Library/Homebrew/compat/language/haskell.rb +++ b/Library/Homebrew/compat/language/haskell.rb @@ -4,107 +4,30 @@ module Language module Haskell module Cabal module Compat - def cabal_sandbox(options = {}) - odeprecated "Language::Haskell::Cabal.cabal_sandbox" - - pwd = Pathname.pwd - home = options[:home] || pwd - - # pretend HOME is elsewhere, so that ~/.cabal is kept as untouched - # as possible (except for ~/.cabal/setup-exe-cache) - # https://github.com/haskell/cabal/issues/1234 - saved_home = ENV["HOME"] - ENV["HOME"] = home - - system "cabal", "v1-sandbox", "init" - cabal_sandbox_bin = pwd/".cabal-sandbox/bin" - mkdir_p cabal_sandbox_bin - - # make available any tools that will be installed in the sandbox - saved_path = ENV["PATH"] - ENV.prepend_path "PATH", cabal_sandbox_bin - - # avoid updating the cabal package database more than once - system "cabal", "v1-update" unless (home/".cabal/packages").exist? - - yield - - # remove the sandbox and all build products - rm_rf [".cabal-sandbox", "cabal.sandbox.config", "dist"] - - # avoid installing any Haskell libraries, as a matter of policy - rm_rf lib unless options[:keep_lib] - - # restore the environment - ENV["HOME"] = saved_home - ENV["PATH"] = saved_path + def cabal_sandbox(_options = {}) + odisabled "Language::Haskell::Cabal.cabal_sandbox" end - def cabal_sandbox_add_source(*args) - odeprecated "Language::Haskell::Cabal.cabal_sandbox_add_source" - - system "cabal", "v1-sandbox", "add-source", *args + def cabal_sandbox_add_source(*_args) + odisabled "Language::Haskell::Cabal.cabal_sandbox_add_source" end - def cabal_install(*args) - odeprecated "Language::Haskell::Cabal.cabal_install", - "cabal v2-install directly with std_cabal_v2_args" - - # cabal hardcodes 64 as the maximum number of parallel jobs - # https://github.com/Homebrew/legacy-homebrew/issues/49509 - make_jobs = (ENV.make_jobs > 64) ? 64 : ENV.make_jobs - - # cabal-install's dependency-resolution backtracking strategy can easily - # need more than the default 2,000 maximum number of "backjumps," since - # Hackage is a fast-moving, rolling-release target. The highest known - # needed value by a formula at this time (February 2016) was 43,478 for - # git-annex, so 100,000 should be enough to avoid most gratuitous - # backjumps build failures. - system "cabal", "v1-install", "--jobs=#{make_jobs}", "--max-backjumps=100000", *args + def cabal_install(*_args) + odisabled "Language::Haskell::Cabal.cabal_install", + "cabal v2-install directly with std_cabal_v2_args" end - def cabal_configure(flags) - odeprecated "Language::Haskell::Cabal.cabal_configure" - - system "cabal", "v1-configure", flags + def cabal_configure(_flags) + odisabled "Language::Haskell::Cabal.cabal_configure" end - def cabal_install_tools(*tools) - odeprecated "Language::Haskell::Cabal.cabal_install_tools" - - # install tools sequentially, as some tools can depend on other tools - tools.each { |tool| cabal_install tool } - - # unregister packages installed as dependencies for the tools, so - # that they can't cause dependency conflicts for the main package - rm_rf Dir[".cabal-sandbox/*packages.conf.d/"] + def cabal_install_tools(*_tools) + odisabled "Language::Haskell::Cabal.cabal_install_tools" end - def install_cabal_package(*args, **options) - odeprecated "Language::Haskell::Cabal.install_cabal_package", - "cabal v2-update directly followed by v2-install with std_cabal_v2_args" - - cabal_sandbox do - cabal_install_tools(*options[:using]) if options[:using] - - # if we have build flags, we have to pass them to cabal install to resolve the necessary - # dependencies, and call cabal configure afterwards to set the flags again for compile - flags = "--flags=#{options[:flags].join(" ")}" if options[:flags] - - args_and_flags = args - args_and_flags << flags unless flags.nil? - - # install dependencies in the sandbox - cabal_install "--only-dependencies", *args_and_flags - - # call configure if build flags are set - cabal_configure flags unless flags.nil? - - # install the main package in the destination dir - cabal_install "--prefix=#{prefix}", *args - - yield if block_given? - end + def install_cabal_package(*_args, **_options) + odisabled "Language::Haskell::Cabal.install_cabal_package", + "cabal v2-update directly followed by v2-install with std_cabal_v2_args" end end diff --git a/Library/Homebrew/compat/language/java.rb b/Library/Homebrew/compat/language/java.rb index 2bcf485e2fe7b37e06b8b477f6fd67f6f597be8b..ba6b77fb05d21f7e12505835283b86cb7d1d1682 100644 --- a/Library/Homebrew/compat/language/java.rb +++ b/Library/Homebrew/compat/language/java.rb @@ -4,14 +4,9 @@ module Language module Java class << self module Compat - def java_home_cmd(version = nil) - odeprecated "Language::Java.java_home_cmd", - "Language::Java.java_home or Language::Java.overridable_java_home_env" - - # macOS provides /usr/libexec/java_home, but Linux does not. - return system_java_home_cmd(version) if OS.mac? - - raise NotImplementedError + def java_home_cmd(_version = nil) + odisabled "Language::Java.java_home_cmd", + "Language::Java.java_home or Language::Java.overridable_java_home_env" end end diff --git a/Library/Homebrew/compat/language/python.rb b/Library/Homebrew/compat/language/python.rb index 1012e98dddf5c3e1ac0a1841013c8805c570d184..8afd2cdcba2b4f9a7414736f189cb9128f5c8d73 100644 --- a/Library/Homebrew/compat/language/python.rb +++ b/Library/Homebrew/compat/language/python.rb @@ -4,12 +4,9 @@ module Language module Python class << self module Compat - def rewrite_python_shebang(python_path) - odeprecated "Language::Python.rewrite_python_shebang", - "Utils::Shebang.rewrite_shebang and Shebang.python_shebang_rewrite_info(python_path)" - Pathname.pwd.find do |f| - Utils::Shebang.rewrite_shebang(Shebang.python_shebang_rewrite_info(python_path), f) - end + def rewrite_python_shebang(_python_path) + odisabled "Language::Python.rewrite_python_shebang", + "Utils::Shebang.rewrite_shebang and Shebang.python_shebang_rewrite_info(python_path)" end end diff --git a/Library/Homebrew/compat/os/mac.rb b/Library/Homebrew/compat/os/mac.rb index b9b6a0bf740f9b9098849f5699741f5d4a7604a4..275d69b308394e59dc8365a9738d4b261887514b 100644 --- a/Library/Homebrew/compat/os/mac.rb +++ b/Library/Homebrew/compat/os/mac.rb @@ -5,22 +5,15 @@ module OS class << self module Compat def preferred_arch - odeprecated "MacOS.preferred_arch", "Hardware::CPU.arch (or ideally let the compiler handle it)" - if Hardware::CPU.is_64_bit? - Hardware::CPU.arch_64_bit - else - Hardware::CPU.arch_32_bit - end + odisabled "MacOS.preferred_arch", "Hardware::CPU.arch (or ideally let the compiler handle it)" end def tcc_db - odeprecated "MacOS.tcc_db" - @tcc_db ||= Pathname.new("/Library/Application Support/com.apple.TCC/TCC.db") + odisabled "MacOS.tcc_db" end def pre_mavericks_accessibility_dotfile - odeprecated "MacOS.pre_mavericks_accessibility_dotfile" - @pre_mavericks_accessibility_dotfile ||= Pathname.new("/private/var/db/.AccessibilityAPIEnabled") + odisabled "MacOS.pre_mavericks_accessibility_dotfile" end end diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index 86ff71824ca98b7d19ccdfdc453dc40072491c08..1917476d464db66899ecdc7b47f3c4476d92fcb6 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -229,7 +229,7 @@ module Homebrew @problems = [] @new_formula_problems = [] @text = FormulaText.new(formula.path) - @specs = %w[stable devel head].map { |s| formula.send(s) }.compact + @specs = %w[stable head].map { |s| formula.send(s) }.compact @spdx_license_data = options[:spdx_license_data] @spdx_exception_data = options[:spdx_exception_data] end @@ -718,9 +718,8 @@ module Homebrew def audit_specs problem "Head-only (no stable download)" if head_only?(formula) - problem "Devel-only (no stable download)" if devel_only?(formula) - %w[Stable Devel HEAD].each do |name| + %w[Stable HEAD].each do |name| spec_name = name.downcase.to_sym next unless spec = formula.send(spec_name) @@ -745,28 +744,16 @@ module Homebrew ) end - %w[Stable Devel].each do |name| - next unless spec = formula.send(name.downcase) - - version = spec.version - problem "#{name}: version (#{version}) is set to a string without a digit" if version.to_s !~ /\d/ + if stable = formula.stable + version = stable.version + problem "Stable: version (#{version}) is set to a string without a digit" if version.to_s !~ /\d/ if version.to_s.start_with?("HEAD") - problem "#{name}: non-HEAD version name (#{version}) should not begin with HEAD" - end - end - - if formula.stable && formula.devel - if formula.devel.version < formula.stable.version - problem "devel version #{formula.devel.version} is older than stable version #{formula.stable.version}" - elsif formula.devel.version == formula.stable.version - problem "stable and devel versions are identical" + problem "Stable: non-HEAD version name (#{version}) should not begin with HEAD" end end return unless @core_tap - problem "Formulae in homebrew/core should not have a `devel` spec" if formula.devel - if formula.head && @versioned_formula head_spec_message = "Versioned formulae should not have a `HEAD` spec" problem head_spec_message unless VERSIONED_HEAD_SPEC_ALLOWLIST.include?(formula.name) @@ -990,11 +977,7 @@ module Homebrew end def head_only?(formula) - formula.head && formula.devel.nil? && formula.stable.nil? - end - - def devel_only?(formula) - formula.devel && formula.stable.nil? + formula.head && formula.stable.nil? end end diff --git a/Library/Homebrew/dev-cmd/livecheck.rb b/Library/Homebrew/dev-cmd/livecheck.rb index 91aa1cef88b841452b03e4f3d5d13846d6c6e4b0..9693e039d7bed7afc81b7c615792b85904b4b5fb 100644 --- a/Library/Homebrew/dev-cmd/livecheck.rb +++ b/Library/Homebrew/dev-cmd/livecheck.rb @@ -54,8 +54,8 @@ module Homebrew Formula.installed elsif args.all? Formula - elsif args.formulae.present? - args.formulae + elsif (formulae_args = args.named.to_formulae) && formulae_args.present? + formulae_args elsif File.exist?(WATCHLIST_PATH) begin Pathname.new(WATCHLIST_PATH).read.lines.map do |line| diff --git a/Library/Homebrew/dev-cmd/pull.rb b/Library/Homebrew/dev-cmd/pull.rb index 687db6b86b7857b992e743685af93fe2bb789806..657e58ed22e9b954965476a46cd5626d6a3cbe66 100644 --- a/Library/Homebrew/dev-cmd/pull.rb +++ b/Library/Homebrew/dev-cmd/pull.rb @@ -43,300 +43,6 @@ module Homebrew end def pull - odeprecated "brew pull", "hub checkout" - - odie "You meant `git pull --rebase`." if ARGV[0] == "--rebase" - - args = pull_args.parse - - # Passthrough Git environment variables for e.g. git am - Utils::Git.set_name_email!(author: false, committer: true) - - # Depending on user configuration, git may try to invoke gpg. - if Utils.popen_read("git config --get --bool commit.gpgsign").chomp == "true" - begin - gnupg = Formula["gnupg"] - rescue FormulaUnavailableError # rubocop:disable Lint/SuppressedException - else - if gnupg.any_version_installed? - path = PATH.new(ENV.fetch("PATH")) - path.prepend(gnupg.any_installed_prefix/"bin") - ENV["PATH"] = path - end - end - end - - do_bump = args.bump? && !args.clean? - - tap = nil - - args.named.each do |arg| - arg = "#{CoreTap.instance.default_remote}/pull/#{arg}" if arg.to_i.positive? - if (api_match = arg.match HOMEBREW_PULL_API_REGEX) - _, user, repo, issue = *api_match - url = "https://github.com/#{user}/#{repo}/pull/#{issue}" - tap = Tap.fetch(user, repo) if repo.match?(HOMEBREW_OFFICIAL_REPO_PREFIXES_REGEX) - elsif (url_match = arg.match HOMEBREW_PULL_OR_COMMIT_URL_REGEX) - url, user, repo, issue = *url_match - tap = Tap.fetch(user, repo) if repo.match?(HOMEBREW_OFFICIAL_REPO_PREFIXES_REGEX) - else - odie "Not a GitHub pull request or commit: #{arg}" - end - - odie "No pull request detected!" if issue.blank? - - if tap - tap.install unless tap.installed? - Dir.chdir tap.path - else - Dir.chdir HOMEBREW_REPOSITORY - end - - # The cache directory seems like a good place to put patches. - HOMEBREW_CACHE.mkpath - - # Store current revision and branch - orig_revision = `git rev-parse --short HEAD`.strip - branch = `git symbolic-ref --short HEAD`.strip - - if branch != "master" && !args.clean? && !args.branch_okay? - opoo "Current branch is #{branch}: do you need to pull inside master?" - end - - patch_puller = PatchPuller.new(url, args) - patch_puller.fetch_patch - patch_changes = files_changed_in_patch(patch_puller.patchpath, tap) - - is_bumpable = patch_changes[:formulae].length == 1 && patch_changes[:others].empty? - check_bumps(patch_changes) if do_bump - old_versions = current_versions_from_info_external(patch_changes[:formulae].first) if is_bumpable - patch_puller.apply_patch - - end_revision = `git rev-parse --short HEAD`.strip - - changed_formulae_names = [] - - if tap - Utils.popen_read( - "git", "diff-tree", "-r", "--name-only", - "--diff-filter=AM", orig_revision, end_revision, "--", tap.formula_dir.to_s - ).each_line do |line| - next unless line.end_with? ".rb\n" - - name = "#{tap.name}/#{File.basename(line.chomp, ".rb")}" - changed_formulae_names << name - end - end - - changed_formulae_names.each do |name| - next if Homebrew::EnvConfig.disable_load_formula? - - begin - f = Formula[name] - rescue Exception # rubocop:disable Lint/RescueException - # Make sure we catch syntax errors. - next - end - - next unless f.stable - - stable_urls = [f.stable.url] + f.stable.mirrors - stable_urls.grep(%r{^https://dl.bintray.com/homebrew/mirror/}) do |mirror_url| - check_bintray_mirror(f.full_name, mirror_url) - end - end - - orig_message = message = `git log HEAD^.. --format=%B` - if issue && !args.clean? - ohai "Patch closes issue ##{issue}" - close_message = "Closes ##{issue}." - # If this is a pull request, append a close message. - message += "\n#{close_message}" unless message.include? close_message - end - - if changed_formulae_names.empty? - odie "Cannot bump: no changed formulae found after applying patch" if do_bump - is_bumpable = false - end - - is_bumpable = false if args.clean? - is_bumpable = false if Homebrew::EnvConfig.disable_load_formula? - - if is_bumpable - formula = Formula[changed_formulae_names.first] - new_versions = current_versions_from_info_external(patch_changes[:formulae].first) - orig_subject = message.empty? ? "" : message.lines.first.chomp - bump_subject = subject_for_bump(formula, old_versions, new_versions) - if do_bump - odie "No version changes found for #{formula.name}" if bump_subject.nil? - unless orig_subject == bump_subject - ohai "New bump commit subject: #{bump_subject}" - pbcopy bump_subject unless args.no_pbcopy? - message = "#{bump_subject}\n\n#{message}" - end - elsif bump_subject != orig_subject && !bump_subject.nil? - opoo "Nonstandard bump subject: #{orig_subject}" - opoo "Subject should be: #{bump_subject}" - end - end - - if message != orig_message && !args.clean? - safe_system "git", "commit", "--amend", "--signoff", "--allow-empty", "-q", "-m", message - end - - ohai "Patch changed:" - safe_system "git", "diff-tree", "-r", "--stat", orig_revision, end_revision - end - end - - def check_bumps(patch_changes) - if patch_changes[:formulae].empty? - odie "No changed formulae found to bump" - elsif patch_changes[:formulae].length > 1 - odie "Can only bump one changed formula; bumped #{patch_changes[:formulae]}" - elsif !patch_changes[:others].empty? - odie "Cannot bump if non-formula files are changed" - end - end - - class PatchPuller - attr_reader :base_url, :patch_url, :patchpath - - def initialize(url, args, description = nil) - @base_url = url - # GitHub provides commits/pull-requests raw patches using this URL. - @patch_url = "#{url}.patch" - @patchpath = HOMEBREW_CACHE + File.basename(patch_url) - @description = description - @args = args - end - - def fetch_patch - extra_msg = @description ? "(#{@description})" : nil - ohai "Fetching patch #{extra_msg}" - puts "Patch: #{patch_url}" - curl_download patch_url, to: patchpath - end - - def apply_patch - # Applies a patch previously downloaded with fetch_patch() - # Deletes the patch file as a side effect, regardless of success - - ohai "Applying patch" - patch_args = [] - # Normally we don't want whitespace errors, but squashing them can break - # patches so an option is provided to skip this step. - patch_args << if @args.ignore_whitespace? || @args.clean? - "--whitespace=nowarn" - else - "--whitespace=fix" - end - - # Fall back to three-way merge if patch does not apply cleanly - patch_args << "-3" - patch_args << patchpath - - begin - safe_system "git", "am", *patch_args - rescue ErrorDuringExecution - if @args.resolve? - odie "Patch failed to apply: try to resolve it." - else - system "git", "am", "--abort" - odie "Patch failed to apply: aborted." - end - ensure - patchpath.unlink - end - end - end - - # List files changed by a patch, partitioned in to those that are (probably) - # formula definitions, and those which aren't. Only applies to patches on - # Homebrew core or taps, based simply on relative pathnames of affected files. - def files_changed_in_patch(patchfile, tap) - files = [] - formulae = [] - others = [] - File.foreach(patchfile) do |line| - files << Regexp.last_match(1) if line =~ %r{^\+\+\+ b/(.*)} - end - files.each do |file| - if tap&.formula_file?(file) - formula_name = File.basename(file, ".rb") - formulae << formula_name unless formulae.include?(formula_name) - else - others << file - end - end - { files: files, formulae: formulae, others: others } - end - - # Get current formula versions without loading formula definition in this process. - # Returns info as a hash (type => version), for pull.rb's internal use. - # Uses special key `:nonexistent => true` for nonexistent formulae. - def current_versions_from_info_external(formula_name) - info = FormulaInfo.lookup(formula_name) - versions = {} - if info - [:stable, :devel, :head].each do |spec_type| - versions[spec_type] = info.version(spec_type) - end - else - versions[:nonexistent] = true - end - versions - end - - def subject_for_bump(formula, old, new) - if old[:nonexistent] - # New formula - headline_ver = if new[:stable] - new[:stable] - elsif new[:devel] - new[:devel] - else - new[:head] - end - subject = "#{formula.name} #{headline_ver} (new formula)" - else - # Update to existing formula - subject_strs = [] - formula_name_str = formula.name - if old[:stable] != new[:stable] - if new[:stable].nil? - subject_strs << "remove stable" - formula_name_str += ":" # just for cosmetics - else - subject_strs << new[:stable] - end - end - if old[:devel] != new[:devel] - if new[:devel].nil? - # Only bother mentioning if there's no accompanying stable change - if !new[:stable].nil? && old[:stable] == new[:stable] - subject_strs << "remove devel" - formula_name_str += ":" # just for cosmetics - end - else - subject_strs << "#{new[:devel]} (devel)" - end - end - subject = subject_strs.empty? ? nil : "#{formula_name_str} #{subject_strs.join(", ")}" - end - subject - end - - def pbcopy(text) - Utils.popen_write("pbcopy") { |io| io.write text } - end - - def check_bintray_mirror(name, url) - headers, = curl_output("--connect-timeout", "15", "--location", "--head", url) - status_code = headers.scan(%r{^HTTP/.* (\d+)}).last.first - return if status_code.start_with?("2") - - opoo "The Bintray mirror #{url} is not reachable (HTTP status code #{status_code})." - opoo "Do you need to upload it with `brew mirror #{name}`?" + odisabled "brew pull", "hub checkout" end end diff --git a/Library/Homebrew/dev-cmd/test.rb b/Library/Homebrew/dev-cmd/test.rb index f6bbbbeb2a0d0f7c0786c09cce0c71f94c1c1d30..50c052723e54f259c9f937e9eb20e4c99b448a28 100644 --- a/Library/Homebrew/dev-cmd/test.rb +++ b/Library/Homebrew/dev-cmd/test.rb @@ -85,11 +85,7 @@ module Homebrew #{f.path} ].concat(args.options_only) - if f.head? - exec_args << "--HEAD" - elsif f.devel? - exec_args << "--devel" - end + exec_args << "--HEAD" if f.head? Utils.safe_fork do if Sandbox.available? diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index fbbd55fd961ebe25f3ac4d290436ce2fe927efdc..fb764285c96becb77e4324df6e1c0008ca4dc5c4 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -113,12 +113,10 @@ class Formula # @private attr_reader :stable - # The development {SoftwareSpec} for this {Formula}. - # Installed when using `brew install --devel` - # `nil` if there is no development version. - # @see #stable # @private - attr_reader :devel + def devel + odisabled "Formula#devel" + end # The HEAD {SoftwareSpec} for this {Formula}. # Installed when using `brew install --HEAD` @@ -136,7 +134,7 @@ class Formula protected :active_spec # A symbol to indicate currently active {SoftwareSpec}. - # It's either :stable, :devel or :head + # It's either :stable or :head # @see #active_spec # @private attr_reader :active_spec_sym @@ -207,14 +205,11 @@ class Formula @full_alias_name = full_name_with_optional_tap(@alias_name) spec_eval :stable - spec_eval :devel spec_eval :head @active_spec = determine_active_spec(spec) @active_spec_sym = if head? :head - elsif devel? - :devel else :stable end @@ -258,7 +253,7 @@ class Formula end def determine_active_spec(requested) - spec = send(requested) || stable || devel || head + spec = send(requested) || stable || head spec || raise(FormulaSpecificationError, "formulae require at least a URL") end @@ -326,10 +321,9 @@ class Formula active_spec == stable end - # Is the currently active {SoftwareSpec} a {#devel} build? # @private def devel? - active_spec == devel + odisabled "Formula#devel?" end # Is the currently active {SoftwareSpec} a {#head} build? @@ -533,7 +527,6 @@ class Formula return true if tab.version_scheme < version_scheme return true if stable && tab.stable_version && tab.stable_version < stable.version - return true if devel && tab.devel_version && tab.devel_version < devel.version return false unless fetch_head return false unless head&.downloader.is_a?(VCSDownloadStrategy) @@ -544,14 +537,11 @@ class Formula end end - # The latest prefix for this formula. Checks for {#head}, then {#devel} - # and then {#stable}'s {#prefix} + # The latest prefix for this formula. Checks for {#head} and then {#stable}'s {#prefix} # @private def latest_installed_prefix if head && (head_version = latest_head_version) && !head_version_outdated?(head_version) latest_head_prefix - elsif devel && (devel_prefix = prefix(PkgVersion.new(devel.version, revision))).directory? - devel_prefix elsif stable && (stable_prefix = prefix(PkgVersion.new(stable.version, revision))).directory? stable_prefix else @@ -1713,7 +1703,6 @@ class Formula "homepage" => homepage, "versions" => { "stable" => stable&.version&.to_s, - "devel" => devel&.version&.to_s, "head" => head&.version&.to_s, "bottle" => !bottle_specification.checksums.empty?, }, @@ -1750,34 +1739,32 @@ class Formula "disabled" => disabled?, } - %w[stable devel].each do |spec_sym| - next unless spec = send(spec_sym) - - hsh["urls"][spec_sym] = { - "url" => spec.url, - "tag" => spec.specs[:tag], - "revision" => spec.specs[:revision], + if stable + hsh["urls"]["stable"] = { + "url" => stable.url, + "tag" => stable.specs[:tag], + "revision" => stable.specs[:revision], } - next unless spec.bottle_defined? - - bottle_spec = spec.bottle_specification - bottle_info = { - "rebuild" => bottle_spec.rebuild, - "cellar" => (cellar = bottle_spec.cellar).is_a?(Symbol) ? cellar.inspect : cellar, - "prefix" => bottle_spec.prefix, - "root_url" => bottle_spec.root_url, - } - bottle_info["files"] = {} - bottle_spec.collector.each_key do |os| - bottle_url = "#{bottle_spec.root_url}/#{Bottle::Filename.create(self, os, bottle_spec.rebuild).bintray}" - checksum = bottle_spec.collector[os] - bottle_info["files"][os] = { - "url" => bottle_url, - checksum.hash_type.to_s => checksum.hexdigest, + if bottle_defined? + bottle_spec = stable.bottle_specification + bottle_info = { + "rebuild" => bottle_spec.rebuild, + "cellar" => (cellar = bottle_spec.cellar).is_a?(Symbol) ? cellar.inspect : cellar, + "prefix" => bottle_spec.prefix, + "root_url" => bottle_spec.root_url, } + bottle_info["files"] = {} + bottle_spec.collector.each_key do |os| + bottle_url = "#{bottle_spec.root_url}/#{Bottle::Filename.create(self, os, bottle_spec.rebuild).bintray}" + checksum = bottle_spec.collector[os] + bottle_info["files"][os] = { + "url" => bottle_url, + checksum.hash_type.to_s => checksum.hexdigest, + } + end + hsh["bottle"]["stable"] = bottle_info end - hsh["bottle"][spec_sym] = bottle_info end hsh["options"] = options.map do |opt| @@ -2203,18 +2190,9 @@ class Formula when :test define_method(:test_defined?) { true } when :patches - odeprecated "a Formula#patches definition", "'patch do' block calls" + odisabled "a Formula#patches definition", "'patch do' block calls" when :options - odeprecated "a Formula#options definition", "'option do' block calls" - instance = allocate - - specs.each do |spec| - instance.options.each do |opt, desc| - spec.option(opt[/^--(.+)$/, 1], desc) - end - end - - remove_method(:options) + odisabled "a Formula#options definition", "'option do' block calls" end end @@ -2259,8 +2237,7 @@ class Formula @licenses else if args.is_a? Array - # TODO: enable for next major/minor release - # odeprecated "`license [...]`", "`license any_of: [...]`" + odeprecated "`license [...]`", "`license any_of: [...]`" args = { any_of: args } end @licenses = args @@ -2318,10 +2295,10 @@ class Formula # <pre>version_scheme 1</pre> attr_rw :version_scheme - # A list of the {.stable}, {.devel} and {.head} {SoftwareSpec}s. + # A list of the {.stable} and {.head} {SoftwareSpec}s. # @private def specs - @specs ||= [stable, devel, head].freeze + @specs ||= [stable, head].freeze end # @!attribute [w] url @@ -2449,25 +2426,9 @@ class Formula @stable.instance_eval(&block) end - # @!attribute [w] devel - # Adds a {.devel} {SoftwareSpec}. - # This can be installed by passing the `--devel` option to allow - # installing non-stable (e.g. beta) versions of software. - # - # <pre>devel do - # url "https://example.com/archive-2.0-beta.tar.gz" - # sha256 "2a2ba417eebaadcb4418ee7b12fe2998f26d6e6f7fda7983412ff66a741ab6f7" - # - # depends_on "cairo" - # depends_on "pixman" - # end</pre> # @private - def devel(&block) - @devel ||= SoftwareSpec.new(flags: build_flags) - return @devel unless block_given? - - odeprecated "'devel' blocks in formulae", "'head' blocks or @-versioned formulae" - @devel.instance_eval(&block) + def devel + odisabled "'devel' blocks in formulae", "'head' blocks or @-versioned formulae" end # @!attribute [w] head @@ -2784,8 +2745,7 @@ class Formula # <pre>deprecate! date: "2020-08-27", because: :unmaintained</pre> # <pre>deprecate! date: "2020-08-27", because: "it has been replaced by"</pre> def deprecate!(date: nil, because: nil) - # TODO: enable for next major/minor release - # odeprecated "`deprecate!` without a reason", "`deprecate! because: \"reason\"`" if because.blank? + odeprecated "`deprecate!` without a reason", "`deprecate! because: \"reason\"`" if because.blank? return if date.present? && Date.parse(date) > Date.today @@ -2811,8 +2771,7 @@ class Formula # <pre>disable! date: "2020-08-27", because: :does_not_build</pre> # <pre>disable! date: "2020-08-27", because: "has been replaced by foo"</pre> def disable!(date: nil, because: nil) - # TODO: enable for next major/minor release - # odeprecated "`disable!` without a reason", "`disable! because: \"reason\"`" if because.blank? + odeprecated "`disable!` without a reason", "`disable! because: \"reason\"`" if because.blank? if date.present? && Date.parse(date) > Date.today @deprecation_reason = because if because.present? diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 307174fbc2c8a23aa497d108d1597566cea1e35c..79d3259106dc79d286c021a5486f0503e688b9df 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -605,8 +605,6 @@ class FormulaInstaller def display_options(formula) options = if formula.head? ["--HEAD"] - elsif formula.devel? - ["--devel"] else [] end @@ -809,11 +807,7 @@ class FormulaInstaller args << "--env=std" end - if formula.head? - args << "--HEAD" - elsif formula.devel? - args << "--devel" - end + args << "--HEAD" if formula.head? args end diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb index 0eb089b14922db2ef6f1552ed34f79e4e0a42b9a..844000d618fff52b8456d0122bb1c88f12e869b0 100644 --- a/Library/Homebrew/formulary.rb +++ b/Library/Homebrew/formulary.rb @@ -220,12 +220,12 @@ module Formulary def load_file(flags:) if url =~ %r{githubusercontent.com/[\w-]+/[\w-]+/[a-f0-9]{40}(/Formula)?/([\w+-.@]+).rb} formula_name = Regexp.last_match(2) - odeprecated "Installation of #{formula_name} from a GitHub commit URL", - "'brew extract #{formula_name}' to stable tap on GitHub" + odisabled "Installation of #{formula_name} from a GitHub commit URL", + "'brew extract #{formula_name}' to stable tap on GitHub" elsif url.match?(%r{^(https?|ftp)://}) - odeprecated "Non-checksummed download of #{name} formula file from an arbitrary URL", - "'brew extract' or 'brew create' and 'brew tap-new' to create a "\ - "formula file in a tap on GitHub" + odisabled "Non-checksummed download of #{name} formula file from an arbitrary URL", + "'brew extract' or 'brew create' and 'brew tap-new' to create a "\ + "formula file in a tap on GitHub" end HOMEBREW_CACHE_FORMULA.mkpath FileUtils.rm_f(path) diff --git a/Library/Homebrew/livecheck.rb b/Library/Homebrew/livecheck.rb index 32386389bc655468d0dcb522cc961df11f0519a4..c72818dc38dd1e2a61717449f566992b8283fc8d 100644 --- a/Library/Homebrew/livecheck.rb +++ b/Library/Homebrew/livecheck.rb @@ -84,7 +84,7 @@ class Livecheck @url = case val when nil return @url - when :head, :stable, :devel + when :head, :stable @formula.send(val).url when :homepage @formula.homepage diff --git a/Library/Homebrew/options.rb b/Library/Homebrew/options.rb index 7823e1ebbfb36306744b4a209a0cbccfe7d2aa11..ff9edaa388b4806110b042064e7ad2f146498c4e 100644 --- a/Library/Homebrew/options.rb +++ b/Library/Homebrew/options.rb @@ -126,7 +126,6 @@ class Options f.options.sort_by(&:flag).each do |opt| puts "#{opt.flag}\n\t#{opt.description}" end - puts "--devel\n\tInstall development version #{f.devel.version}" if f.devel puts "--HEAD\n\tInstall HEAD version" if f.head end end diff --git a/Library/Homebrew/patch.rb b/Library/Homebrew/patch.rb index de60b4a87bad00ec1f7ee1035aecb4aa590e47b2..0934b436fa5eb0f80e083a5d2030c283439dae20 100644 --- a/Library/Homebrew/patch.rb +++ b/Library/Homebrew/patch.rb @@ -191,25 +191,8 @@ end # # @api private class LegacyPatch < ExternalPatch - def initialize(strip, url) - odeprecated "legacy patches", "'patch do' blocks" + def initialize(strip, _url) + odisabled "legacy patches", "'patch do' blocks" super(strip) - resource.url(url) - resource.download_strategy = CurlDownloadStrategy - end - - def fetch - clear_cache - super - end - - def verify_download_integrity(_fn) - # no-op - end - - def apply - super - ensure - clear_cache end end diff --git a/Library/Homebrew/requirements/macos_requirement.rb b/Library/Homebrew/requirements/macos_requirement.rb index f8bdcf9150ec615756ad6acc6fdf8468375a2b45..6013a1a1b7f92754a7ae6b8e6c2d97a160c7ee65 100644 --- a/Library/Homebrew/requirements/macos_requirement.rb +++ b/Library/Homebrew/requirements/macos_requirement.rb @@ -20,7 +20,7 @@ class MacOSRequirement < Requirement rescue MacOSVersionError => e raise if e.version != :mavericks - odeprecated "depends_on :macos => :mavericks" + odisabled "depends_on :macos => :mavericks" end @comparator = comparator diff --git a/Library/Homebrew/rubocops/components_order.rb b/Library/Homebrew/rubocops/components_order.rb index 6fbb0a5787c2a344bd7b8870cffa0ad383aba34d..d939a8ea369027bd6c8ae31474c342a419dab7c3 100644 --- a/Library/Homebrew/rubocops/components_order.rb +++ b/Library/Homebrew/rubocops/components_order.rb @@ -32,7 +32,6 @@ module RuboCop [{ name: :livecheck, type: :block_call }], [{ name: :bottle, type: :block_call }], [{ name: :pour_bottle?, type: :block_call }], - [{ name: :devel, type: :block_call }], [{ name: :head, type: :block_call }], [{ name: :bottle, type: :method_call }], [{ name: :keg_only, type: :method_call }], diff --git a/Library/Homebrew/rubocops/components_redundancy.rb b/Library/Homebrew/rubocops/components_redundancy.rb index 4c9cad8822cda078a9597a4aeaa6770d1e1489cf..1e51ef0831bddf22fa0ce9bf30883b659fe8ae88 100644 --- a/Library/Homebrew/rubocops/components_redundancy.rb +++ b/Library/Homebrew/rubocops/components_redundancy.rb @@ -10,13 +10,13 @@ module RuboCop # - `url|checksum|mirror` should be inside `stable` block # - `head` and `head do` should not be simultaneously present # - `bottle :unneeded`/`:disable` and `bottle do` should not be simultaneously present - # - `stable do` should not be present without a `head` or `devel` spec + # - `stable do` should not be present without a `head` spec # # @api private class ComponentsRedundancy < FormulaCop HEAD_MSG = "`head` and `head do` should not be simultaneously present" BOTTLE_MSG = "`bottle :modifier` and `bottle do` should not be simultaneously present" - STABLE_MSG = "`stable do` should not be present without a `head` or `devel` spec" + STABLE_MSG = "`stable do` should not be present without a `head` spec" def audit_formula(_node, _class_node, _parent_class_node, body_node) urls = find_method_calls_by_name(body_node, :url) @@ -46,8 +46,7 @@ module RuboCop find_block(body_node, :bottle) return if method_called?(body_node, :head) || - find_block(body_node, :head) || - find_block(body_node, :devel) + find_block(body_node, :head) problem STABLE_MSG if stable_block end diff --git a/Library/Homebrew/rubocops/dependency_order.rb b/Library/Homebrew/rubocops/dependency_order.rb index 9e87fc77bd9f235e5cdafd6a7f136e100632fe01..7f24d8087cb3eea175d4082a882136ae9a5aa8d5 100644 --- a/Library/Homebrew/rubocops/dependency_order.rb +++ b/Library/Homebrew/rubocops/dependency_order.rb @@ -13,7 +13,7 @@ module RuboCop def audit_formula(_node, _class_node, _parent_class_node, body_node) check_dependency_nodes_order(body_node) check_uses_from_macos_nodes_order(body_node) - [:devel, :head, :stable].each do |block_name| + [:head, :stable].each do |block_name| block = find_block(body_node, block_name) next unless block diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb index 6eb68599b0cc15e9a457657683be036d07fac050..96386c728ed8b01a46265d724a0ec1cbd00e285e 100644 --- a/Library/Homebrew/tab.rb +++ b/Library/Homebrew/tab.rb @@ -43,7 +43,6 @@ class Tab < OpenStruct "spec" => formula.active_spec_sym.to_s, "versions" => { "stable" => formula.stable&.version.to_s, - "devel" => formula.devel&.version.to_s, "head" => formula.head&.version.to_s, "version_scheme" => formula.version_scheme, }, @@ -93,7 +92,6 @@ class Tab < OpenStruct if attributes["source"]["versions"].nil? attributes["source"]["versions"] = { "stable" => nil, - "devel" => nil, "head" => nil, "version_scheme" => 0, } @@ -163,7 +161,6 @@ class Tab < OpenStruct "spec" => f.active_spec_sym.to_s, "versions" => { "stable" => f.stable&.version.to_s, - "devel" => f.devel&.version.to_s, "head" => f.head&.version.to_s, "version_scheme" => f.version_scheme, }, @@ -195,7 +192,6 @@ class Tab < OpenStruct "spec" => "stable", "versions" => { "stable" => nil, - "devel" => nil, "head" => nil, "version_scheme" => 0, }, @@ -234,10 +230,12 @@ class Tab < OpenStruct end def universal? + odeprecated "Tab#universal?" include?("universal") end def cxx11? + odeprecated "Tab#cxx11?" include?("c++11") end @@ -246,7 +244,7 @@ class Tab < OpenStruct end def devel? - spec == :devel + odisabled "Tab#devel?" end def stable? @@ -314,7 +312,7 @@ class Tab < OpenStruct end def devel_version - Version.create(versions["devel"]) if versions["devel"] + odisabled "Tab#devel_version" end def head_version diff --git a/Library/Homebrew/test/build_options_spec.rb b/Library/Homebrew/test/build_options_spec.rb index fc034eaa2983baab8ad47984b60edd3fe07c1739..8bfede1f2b5f391e398422a0afc04fdf4737c27d 100644 --- a/Library/Homebrew/test/build_options_spec.rb +++ b/Library/Homebrew/test/build_options_spec.rb @@ -14,12 +14,6 @@ describe BuildOptions do let(:opts) { Options.create(%w[--with-foo --with-bar --without-baz --without-qux]) } let(:bad_args) { Options.create(%w[--with-foo --with-bar --without-bas --without-qux --without-abc]) } - specify "#include?" do - expect(subject).to include("with-foo") - expect(subject).not_to include("with-qux") - expect(subject).not_to include("--with-foo") - end - specify "#with?" do expect(subject).to be_built_with("foo") expect(subject).to be_built_with("bar") diff --git a/Library/Homebrew/test/cmd/outdated_spec.rb b/Library/Homebrew/test/cmd/outdated_spec.rb index 61e329981fff71c900c961e9f998156a267d53ac..ade97172051749484703ee2cf4847232d50ff052 100644 --- a/Library/Homebrew/test/cmd/outdated_spec.rb +++ b/Library/Homebrew/test/cmd/outdated_spec.rb @@ -11,17 +11,18 @@ describe "brew outdated", :integration_test do setup_test_formula "testball" (HOMEBREW_CELLAR/"testball/0.0.1/foo").mkpath - expected_json = [ - { + expected_json = { + formulae: [{ name: "testball", installed_versions: ["0.0.1"], current_version: "0.1", pinned: false, pinned_version: nil, - }, - ].to_json + }], + casks: [], + }.to_json - expect { brew "outdated", "--json=v1" } + expect { brew "outdated", "--json=v2" } .to output("#{expected_json}\n").to_stdout .and be_a_success end diff --git a/Library/Homebrew/test/dev-cmd/pull_spec.rb b/Library/Homebrew/test/dev-cmd/pull_spec.rb deleted file mode 100644 index c17c8a28a6c8cb684d5c54481c4ca40a958c56e7..0000000000000000000000000000000000000000 --- a/Library/Homebrew/test/dev-cmd/pull_spec.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -require "cmd/shared_examples/args_parse" - -describe "Homebrew.pull_args" do - it_behaves_like "parseable arguments" -end - -describe "brew pull", :integration_test do - it "fetches a patch from a GitHub commit or pull request and applies it", :needs_network do - HOMEBREW_REPOSITORY.cd do - system "git", "init" - system "git", "remote", "add", "origin", "https://github.com/Homebrew/brew" - end - - expect { brew "pull", "https://github.com/Homebrew/brew/pull/1249" } - .to output(/Fetching patch/).to_stdout - .and be_a_failure - end -end diff --git a/Library/Homebrew/test/livecheck/livecheck_spec.rb b/Library/Homebrew/test/livecheck/livecheck_spec.rb index 47492dad8907806180e8550c505819f3aa82be82..68d95cf90a0bb57e54615088e0a0fbc36530ffd6 100644 --- a/Library/Homebrew/test/livecheck/livecheck_spec.rb +++ b/Library/Homebrew/test/livecheck/livecheck_spec.rb @@ -24,7 +24,7 @@ describe Homebrew::Livecheck do desc "Deprecated test formula" homepage "https://brew.sh" url "https://brew.sh/test-0.0.1.tgz" - deprecate! + deprecate! because: :unmaintained end end diff --git a/Library/Homebrew/test/os/linux/formula_spec.rb b/Library/Homebrew/test/os/linux/formula_spec.rb index 8e929290723aa6648a47b39ffaa65043339ff4ec..7ef64aecd6d6a7de3c8227d270985b2df1699cda 100644 --- a/Library/Homebrew/test/os/linux/formula_spec.rb +++ b/Library/Homebrew/test/os/linux/formula_spec.rb @@ -17,7 +17,6 @@ describe Formula do end expect(f.class.stable.deps.first.name).to eq("foo") - expect(f.class.devel.deps.first.name).to eq("foo") expect(f.class.head.deps.first.name).to eq("foo") end @@ -29,7 +28,6 @@ describe Formula do end expect(f.class.stable.deps.first.name).to eq("foo") - expect(f.class.devel.deps.first.name).to eq("foo") expect(f.class.head.deps.first.name).to eq("foo") end end diff --git a/Library/Homebrew/test/os/mac/formula_spec.rb b/Library/Homebrew/test/os/mac/formula_spec.rb index e76cb05214fe92d703a490e1af4f6f25534d82a0..05f15cb80921314d1979dbf340302ef83bec4c9c 100644 --- a/Library/Homebrew/test/os/mac/formula_spec.rb +++ b/Library/Homebrew/test/os/mac/formula_spec.rb @@ -18,10 +18,8 @@ describe Formula do end expect(f.class.stable.deps).to be_empty - expect(f.class.devel.deps).to be_empty expect(f.class.head.deps).to be_empty expect(f.class.stable.uses_from_macos_elements.first).to eq("foo") - expect(f.class.devel.uses_from_macos_elements.first).to eq("foo") expect(f.class.head.uses_from_macos_elements.first).to eq("foo") end @@ -33,10 +31,8 @@ describe Formula do end expect(f.class.stable.deps.first.name).to eq("foo") - expect(f.class.devel.deps.first.name).to eq("foo") expect(f.class.head.deps.first.name).to eq("foo") expect(f.class.stable.uses_from_macos_elements).to be_empty - expect(f.class.devel.uses_from_macos_elements).to be_empty expect(f.class.head.uses_from_macos_elements).to be_empty end end diff --git a/Library/Homebrew/test/rubocops/components_redundancy_spec.rb b/Library/Homebrew/test/rubocops/components_redundancy_spec.rb index 30672ec9dc2620daa522ef3aa3ca4f273b5d209a..4eea2dca3f7b71f58ec95b5a50b62a3fdfbad588 100644 --- a/Library/Homebrew/test/rubocops/components_redundancy_spec.rb +++ b/Library/Homebrew/test/rubocops/components_redundancy_spec.rb @@ -15,7 +15,7 @@ describe RuboCop::Cop::FormulaAudit::ComponentsRedundancy do # stuff end - devel do + head do # stuff end end @@ -72,19 +72,5 @@ describe RuboCop::Cop::FormulaAudit::ComponentsRedundancy do end RUBY end - - it "When `stable do` is present with a `devel` block" do - expect_no_offenses(<<~RUBY) - class Foo < Formula - stable do - # stuff - end - - devel do - # stuff - end - end - RUBY - end end end diff --git a/Library/Homebrew/test/tab_spec.rb b/Library/Homebrew/test/tab_spec.rb index cd9f3c9fd994c08ea36c6d19efb641429d0d6c26..b4005db52d8d13948c2005f198708aa6a141e566 100644 --- a/Library/Homebrew/test/tab_spec.rb +++ b/Library/Homebrew/test/tab_spec.rb @@ -38,7 +38,6 @@ describe Tab do "spec" => "stable", "versions" => { "stable" => "0.10", - "devel" => "0.14", "head" => "HEAD-1111111", }, }, @@ -66,14 +65,12 @@ describe Tab do expect(tab).not_to be_built_as_bottle expect(tab).not_to be_poured_from_bottle expect(tab).to be_stable - expect(tab).not_to be_devel expect(tab).not_to be_head expect(tab.tap).to be nil expect(tab.time).to be nil expect(tab.HEAD).to be nil expect(tab.runtime_dependencies).to be nil expect(tab.stable_version).to be nil - expect(tab.devel_version).to be nil expect(tab.head_version).to be nil expect(tab.cxxstdlib.compiler).to eq(DevelopmentTools.default_compiler) expect(tab.cxxstdlib.type).to be nil @@ -92,11 +89,6 @@ describe Tab do expect(subject).not_to be_built_with("baz") end - specify "#universal?" do - tab = described_class.new(used_options: %w[--universal]) - expect(tab).to be_universal - end - specify "#parsed_homebrew_version" do tab = described_class.new expect(tab.parsed_homebrew_version).to be Version::NULL @@ -179,7 +171,6 @@ describe Tab do expect(tab).not_to be_built_as_bottle expect(tab).to be_poured_from_bottle expect(tab).to be_stable - expect(tab).not_to be_devel expect(tab).not_to be_head expect(tab.tap.name).to eq("homebrew/core") expect(tab.spec).to eq(:stable) @@ -189,7 +180,6 @@ describe Tab do expect(tab.cxxstdlib.type).to eq(:libcxx) expect(tab.runtime_dependencies).to eq(runtime_dependencies) expect(tab.stable_version.to_s).to eq("2.14") - expect(tab.devel_version.to_s).to eq("2.15") expect(tab.head_version.to_s).to eq("HEAD-0000000") expect(tab.source["path"]).to eq(source_path) end @@ -209,7 +199,6 @@ describe Tab do expect(tab).not_to be_built_as_bottle expect(tab).to be_poured_from_bottle expect(tab).to be_stable - expect(tab).not_to be_devel expect(tab).not_to be_head expect(tab.tap.name).to eq("homebrew/core") expect(tab.spec).to eq(:stable) @@ -219,7 +208,6 @@ describe Tab do expect(tab.cxxstdlib.type).to eq(:libcxx) expect(tab.runtime_dependencies).to eq(runtime_dependencies) expect(tab.stable_version.to_s).to eq("2.14") - expect(tab.devel_version.to_s).to eq("2.15") expect(tab.head_version.to_s).to eq("HEAD-0000000") expect(tab.source["path"]).to eq(source_path) end @@ -233,7 +221,6 @@ describe Tab do expect(tab).not_to be_built_as_bottle expect(tab).to be_poured_from_bottle expect(tab).to be_stable - expect(tab).not_to be_devel expect(tab).not_to be_head expect(tab.tap.name).to eq("homebrew/core") expect(tab.spec).to eq(:stable) @@ -385,7 +372,6 @@ describe Tab do expect(tab.stdlib).to eq(subject.stdlib) expect(tab.runtime_dependencies).to eq(subject.runtime_dependencies) expect(tab.stable_version).to eq(subject.stable_version) - expect(tab.devel_version).to eq(subject.devel_version) expect(tab.head_version).to eq(subject.head_version) expect(tab.source["path"]).to eq(subject.source["path"]) end diff --git a/docs/Manpage.md b/docs/Manpage.md index 3a7bd37d7b105df6ff2ee17848bd7aab3f40ab27..f09dab69a70b1c20b1baabbc079e9be59d220ae9 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -327,8 +327,6 @@ installed formulae or, every 30 days, for all formulae. Install from a bottle if it exists for the current or newest version of macOS, even if it would not normally be used for installation. * `--include-test`: Install testing dependencies required to run `brew test` *`formula`*. -* `--devel`: - If *`formula`* defines it, install the development version. * `--HEAD`: If *`formula`* defines it, install the HEAD version, aka. master, trunk, unstable. * `--fetch-HEAD`: @@ -686,10 +684,6 @@ specify *`formula`* as a required or recommended dependency for their stable bui Include all formulae that specify *`formula`* as `:optional` type dependency. * `--skip-recommended`: Skip all formulae that specify *`formula`* as `:recommended` type dependency. -* `--devel`: - Show usage of *`formula`* by development builds. -* `--HEAD`: - Show usage of *`formula`* by HEAD builds. ### `--cache` [*`options`*] [*`formula|cask`*] diff --git a/docs/Tips-N'-Tricks.md b/docs/Tips-N'-Tricks.md index 6b5179b35af2a455a3093d4f6a396b3ee3c38521..098cd11c67d9ed149d70507ab6a72bbef24131cf 100644 --- a/docs/Tips-N'-Tricks.md +++ b/docs/Tips-N'-Tricks.md @@ -67,7 +67,7 @@ brew install --only-dependencies <formula> ```sh $ brew irb 1.8.7 :001 > Formula.factory("ace").methods - Object.methods - => [:install, :path, :homepage, :downloader, :stable, :bottle, :devel, :head, :active_spec, :buildpath, :ensure_specs_set, :url, :version, :specs, :mirrors, :installed?, :explicitly_requested?, :linked_keg, :installed_prefix, :prefix, :rack, :bin, :doc, :include, :info, :lib, :libexec, :man, :man1, :man2, :man3, :man4, :man5, :man6, :man7, :man8, :sbin, :share, :etc, :var, :plist_name, :plist_path, :download_strategy, :cached_download, :caveats, :options, :patches, :keg_only?, :fails_with?, :skip_clean?, :brew, :std_cmake_args, :deps, :external_deps, :recursive_deps, :system, :fetch, :verify_download_integrity, :fails_with_llvm, :fails_with_llvm?, :std_cmake_parameters, :mkdir, :mktemp] + => [:install, :path, :homepage, :downloader, :stable, :bottle, :head, :active_spec, :buildpath, :ensure_specs_set, :url, :version, :specs, :mirrors, :installed?, :explicitly_requested?, :linked_keg, :installed_prefix, :prefix, :rack, :bin, :doc, :include, :info, :lib, :libexec, :man, :man1, :man2, :man3, :man4, :man5, :man6, :man7, :man8, :sbin, :share, :etc, :var, :plist_name, :plist_path, :download_strategy, :cached_download, :caveats, :options, :patches, :keg_only?, :fails_with?, :skip_clean?, :brew, :std_cmake_args, :deps, :external_deps, :recursive_deps, :system, :fetch, :verify_download_integrity, :fails_with_llvm, :fails_with_llvm?, :std_cmake_parameters, :mkdir, :mktemp] 1.8.7 :002 > ``` diff --git a/manpages/brew.1 b/manpages/brew.1 index b200cae880738d18e8537f1733a4e6980ee424b1..a3c89063755906860ffba714849298e27eadcbd3 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -484,10 +484,6 @@ Install from a bottle if it exists for the current or newest version of macOS, e Install testing dependencies required to run \fBbrew test\fR \fIformula\fR\. . .TP -\fB\-\-devel\fR -If \fIformula\fR defines it, install the development version\. -. -.TP \fB\-\-HEAD\fR If \fIformula\fR defines it, install the HEAD version, aka\. master, trunk, unstable\. . @@ -968,14 +964,6 @@ Include all formulae that specify \fIformula\fR as \fB:optional\fR type dependen \fB\-\-skip\-recommended\fR Skip all formulae that specify \fIformula\fR as \fB:recommended\fR type dependency\. . -.TP -\fB\-\-devel\fR -Show usage of \fIformula\fR by development builds\. -. -.TP -\fB\-\-HEAD\fR -Show usage of \fIformula\fR by HEAD builds\. -. .SS "\fB\-\-cache\fR [\fIoptions\fR] [\fIformula|cask\fR]" Display Homebrew\'s download cache\. See also \fBHOMEBREW_CACHE\fR\. .