diff --git a/Library/Homebrew/.rubocop.yml b/Library/Homebrew/.rubocop.yml index ebfcf6ca3b7d87e8bbd8671a99ed16e3e9f0b3a9..317c6ffd6302e26ccb965a8d85a2b23832b8967d 100644 --- a/Library/Homebrew/.rubocop.yml +++ b/Library/Homebrew/.rubocop.yml @@ -64,10 +64,10 @@ Metrics/LineLength: IgnoredPatterns: ['#: '] # we won't change backward compatible predicate names -# TODO: deprecate whitelisted names and move to compat Naming/PredicateName: Exclude: - 'compat/**/*' + # can't rename these NameWhitelist: is_32_bit?, is_64_bit? # whitelist those that are standard diff --git a/Library/Homebrew/brew.rb b/Library/Homebrew/brew.rb index 8124cd02cfdd16add9720f7ee1717761943e7f59..96ebd7effee0d2872a7b35cb32b243c74f2e4356 100644 --- a/Library/Homebrew/brew.rb +++ b/Library/Homebrew/brew.rb @@ -95,7 +95,7 @@ begin end if ENV["HOMEBREW_BUILD_FROM_SOURCE"] - odeprecated("HOMEBREW_BUILD_FROM_SOURCE", "--build-from-source") + odisabled("HOMEBREW_BUILD_FROM_SOURCE", "--build-from-source") end if internal_cmd diff --git a/Library/Homebrew/build_environment.rb b/Library/Homebrew/build_environment.rb index 54dc6f3407315193e058c82cbc5dbf58f70e2239..d8ecdccbdf22644c6daf0af52f411b892abb961a 100644 --- a/Library/Homebrew/build_environment.rb +++ b/Library/Homebrew/build_environment.rb @@ -41,7 +41,7 @@ module Homebrew MACOSX_DEPLOYMENT_TARGET PKG_CONFIG_PATH PKG_CONFIG_LIBDIR HOMEBREW_DEBUG HOMEBREW_MAKE_JOBS HOMEBREW_VERBOSE HOMEBREW_SVN HOMEBREW_GIT - HOMEBREW_SDKROOT HOMEBREW_BUILD_FROM_SOURCE + HOMEBREW_SDKROOT MAKE GIT CPP ACLOCAL_PATH PATH CPATH LD_LIBRARY_PATH LD_RUN_PATH LD_PRELOAD LIBRARY_PATH diff --git a/Library/Homebrew/cleanup.rb b/Library/Homebrew/cleanup.rb index e11dc893ecab26f50358466af5d7163e44c3417f..0b13099781d61bd99ea7480844024c44ba642352 100644 --- a/Library/Homebrew/cleanup.rb +++ b/Library/Homebrew/cleanup.rb @@ -158,7 +158,6 @@ module Homebrew def self.install_formula_clean!(f) return if ENV["HOMEBREW_NO_INSTALL_CLEANUP"] - return unless ENV["HOMEBREW_INSTALL_CLEANUP"] cleanup = Cleanup.new if cleanup.periodic_clean_due? @@ -170,7 +169,6 @@ module Homebrew def periodic_clean_due? return false if ENV["HOMEBREW_NO_INSTALL_CLEANUP"] - return unless ENV["HOMEBREW_INSTALL_CLEANUP"] return true unless PERIODIC_CLEAN_FILE.exist? PERIODIC_CLEAN_FILE.mtime < CLEANUP_DEFAULT_DAYS.days.ago diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index 2bb5779376fc8f738769e853da88af630fada4df..c0fbc44695ed1fbe606a6f0e833aa2c1f243c187 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -31,10 +31,6 @@ #: source even if a bottle is provided. Dependencies will still be installed #: from bottles if they are available. #: -#: If `HOMEBREW_BUILD_FROM_SOURCE` is set, regardless of whether `--build-from-source` was -#: passed, then both <formula> and the dependencies installed as part of this process -#: are built from source even if bottles are available. -#: #: If `--force-bottle` is passed, 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. diff --git a/Library/Homebrew/cmd/prune.rb b/Library/Homebrew/cmd/prune.rb index 3c8ffdb3f0d243c262d422733f53ae2a58bde42f..387af4976427c5ce5c2a3320e1733d20369371eb 100644 --- a/Library/Homebrew/cmd/prune.rb +++ b/Library/Homebrew/cmd/prune.rb @@ -25,7 +25,6 @@ module Homebrew def prune prune_args.parse - odeprecated("'brew prune'", "'brew cleanup'") - Cleanup.new(dry_run: args.dry_run?).prune_prefix_symlinks_and_directories + odisabled("'brew prune'", "'brew cleanup'") end end diff --git a/Library/Homebrew/cmd/reinstall.rb b/Library/Homebrew/cmd/reinstall.rb index 658247b77b0b4a49b57a2d392eb33902191bdfc3..123e97d7abc7c30ec94d9e57a4eb3aa9cdba6166 100644 --- a/Library/Homebrew/cmd/reinstall.rb +++ b/Library/Homebrew/cmd/reinstall.rb @@ -3,9 +3,6 @@ #: #: If `--display-times` is passed, install times for each formula are printed #: at the end of the run. -#: -#: If `HOMEBREW_INSTALL_CLEANUP` is set then remove previously installed versions -#: of upgraded <formulae> as well as the HOMEBREW_CACHE for that formula. require "formula_installer" require "development_tools" @@ -23,9 +20,6 @@ module Homebrew `reinstall` [<option(s)>] <formula>: Uninstall and then install <formula> (with existing install options). - - If `HOMEBREW_INSTALL_CLEANUP` is set then remove previously installed versions - of upgraded <formulae> as well as the HOMEBREW_CACHE for that formula. EOS switch "-s", "--build-from-source", description: "Compile the formula> from source even if a bottle is available." diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb index fd84995b72af2577039f367f9143464c64feeab2..7a9fad981c20a43c63d2b693316f61d66f2fff0c 100644 --- a/Library/Homebrew/cmd/upgrade.rb +++ b/Library/Homebrew/cmd/upgrade.rb @@ -28,13 +28,10 @@ module Homebrew module_function def upgrade - # TODO: deprecate for next minor release. if ARGV.include?("--cleanup") - ENV["HOMEBREW_INSTALL_CLEANUP"] = "1" - odeprecated("'brew upgrade --cleanup'", "'HOMEBREW_INSTALL_CLEANUP'") + odisabled("'brew upgrade --cleanup'") elsif ENV["HOMEBREW_UPGRADE_CLEANUP"] - ENV["HOMEBREW_INSTALL_CLEANUP"] = "1" - odeprecated("'HOMEBREW_UPGRADE_CLEANUP'", "'HOMEBREW_INSTALL_CLEANUP'") + odisabled("'HOMEBREW_UPGRADE_CLEANUP'") end FormulaInstaller.prevent_build_flags unless DevelopmentTools.installed? diff --git a/Library/Homebrew/compat.rb b/Library/Homebrew/compat.rb index 5079476f18bbc957c366fc7755399d9b9553c2b9..a5cd87a59077df6c878a8d90ba4080a8ecacf825 100644 --- a/Library/Homebrew/compat.rb +++ b/Library/Homebrew/compat.rb @@ -1,8 +1,2 @@ -require "compat/extend/os/mac/utils/bottles" require "compat/os/mac" -require "compat/requirements/x11_requirement" -require "compat/requirements/xcode_requirement" -require "compat/cask" -require "compat/download_strategy" require "compat/formula" -require "compat/tap" diff --git a/Library/Homebrew/compat/cask.rb b/Library/Homebrew/compat/cask.rb deleted file mode 100644 index 59708eeb98514741fcf4ee51f5c481827c5a1250..0000000000000000000000000000000000000000 --- a/Library/Homebrew/compat/cask.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "compat/cask/cache" -require "compat/cask/cask_loader" -require "compat/cask/caskroom" -require "compat/cask/dsl" - -module Cask - class << self - module Compat - def init - Cache.delete_legacy_cache - - Caskroom.migrate_caskroom_from_repo_to_prefix - Caskroom.migrate_legacy_caskroom - - super - end - end - - prepend Compat - end -end diff --git a/Library/Homebrew/compat/cask/cache.rb b/Library/Homebrew/compat/cask/cache.rb deleted file mode 100644 index b70f0412a2b3b7828cdbe871bda2add0d2a94512..0000000000000000000000000000000000000000 --- a/Library/Homebrew/compat/cask/cache.rb +++ /dev/null @@ -1,17 +0,0 @@ -module Cask - module Cache - class << self - module Compat - def delete_legacy_cache - legacy_cache = HOMEBREW_CACHE.join("Casks") - return unless legacy_cache.exist? - - ohai "Deleting legacy cache at #{legacy_cache}" - FileUtils.remove_entry_secure(legacy_cache) - end - end - - prepend Compat - end - end -end diff --git a/Library/Homebrew/compat/cask/cask_loader.rb b/Library/Homebrew/compat/cask/cask_loader.rb deleted file mode 100644 index d0119b4ef1df491802bedadec76a78a43f096081..0000000000000000000000000000000000000000 --- a/Library/Homebrew/compat/cask/cask_loader.rb +++ /dev/null @@ -1,24 +0,0 @@ -module Cask - module CaskLoader - class FromContentLoader; end - - class FromPathLoader < FromContentLoader - module Compat - private - - # TODO: can't delete this code until the merge of - # https://github.com/Homebrew/brew/pull/4730 or an equivalent. - def cask(header_token, **options, &block) - if header_token.is_a?(Hash) && header_token.key?(:v1) - odisabled %q("cask :v1 => 'token'"), %q("cask 'token'") - header_token = header_token[:v1] - end - - super(header_token, **options, &block) - end - end - - prepend Compat - end - end -end diff --git a/Library/Homebrew/compat/cask/caskroom.rb b/Library/Homebrew/compat/cask/caskroom.rb deleted file mode 100644 index 87597c05d240c6e8d03a9f24e23a9897017ebdb6..0000000000000000000000000000000000000000 --- a/Library/Homebrew/compat/cask/caskroom.rb +++ /dev/null @@ -1,49 +0,0 @@ -module Cask - module Caskroom - class << self - module Compat - def migrate_legacy_caskroom - return if path.exist? - - legacy_caskroom_path = Pathname.new("/opt/homebrew-cask/Caskroom") - return if path == legacy_caskroom_path - return unless legacy_caskroom_path.exist? - return if legacy_caskroom_path.symlink? - - ohai "Migrating Caskroom from #{legacy_caskroom_path} to #{path}." - if path.parent.writable? - FileUtils.mv legacy_caskroom_path, path - else - opoo "#{path.parent} is not writable, sudo is needed to move the Caskroom." - SystemCommand.run("/bin/mv", args: [legacy_caskroom_path, path.parent], sudo: true) - end - - ohai "Creating symlink from #{path} to #{legacy_caskroom_path}." - if legacy_caskroom_path.parent.writable? - FileUtils.ln_s path, legacy_caskroom_path - else - opoo "#{legacy_caskroom_path.parent} is not writable, sudo is needed to link the Caskroom." - SystemCommand.run("/bin/ln", args: ["-s", path, legacy_caskroom_path], sudo: true) - end - end - - def migrate_caskroom_from_repo_to_prefix - repo_caskroom_path = HOMEBREW_REPOSITORY.join("Caskroom") - return if path.exist? - return unless repo_caskroom_path.directory? - - ohai "Moving Caskroom from HOMEBREW_REPOSITORY to HOMEBREW_PREFIX" - - if path.parent.writable? - FileUtils.mv repo_caskroom_path, path - else - opoo "#{path.parent} is not writable, sudo is needed to move the Caskroom." - SystemCommand.run("/bin/mv", args: [repo_caskroom_path, path.parent], sudo: true) - end - end - end - - prepend Compat - end - end -end diff --git a/Library/Homebrew/compat/cask/dsl.rb b/Library/Homebrew/compat/cask/dsl.rb deleted file mode 100644 index 646af0836413e3d7c0a5c81b1c96435fe78a95cb..0000000000000000000000000000000000000000 --- a/Library/Homebrew/compat/cask/dsl.rb +++ /dev/null @@ -1,22 +0,0 @@ -module Cask - class DSL - module Compat - # TODO: can't delete this code until the merge of - # https://github.com/Homebrew/brew/pull/4730 or an equivalent. - - def gpg(*) - odisabled "the `gpg` stanza" - end - - def license(*) - odisabled "the `license` stanza" - end - - def accessibility_access(*) - odisabled "the `accessibility_access` stanza" - end - end - - prepend Compat - end -end diff --git a/Library/Homebrew/compat/download_strategy.rb b/Library/Homebrew/compat/download_strategy.rb deleted file mode 100644 index 960ca9f067cf821b4ac9cb7e7063889e99d2a047..0000000000000000000000000000000000000000 --- a/Library/Homebrew/compat/download_strategy.rb +++ /dev/null @@ -1,256 +0,0 @@ -require "download_strategy" - -# S3DownloadStrategy downloads tarballs from AWS S3. -# To use it, add `:using => :s3` to the URL section of your -# formula. This download strategy uses AWS access tokens (in the -# environment variables `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`) -# to sign the request. This strategy is good in a corporate setting, -# because it lets you use a private S3 bucket as a repo for internal -# distribution. (It will work for public buckets as well.) -class S3DownloadStrategy < CurlDownloadStrategy - def initialize(url, name, version, **meta) - odisabled("S3DownloadStrategy", - "a vendored S3DownloadStrategy in your own formula or tap (using require_relative)") - super - end - - def _fetch(url:, resolved_url:) - if url !~ %r{^https?://([^.].*)\.s3\.amazonaws\.com/(.+)$} && - url !~ %r{^s3://([^.].*?)/(.+)$} - raise "Bad S3 URL: " + url - end - - bucket = Regexp.last_match(1) - key = Regexp.last_match(2) - - ENV["AWS_ACCESS_KEY_ID"] = ENV["HOMEBREW_AWS_ACCESS_KEY_ID"] - ENV["AWS_SECRET_ACCESS_KEY"] = ENV["HOMEBREW_AWS_SECRET_ACCESS_KEY"] - - begin - require "aws-sdk-s3" - rescue LoadError - Homebrew.install_gem! "aws-sdk-s3", "~> 1.8" - require "aws-sdk-s3" - end - - begin - signer = Aws::S3::Presigner.new - s3url = signer.presigned_url :get_object, bucket: bucket, key: key - rescue Aws::Sigv4::Errors::MissingCredentialsError - ohai "AWS credentials missing, trying public URL instead." - s3url = url - end - - curl_download s3url, to: temporary_path - end -end - -# GitHubPrivateRepositoryDownloadStrategy downloads contents from GitHub -# Private Repository. To use it, add -# `:using => :github_private_repo` to the URL section of -# your formula. This download strategy uses GitHub access tokens (in the -# environment variables `HOMEBREW_GITHUB_API_TOKEN`) to sign the request. This -# strategy is suitable for corporate use just like S3DownloadStrategy, because -# it lets you use a private GitHub repository for internal distribution. It -# works with public one, but in that case simply use CurlDownloadStrategy. -class GitHubPrivateRepositoryDownloadStrategy < CurlDownloadStrategy - require "utils/formatter" - require "utils/github" - - def initialize(url, name, version, **meta) - odisabled("GitHubPrivateRepositoryDownloadStrategy", - "a vendored GitHubPrivateRepositoryDownloadStrategy in your own formula or tap (using require_relative)") - super - parse_url_pattern - set_github_token - end - - def parse_url_pattern - unless match = url.match(%r{https://github.com/([^/]+)/([^/]+)/(\S+)}) - raise CurlDownloadStrategyError, "Invalid url pattern for GitHub Repository." - end - - _, @owner, @repo, @filepath = *match - end - - def download_url - "https://#{@github_token}@github.com/#{@owner}/#{@repo}/#{@filepath}" - end - - private - - def _fetch(url:, resolved_url:) - curl_download download_url, to: temporary_path - end - - def set_github_token - @github_token = ENV["HOMEBREW_GITHUB_API_TOKEN"] - unless @github_token - raise CurlDownloadStrategyError, "Environmental variable HOMEBREW_GITHUB_API_TOKEN is required." - end - - validate_github_repository_access! - end - - def validate_github_repository_access! - # Test access to the repository - GitHub.repository(@owner, @repo) - rescue GitHub::HTTPNotFoundError - # We only handle HTTPNotFoundError here, - # becase AuthenticationFailedError is handled within util/github. - message = <<~EOS - HOMEBREW_GITHUB_API_TOKEN can not access the repository: #{@owner}/#{@repo} - This token may not have permission to access the repository or the url of formula may be incorrect. - EOS - raise CurlDownloadStrategyError, message - end -end - -# GitHubPrivateRepositoryReleaseDownloadStrategy downloads tarballs from GitHub -# Release assets. To use it, add `:using => :github_private_release` to the URL section -# of your formula. This download strategy uses GitHub access tokens (in the -# environment variables HOMEBREW_GITHUB_API_TOKEN) to sign the request. -class GitHubPrivateRepositoryReleaseDownloadStrategy < GitHubPrivateRepositoryDownloadStrategy - def initialize(url, name, version, **meta) - odisabled("GitHubPrivateRepositoryReleaseDownloadStrategy", - "a vendored GitHubPrivateRepositoryReleaseDownloadStrategy in your own formula or tap (using require_relative)") - super - end - - def parse_url_pattern - url_pattern = %r{https://github.com/([^/]+)/([^/]+)/releases/download/([^/]+)/(\S+)} - unless @url =~ url_pattern - raise CurlDownloadStrategyError, "Invalid url pattern for GitHub Release." - end - - _, @owner, @repo, @tag, @filename = *@url.match(url_pattern) - end - - def download_url - "https://#{@github_token}@api.github.com/repos/#{@owner}/#{@repo}/releases/assets/#{asset_id}" - end - - private - - def _fetch(url:, resolved_url:) - # HTTP request header `Accept: application/octet-stream` is required. - # Without this, the GitHub API will respond with metadata, not binary. - curl_download download_url, "--header", "Accept: application/octet-stream", to: temporary_path - end - - def asset_id - @asset_id ||= resolve_asset_id - end - - def resolve_asset_id - release_metadata = fetch_release_metadata - assets = release_metadata["assets"].select { |a| a["name"] == @filename } - raise CurlDownloadStrategyError, "Asset file not found." if assets.empty? - - assets.first["id"] - end - - def fetch_release_metadata - release_url = "https://api.github.com/repos/#{@owner}/#{@repo}/releases/tags/#{@tag}" - GitHub.open_api(release_url) - end -end - -# ScpDownloadStrategy downloads files using ssh via scp. To use it, add -# `:using => :scp` to the URL section of your formula or -# provide a URL starting with scp://. This strategy uses ssh credentials for -# authentication. If a public/private keypair is configured, it will not -# prompt for a password. -# -# @example -# class Abc < Formula -# url "scp://example.com/src/abc.1.0.tar.gz" -# ... -class ScpDownloadStrategy < AbstractFileDownloadStrategy - def initialize(url, name, version, **meta) - odisabled("ScpDownloadStrategy", - "a vendored ScpDownloadStrategy in your own formula or tap (using require_relative)") - super - parse_url_pattern - end - - def parse_url_pattern - url_pattern = %r{scp://([^@]+@)?([^@:/]+)(:\d+)?/(\S+)} - if @url !~ url_pattern - raise ScpDownloadStrategyError, "Invalid URL for scp: #{@url}" - end - - _, @user, @host, @port, @path = *@url.match(url_pattern) - end - - def fetch - ohai "Downloading #{@url}" - - if cached_location.exist? - puts "Already downloaded: #{cached_location}" - else - system_command! "scp", args: [scp_source, temporary_path.to_s] - ignore_interrupts { temporary_path.rename(cached_location) } - end - end - - def clear_cache - super - rm_rf(temporary_path) - end - - private - - def scp_source - path_prefix = "/" unless @path.start_with?("~") - port_arg = "-P #{@port[1..-1]} " if @port - "#{port_arg}#{@user}#{@host}:#{path_prefix}#{@path}" - end -end - -class DownloadStrategyDetector - class << self - module Compat - def detect_from_url(url) - case url - when %r{^s3://} - odisabled("s3://", - "a vendored S3DownloadStrategy in your own formula or tap (using require_relative)") - S3DownloadStrategy - when %r{^scp://} - odisabled("scp://", - "a vendored ScpDownloadStrategy in your own formula or tap (using require_relative)") - ScpDownloadStrategy - else - super(url) - end - end - - def detect_from_symbol(symbol) - case symbol - when :github_private_repo - odisabled(":github_private_repo", - "a vendored GitHubPrivateRepositoryDownloadStrategy in your own formula or tap (using require_relative)") - GitHubPrivateRepositoryDownloadStrategy - when :github_private_release - odisabled(":github_private_repo", - "a vendored GitHubPrivateRepositoryReleaseDownloadStrategy in your own formula or tap "\ - "(using require_relative)") - GitHubPrivateRepositoryReleaseDownloadStrategy - when :s3 - odisabled(":s3", - "a vendored S3DownloadStrategy in your own formula or tap (using require_relative)") - S3DownloadStrategy - when :scp - odisabled(":scp", - "a vendored ScpDownloadStrategy in your own formula or tap (using require_relative)") - ScpDownloadStrategy - else - super(symbol) - end - end - end - - prepend Compat - end -end diff --git a/Library/Homebrew/compat/extend/os/mac/utils/bottles.rb b/Library/Homebrew/compat/extend/os/mac/utils/bottles.rb deleted file mode 100644 index 4e26d0a4ea7bd1c51c95dcd878e14ffb410205eb..0000000000000000000000000000000000000000 --- a/Library/Homebrew/compat/extend/os/mac/utils/bottles.rb +++ /dev/null @@ -1,19 +0,0 @@ -module Utils - class Bottles - class Collector - module Compat - private - - def tag_without_or_later(tag) - return super unless tag.to_s.end_with?("_or_later") - - odisabled "`or_later` bottles", - "bottles without `or_later` (or_later is implied now)" - tag.to_s[/(\w+)_or_later$/, 1].to_sym - end - end - - prepend Compat - end - end -end diff --git a/Library/Homebrew/compat/formula.rb b/Library/Homebrew/compat/formula.rb index d85802e42561fb11502a1e51ede0c826850fe1a0..7f34b86d67e229357f9a7535281f62a21b360b4a 100644 --- a/Library/Homebrew/compat/formula.rb +++ b/Library/Homebrew/compat/formula.rb @@ -2,40 +2,15 @@ class Formula module Compat # Run `scons` using a Homebrew-installed version rather than whatever is # in the `PATH`. - # TODO: deprecate - def scons(*args) - odeprecated("scons", 'system "scons"') - - system Formulary.factory("scons").opt_bin/"scons", *args + 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. - # TODO: deprecate - def make(*args) - odeprecated("make", 'system "make"') - - if Utils.popen_read("/usr/bin/make", "--version") - .match(/Make (\d\.\d+)/)[1] > "3.80" - make_path = "/usr/bin/make" - else - make = Formula["make"].opt_bin/"make" - make_path = if make.exist? - make.to_s - else - (Formula["make"].opt_bin/"gmake").to_s - end - end - - if superenv? - make_name = File.basename(make_path) - with_env(HOMEBREW_MAKE: make_name) do - system "make", *args - end - else - system make_path, *args - end + def make(*) + odisabled("make", 'system "make"') end end diff --git a/Library/Homebrew/compat/os/mac.rb b/Library/Homebrew/compat/os/mac.rb index b94b744b908bb173e104cdfc3f54c84a11ab9a91..043bb85a93b0fb7256cba1383fd62edefd31ce87 100644 --- a/Library/Homebrew/compat/os/mac.rb +++ b/Library/Homebrew/compat/os/mac.rb @@ -3,7 +3,7 @@ module OS class << self module Compat def prefer_64_bit? - odeprecated("MacOS.prefer_64_bit?") + odisabled("MacOS.prefer_64_bit?") Hardware::CPU.is_64_bit? end end diff --git a/Library/Homebrew/compat/requirements/x11_requirement.rb b/Library/Homebrew/compat/requirements/x11_requirement.rb deleted file mode 100644 index 6d1b686d8ab2b1ac1bc65b61c3e1a3ff409aea96..0000000000000000000000000000000000000000 --- a/Library/Homebrew/compat/requirements/x11_requirement.rb +++ /dev/null @@ -1,15 +0,0 @@ -require "requirement" - -class X11Requirement < Requirement - module Compat - def initialize(tags = []) - if tags.first.to_s.match?(/(\d\.)+\d/) - odisabled('depends_on :x11 => "X.Y.Z"') - end - - super(tags) - end - end - - prepend Compat -end diff --git a/Library/Homebrew/compat/requirements/xcode_requirement.rb b/Library/Homebrew/compat/requirements/xcode_requirement.rb deleted file mode 100644 index 93ada7f8267bdafea8420fb90dd68f0d5bfbd253..0000000000000000000000000000000000000000 --- a/Library/Homebrew/compat/requirements/xcode_requirement.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "requirement" - -class XcodeRequirement < Requirement - module Compat - def initialize(tags = []) - @version = if tags.first.to_s.match?(/(\d\.)+\d/) - tags.shift - else - tags.find do |tag| - next unless tag.to_s.match?(/(\d\.)+\d/) - odisabled('depends_on :xcode => [..., "X.Y.Z"]') - tags.delete(tag) - end - end - - super(tags) - end - end - - prepend Compat -end diff --git a/Library/Homebrew/compat/tap.rb b/Library/Homebrew/compat/tap.rb deleted file mode 100644 index e7953fe4615a6cbc53c7153e6d4384f6cee3abef..0000000000000000000000000000000000000000 --- a/Library/Homebrew/compat/tap.rb +++ /dev/null @@ -1,47 +0,0 @@ -class Tap - module Compat - def initialize(user, repo) - super - - return unless user == "caskroom" - - old_initial_revision_var = "HOMEBREW_UPDATE_BEFORE#{repo_var}" - old_current_revision_var = "HOMEBREW_UPDATE_AFTER#{repo_var}" - - new_user = "Homebrew" - new_repo = (repo == "cask") ? repo : "cask-#{repo}" - - old_name = name - old_path = path - old_remote = path.git_origin - - clear_cache - super(new_user, new_repo) - - return unless old_path.directory? - - new_initial_revision_var = "HOMEBREW_UPDATE_BEFORE#{repo_var}" - new_current_revision_var = "HOMEBREW_UPDATE_AFTER#{repo_var}" - - ENV[new_initial_revision_var] ||= ENV[old_initial_revision_var] - ENV[new_current_revision_var] ||= ENV[old_current_revision_var] - - new_name = name - new_path = path - new_remote = default_remote - - ohai "Migrating tap #{old_name} to #{new_name}..." if $stdout.tty? - - if old_path.git? - puts "Changing remote from #{old_remote} to #{new_remote}..." if $stdout.tty? - old_path.git_origin = new_remote - end - - puts "Moving #{old_path} to #{new_path}..." if $stdout.tty? - path.dirname.mkpath - FileUtils.mv old_path, new_path - end - end - - prepend Compat -end diff --git a/Library/Homebrew/dev-cmd/tests.rb b/Library/Homebrew/dev-cmd/tests.rb index 58e6843236fd66065a0470c569a6cef6ef08761e..af9ffee6a40b92f9d19a48b57e49898d6c54866c 100644 --- a/Library/Homebrew/dev-cmd/tests.rb +++ b/Library/Homebrew/dev-cmd/tests.rb @@ -61,7 +61,6 @@ module Homebrew ENV.delete("HOMEBREW_NO_GITHUB_API") ENV.delete("HOMEBREW_NO_EMOJI") ENV.delete("HOMEBREW_DEVELOPER") - ENV.delete("HOMEBREW_INSTALL_CLEANUP") ENV["HOMEBREW_NO_ANALYTICS_THIS_RUN"] = "1" ENV["HOMEBREW_NO_COMPAT"] = "1" if args.no_compat? ENV["HOMEBREW_TEST_GENERIC_OS"] = "1" if args.generic? diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb index 7eff0334c060c4e76cad709bf0b711798e4194ec..53f70165114a05d0886190032124578366f7d342 100644 --- a/Library/Homebrew/diagnostic.rb +++ b/Library/Homebrew/diagnostic.rb @@ -115,15 +115,6 @@ module Homebrew EOS end - def check_build_from_source - return unless ENV["HOMEBREW_BUILD_FROM_SOURCE"] - - <<~EOS - You have HOMEBREW_BUILD_FROM_SOURCE set. - #{please_create_pull_requests} - EOS - end - # Anaconda installs multiple system & brew dupes, including OpenSSL, Python, # sqlite, libpng, Qt, etc. Regularly breaks compile on Vim, MacVim and others. # Is flagged as part of the *-config script checks below, but people seem diff --git a/Library/Homebrew/extend/ARGV.rb b/Library/Homebrew/extend/ARGV.rb index d69a3c2df46533a5d394a5c532e753a9fc5094af..ac931df1f5b56777e7b760af3486538e5bc400e0 100644 --- a/Library/Homebrew/extend/ARGV.rb +++ b/Library/Homebrew/extend/ARGV.rb @@ -219,15 +219,10 @@ module HomebrewArgvExtension switch?("s") || include?("--build-from-source") end - def build_all_from_source? - !ENV["HOMEBREW_BUILD_FROM_SOURCE"].nil? - end - # Whether a given formula should be built from source during the current # installation run. def build_formula_from_source?(f) - return true if build_all_from_source? - return false unless build_from_source? || build_bottle? + return false if !build_from_source? && !build_bottle? formulae.any? { |argv_f| argv_f.full_name == f.full_name } end diff --git a/Library/Homebrew/extend/os/mac/diagnostic.rb b/Library/Homebrew/extend/os/mac/diagnostic.rb index c4669c9baa1d2cb0386c2f88e4c0b33e17d049e5..e93f180e65aa68ac7242d2be35a6166102958afa 100644 --- a/Library/Homebrew/extend/os/mac/diagnostic.rb +++ b/Library/Homebrew/extend/os/mac/diagnostic.rb @@ -15,7 +15,6 @@ module Homebrew def supported_configuration_checks %w[ - check_build_from_source check_for_unsupported_macos ].freeze end diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index eec6635b29732fff7f578f968888504eadec2ced..982b53282ece91c0fcba152157e89ac9a4c2c555 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -2510,7 +2510,7 @@ class Formula # version '7.1' # end</pre> def fails_with(compiler, &block) - odeprecated "fails_with :gcc_4_0" if compiler == :gcc_4_0 + odisabled "fails_with :gcc_4_0" if compiler == :gcc_4_0 specs.each { |spec| spec.fails_with(compiler, &block) } end diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index fd8c233b52cba1b83d6036e7331a0ac6201857f1..1860724bd49f30efd84ce26df230c0ce140c01b8 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -46,7 +46,7 @@ class FormulaInstaller @show_header = false @ignore_deps = false @only_deps = false - @build_from_source = ARGV.build_from_source? || ARGV.build_all_from_source? + @build_from_source = ARGV.build_from_source? @build_bottle = false @force_bottle = ARGV.force_bottle? @include_test = ARGV.include?("--include-test") diff --git a/Library/Homebrew/manpages/brew.1.md.erb b/Library/Homebrew/manpages/brew.1.md.erb index 7191f20cb6bb5835fd7d685ed4831d2c5e9140d3..06f41e37f370c910c3cb1f8be591baa5464f7a7c 100644 --- a/Library/Homebrew/manpages/brew.1.md.erb +++ b/Library/Homebrew/manpages/brew.1.md.erb @@ -192,16 +192,6 @@ Note that environment variables must have a value set to be detected. For exampl *Default:* the beer emoji. - * `HOMEBREW_INSTALL_CLEANUP`: - If set, `brew install`, `brew upgrade` and `brew reinstall` will remove - previously installed version(s) of the installed/upgraded formulae. - - If `brew cleanup` has not been run in 30 days then it will be run at this - time. - - This will become the default in a later version of Homebrew. To opt-out see - `HOMEBREW_NO_INSTALL_CLEANUP`. - * `HOMEBREW_LOGS`: If set, Homebrew will use the specified directory to store log files. diff --git a/Library/Homebrew/os.rb b/Library/Homebrew/os.rb index 7daa73051f6dba37d119ef313c2a444377c0b172..24803816af4a9ac4f78dbdf99ab725bfe9db784b 100644 --- a/Library/Homebrew/os.rb +++ b/Library/Homebrew/os.rb @@ -18,7 +18,6 @@ module OS # Don't tell people to report issues on unsupported configurations. if !OS::Mac.prerelease? && !OS::Mac.outdated_release? && - !ENV["HOMEBREW_BUILD_FROM_SOURCE"] && ARGV.none? { |v| v.start_with?("--cc=") } && ENV["HOMEBREW_PREFIX"] == "/usr/local" ISSUES_URL = "https://docs.brew.sh/Troubleshooting".freeze diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb index 8de09648175bdee2a312fb368de2a794e1cc9007..4e144a0a8b7f77180bfe0d77382e332c5af93e11 100644 --- a/Library/Homebrew/software_spec.rb +++ b/Library/Homebrew/software_spec.rb @@ -208,7 +208,7 @@ class SoftwareSpec end def fails_with(compiler, &block) - odeprecated "fails_with :gcc_4_0" if compiler == :gcc_4_0 + odisabled "fails_with :gcc_4_0" if compiler == :gcc_4_0 compiler_failures << CompilerFailure.create(compiler, &block) end diff --git a/Library/Homebrew/test/cmd/upgrade_spec.rb b/Library/Homebrew/test/cmd/upgrade_spec.rb index 83afb0cff1aedc2f1f69fb81572f94c38c60e517..b12a022e779dc268bf529dbec50319eba4f0f1a0 100644 --- a/Library/Homebrew/test/cmd/upgrade_spec.rb +++ b/Library/Homebrew/test/cmd/upgrade_spec.rb @@ -1,19 +1,10 @@ describe "brew upgrade", :integration_test do - it "upgrades a Formula to the latest version" do + it "upgrades a Formula and cleans up old versions" do setup_test_formula "testball" (HOMEBREW_CELLAR/"testball/0.0.1/foo").mkpath expect { brew "upgrade" }.to be_a_success - expect(HOMEBREW_CELLAR/"testball/0.1").to be_a_directory - end - - it "upgrades a Formula and cleans up old versions when `--cleanup` is passed" do - setup_test_formula "testball" - (HOMEBREW_CELLAR/"testball/0.0.1/foo").mkpath - - expect { brew "upgrade", "--cleanup" }.to be_a_success - expect(HOMEBREW_CELLAR/"testball/0.1").to be_a_directory expect(HOMEBREW_CELLAR/"testball/0.0.1").not_to exist end diff --git a/Library/Homebrew/test/diagnostic_checks_spec.rb b/Library/Homebrew/test/diagnostic_checks_spec.rb index 06be59c5c4982262bc4cd0744346d9b902c60966..3f1dbcd44a1cbec4edc5baabc845ed3714161d58 100644 --- a/Library/Homebrew/test/diagnostic_checks_spec.rb +++ b/Library/Homebrew/test/diagnostic_checks_spec.rb @@ -6,12 +6,6 @@ describe Homebrew::Diagnostic::Checks do expect(subject.inject_file_list(%w[/a /b], "foo:\n")).to eq("foo:\n /a\n /b\n") end - specify "#check_build_from_source" do - ENV["HOMEBREW_BUILD_FROM_SOURCE"] = "1" - expect(subject.check_build_from_source) - .to match("You have HOMEBREW_BUILD_FROM_SOURCE set.") - end - specify "#check_for_anaconda" do mktmpdir do |path| anaconda = "#{path}/anaconda" diff --git a/docs/FAQ.md b/docs/FAQ.md index 658cf93725cf91ca7b771088b606e1b09856fa09..e5cb158893ea9dd723da3e28c94f0b1ae7f4fcd8 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -90,8 +90,6 @@ following conditions: will use a bottled version of the formula, but `brew install --enable-bar <formula>` will trigger a source build. * The `--build-from-source` option is invoked. -* The environment variable `HOMEBREW_BUILD_FROM_SOURCE` is set -(intended for developers only). * The machine is not running a supported version of macOS as all bottled builds are generated only for supported macOS versions. * Homebrew is installed to a prefix other than the standard diff --git a/docs/Manpage.md b/docs/Manpage.md index 5076d1957f8218afda36a488988a8bb6a27840e0..2c7117f1a750aa28ab66ed373a0b31bd35af7345 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -269,10 +269,6 @@ these flags should only appear after a command. source even if a bottle is provided. Dependencies will still be installed from bottles if they are available. - If `HOMEBREW_BUILD_FROM_SOURCE` is set, regardless of whether `--build-from-source` was - passed, then both *`formula`* and the dependencies installed as part of this process - are built from source even if bottles are available. - If `--force-bottle` is passed, 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. @@ -424,9 +420,6 @@ these flags should only appear after a command. If `--display-times` is passed, install times for each formula are printed at the end of the run. - If `HOMEBREW_INSTALL_CLEANUP` is set then remove previously installed versions - of upgraded *`formulae`* as well as the HOMEBREW_CACHE for that formula. - * `search`, `-S`: Display all locally available formulae (including tapped ones). No online search is performed. @@ -1185,16 +1178,6 @@ Note that environment variables must have a value set to be detected. For exampl *Default:* the beer emoji. - * `HOMEBREW_INSTALL_CLEANUP`: - If set, `brew install`, `brew upgrade` and `brew reinstall` will remove - previously installed version(s) of the installed/upgraded formulae. - - If `brew cleanup` has not been run in 30 days then it will be run at this - time. - - This will become the default in a later version of Homebrew. To opt-out see - `HOMEBREW_NO_INSTALL_CLEANUP`. - * `HOMEBREW_LOGS`: If set, Homebrew will use the specified directory to store log files. diff --git a/manpages/brew.1 b/manpages/brew.1 index bf59b91d7c136ae229ee0eebfdf75225fca47beb..4aa57bc90ceaf53ce175be65bcf76415ce2ed7fd 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -276,9 +276,6 @@ If \fB\-\-cc=\fR\fIcompiler\fR is passed, attempt to compile using \fIcompiler\f If \fB\-\-build\-from\-source\fR (or \fB\-s\fR) is passed, compile the specified \fIformula\fR from source even if a bottle is provided\. Dependencies will still be installed from bottles if they are available\. . .IP -If \fBHOMEBREW_BUILD_FROM_SOURCE\fR is set, regardless of whether \fB\-\-build\-from\-source\fR was passed, then both \fIformula\fR and the dependencies installed as part of this process are built from source even if bottles are available\. -. -.IP If \fB\-\-force\-bottle\fR is passed, 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\. . .IP @@ -435,9 +432,6 @@ Uninstall and then install \fIformula\fR (with existing install options)\. .IP If \fB\-\-display\-times\fR is passed, install times for each formula are printed at the end of the run\. . -.IP -If \fBHOMEBREW_INSTALL_CLEANUP\fR is set then remove previously installed versions of upgraded \fIformulae\fR as well as the HOMEBREW_CACHE for that formula\. -. .TP \fBsearch\fR, \fB\-S\fR Display all locally available formulae (including tapped ones)\. No online search is performed\. @@ -1312,16 +1306,6 @@ Text printed before the installation summary of each successful build\. \fIDefault:\fR the beer emoji\. . .TP -\fBHOMEBREW_INSTALL_CLEANUP\fR -If set, \fBbrew install\fR, \fBbrew upgrade\fR and \fBbrew reinstall\fR will remove previously installed version(s) of the installed/upgraded formulae\. -. -.IP -If \fBbrew cleanup\fR has not been run in 30 days then it will be run at this time\. -. -.IP -This will become the default in a later version of Homebrew\. To opt\-out see \fBHOMEBREW_NO_INSTALL_CLEANUP\fR\. -. -.TP \fBHOMEBREW_LOGS\fR If set, Homebrew will use the specified directory to store log files\. .