From d12e39633c6879a5a7e2269727dd1f1e82cee8fc Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Mon, 25 Mar 2019 15:10:35 +0000 Subject: [PATCH 1/2] Remove odisabled. --- Library/Homebrew/brew.rb | 2 -- Library/Homebrew/cmd/prune.rb | 28 ---------------------------- Library/Homebrew/cmd/upgrade.rb | 6 ------ Library/Homebrew/compat.rb | 2 -- Library/Homebrew/compat/formula.rb | 18 ------------------ Library/Homebrew/compat/os/mac.rb | 14 -------------- Library/Homebrew/compilers.rb | 5 +---- Library/Homebrew/formula.rb | 5 ----- Library/Homebrew/software_spec.rb | 5 ----- 9 files changed, 1 insertion(+), 84 deletions(-) delete mode 100644 Library/Homebrew/cmd/prune.rb delete mode 100644 Library/Homebrew/compat/formula.rb delete mode 100644 Library/Homebrew/compat/os/mac.rb diff --git a/Library/Homebrew/brew.rb b/Library/Homebrew/brew.rb index f1119d7c93..ddd3ed641a 100644 --- a/Library/Homebrew/brew.rb +++ b/Library/Homebrew/brew.rb @@ -96,8 +96,6 @@ begin # `Homebrew.help` never returns, except for external/unknown commands. end - odisabled("HOMEBREW_BUILD_FROM_SOURCE", "--build-from-source") if ENV["HOMEBREW_BUILD_FROM_SOURCE"] - if internal_cmd Homebrew.send cmd.to_s.tr("-", "_").downcase elsif which "brew-#{cmd}" diff --git a/Library/Homebrew/cmd/prune.rb b/Library/Homebrew/cmd/prune.rb deleted file mode 100644 index cc9661849d..0000000000 --- a/Library/Homebrew/cmd/prune.rb +++ /dev/null @@ -1,28 +0,0 @@ -require "keg" -require "cli_parser" -require "cleanup" - -module Homebrew - module_function - - def prune_args - Homebrew::CLI::Parser.new do - usage_banner <<~EOS - `prune` [] - - Deprecated. Use `brew cleanup` instead. - EOS - switch "-n", "--dry-run", - description: "Show what would be removed, but do not actually remove anything." - switch :verbose - switch :debug - hide_from_man_page! - end - end - - def prune - prune_args.parse - - odisabled("'brew prune'", "'brew cleanup --prune-prefix'") - end -end diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb index 34ef98199f..d5d07d0d18 100644 --- a/Library/Homebrew/cmd/upgrade.rb +++ b/Library/Homebrew/cmd/upgrade.rb @@ -50,12 +50,6 @@ module Homebrew end def upgrade - if ARGV.include?("--cleanup") - odisabled("'brew upgrade --cleanup'") - elsif ENV["HOMEBREW_UPGRADE_CLEANUP"] - odisabled("'HOMEBREW_UPGRADE_CLEANUP'") - end - upgrade_args.parse FormulaInstaller.prevent_build_flags unless DevelopmentTools.installed? diff --git a/Library/Homebrew/compat.rb b/Library/Homebrew/compat.rb index a5cd87a590..e69de29bb2 100644 --- a/Library/Homebrew/compat.rb +++ b/Library/Homebrew/compat.rb @@ -1,2 +0,0 @@ -require "compat/os/mac" -require "compat/formula" diff --git a/Library/Homebrew/compat/formula.rb b/Library/Homebrew/compat/formula.rb deleted file mode 100644 index 7f34b86d67..0000000000 --- a/Library/Homebrew/compat/formula.rb +++ /dev/null @@ -1,18 +0,0 @@ -class Formula - module Compat - # Run `scons` using a Homebrew-installed version rather than whatever is - # in the `PATH`. - def scons(*) - odisabled("scons", 'system "scons"') - end - - # Run `make` 3.81 or newer. - # Uses the system make on Leopard and newer, and the - # path to the actually-installed make on Tiger or older. - def make(*) - odisabled("make", 'system "make"') - end - end - - prepend Compat -end diff --git a/Library/Homebrew/compat/os/mac.rb b/Library/Homebrew/compat/os/mac.rb deleted file mode 100644 index 043bb85a93..0000000000 --- a/Library/Homebrew/compat/os/mac.rb +++ /dev/null @@ -1,14 +0,0 @@ -module OS - module Mac - class << self - module Compat - def prefer_64_bit? - odisabled("MacOS.prefer_64_bit?") - Hardware::CPU.is_64_bit? - end - end - - prepend Compat - end - end -end diff --git a/Library/Homebrew/compilers.rb b/Library/Homebrew/compilers.rb index a6afa499f3..2cb77302c0 100644 --- a/Library/Homebrew/compilers.rb +++ b/Library/Homebrew/compilers.rb @@ -16,10 +16,7 @@ class CompilerFailure attr_reader :name def version(val = nil) - if val - @version = Version.parse(val.to_s) - odisabled "'fails_with :clang' with 'build' < 600" if name.to_s == "clang" && val.to_i < 600 - end + @version = Version.parse(val.to_s) if val @version end diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 2506eac37b..8e70a69f1d 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -2496,15 +2496,10 @@ class Formula # version '7.1' # end def fails_with(compiler, &block) - odisabled "fails_with :gcc_4_0" if compiler == :gcc_4_0 - odisabled "fails_with :gcc_4_2" if compiler == :gcc_4_2 - odisabled "fails_with :gcc" if compiler == :gcc && !block_given? specs.each { |spec| spec.fails_with(compiler, &block) } end def needs(*standards) - odisabled "needs :cxx11" if standards.include?(:cxx11) - odisabled "needs :cxx14" if standards.include?(:cxx14) specs.each { |spec| spec.needs(*standards) } end diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb index d49b87d22c..2e17a9882f 100644 --- a/Library/Homebrew/software_spec.rb +++ b/Library/Homebrew/software_spec.rb @@ -206,15 +206,10 @@ class SoftwareSpec end def fails_with(compiler, &block) - odisabled "fails_with :gcc_4_0" if compiler == :gcc_4_0 - odisabled "fails_with :gcc_4_2" if compiler == :gcc_4_2 - odisabled "fails_with :gcc" if compiler == :gcc && !block_given? compiler_failures << CompilerFailure.create(compiler, &block) end def needs(*standards) - odisabled "needs :cxx11" if standards.include?(:cxx11) - odisabled "needs :cxx14" if standards.include?(:cxx14) standards.each do |standard| compiler_failures.concat CompilerFailure.for_standard(standard) end From 7d26a61cc85580208da5d62e20278f512e8e0482 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sat, 30 Mar 2019 10:17:34 +0000 Subject: [PATCH 2/2] Deprecate tap pinning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tap pinning is not used by Homebrew or the Homebrew maintainers so issues relating to pinned taps (#5418, #5796) don’t get fixed. Tap pinning does not work consistently or reliably and is conceptually confusing to encourage users to use fully-scoped user/tap/formula naming or avoid shadowing core tap formulae' names instead. --- Library/Homebrew/cmd/tap-pin.rb | 4 ++++ Library/Homebrew/cmd/tap-unpin.rb | 4 ++++ Library/Homebrew/formulary.rb | 4 ++++ docs/Manpage.md | 9 --------- manpages/brew.1 | 6 ------ 5 files changed, 12 insertions(+), 15 deletions(-) diff --git a/Library/Homebrew/cmd/tap-pin.rb b/Library/Homebrew/cmd/tap-pin.rb index 0617e5ea8e..c04bae48fc 100644 --- a/Library/Homebrew/cmd/tap-pin.rb +++ b/Library/Homebrew/cmd/tap-pin.rb @@ -12,10 +12,14 @@ module Homebrew by the user. See also `tap-unpin`. EOS switch :debug + hide_from_man_page! end end def tap_pin + odeprecated "brew tap-pin user/tap", + "fully-scoped user/tap/formula naming" + tap_pin_args.parse ARGV.named.each do |name| diff --git a/Library/Homebrew/cmd/tap-unpin.rb b/Library/Homebrew/cmd/tap-unpin.rb index 7d030b969b..25fc23bf59 100644 --- a/Library/Homebrew/cmd/tap-unpin.rb +++ b/Library/Homebrew/cmd/tap-unpin.rb @@ -11,10 +11,14 @@ module Homebrew Unpin so its formulae are no longer prioritised. See also `tap-pin`. EOS switch :debug + hide_from_man_page! end end def tap_unpin + odeprecated "brew tap-pin user/tap", + "fully-scoped user/tap/formula naming" + tap_unpin_args.parse ARGV.named.each do |name| diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb index 8b40c7376f..9722eeafdc 100644 --- a/Library/Homebrew/formulary.rb +++ b/Library/Homebrew/formulary.rb @@ -460,9 +460,13 @@ module Formulary if possible_pinned_tap_formulae.size == 1 selected_formula = factory(possible_pinned_tap_formulae.first, spec) if core_path(ref).file? + odeprecated "brew tap-pin user/tap", + "fully-scoped user/tap/formula naming" opoo <<~EOS #{ref} is provided by core, but is now shadowed by #{selected_formula.full_name}. + This behaviour is deprecated and will be removed in Homebrew 2.2.0. To refer to the core formula, use Homebrew/core/#{ref} instead. + To refer to the tap formula, use #{selected_formula.full_name} instead. EOS end selected_formula diff --git a/docs/Manpage.md b/docs/Manpage.md index a47c0784ef..317536e7e1 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -488,15 +488,6 @@ summary of all installed taps if no *`tap`* are passed. * `--json`: Print a JSON representation of *`taps`*. Currently the default and only accepted value for *`version`* is `v1`. See the docs for examples of using the JSON output: -### `tap-pin` *`tap`* - -Pin *`tap`*, prioritising its formulae over core when formula names are supplied -by the user. See also `tap-unpin`. - -### `tap-unpin` *`tap`* - -Unpin *`tap`* so its formulae are no longer prioritised. See also `tap-pin`. - ### `uninstall`, `rm`, `remove` [*`options`*] *`formula`* Uninstall *`formula`*. diff --git a/manpages/brew.1 b/manpages/brew.1 index 0816a4624f..c9c4f9649e 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -612,12 +612,6 @@ Display information on all installed taps\. \fB\-\-json\fR Print a JSON representation of \fItaps\fR\. Currently the default and only accepted value for \fIversion\fR is \fBv1\fR\. See the docs for examples of using the JSON output: \fIhttps://docs\.brew\.sh/Querying\-Brew\fR . -.SS "\fBtap\-pin\fR \fItap\fR" -Pin \fItap\fR, prioritising its formulae over core when formula names are supplied by the user\. See also \fBtap\-unpin\fR\. -. -.SS "\fBtap\-unpin\fR \fItap\fR" -Unpin \fItap\fR so its formulae are no longer prioritised\. See also \fBtap\-pin\fR\. -. .SS "\fBuninstall\fR, \fBrm\fR, \fBremove\fR [\fIoptions\fR] \fIformula\fR" Uninstall \fIformula\fR\. .