From e2759fbdff4e9b5e8795cbc28ef4dcd04c0ee2ef Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Mon, 5 Sep 2022 13:57:22 +0100 Subject: [PATCH] Deprecate reading all formulae through commands We added the `--all` flag (now renamed to `--eval-all`) for various commands for this behaviour so let's start deprecating this. Also, introduce a `HOMEBREW_EVAL_ALL` environment variable to use the existing, less secure, behaviour by default and avoid passing `--eval-all` everywhere. --- .github/workflows/tests.yml | 6 +- Library/Homebrew/cask/cask.rb | 5 ++ Library/Homebrew/cli/args.rbi | 3 + Library/Homebrew/cmd/deps.rb | 17 ++++- Library/Homebrew/cmd/desc.rb | 10 ++- Library/Homebrew/cmd/info.rb | 27 +++++--- Library/Homebrew/cmd/options.rb | 11 ++- Library/Homebrew/cmd/readall.rb | 7 ++ Library/Homebrew/cmd/search.rb | 7 ++ Library/Homebrew/cmd/tap.rb | 6 +- Library/Homebrew/cmd/uses.rb | 20 ++++-- Library/Homebrew/description_cache_store.rb | 8 ++- Library/Homebrew/dev-cmd/audit.rb | 12 ++-- Library/Homebrew/dev-cmd/bump-formula-pr.rb | 31 +-------- Library/Homebrew/dev-cmd/livecheck.rb | 20 ++++-- Library/Homebrew/dev-cmd/typecheck.rb | 9 ++- Library/Homebrew/dev-cmd/unbottled.rb | 36 ++++++---- Library/Homebrew/env_config.rb | 5 ++ Library/Homebrew/extend/os/linux/readall.rb | 4 +- Library/Homebrew/formula.rb | 5 +- Library/Homebrew/readall.rb | 2 +- .../sorbet/rbi/hidden-definitions/hidden.rbi | 2 + Library/Homebrew/tap.rb | 8 +-- Library/Homebrew/test/cmd/desc_spec.rb | 2 +- Library/Homebrew/test/cmd/uses_spec.rb | 2 +- .../test/description_cache_store_spec.rb | 2 + completions/bash/brew | 26 ++++--- completions/fish/brew.fish | 38 +++++++---- completions/zsh/_brew | 46 +++++++------ docs/Manpage.md | 54 +++++++++------ manpages/brew.1 | 68 ++++++++++++++----- 31 files changed, 329 insertions(+), 170 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0bc3616251..ab09dcac66 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -82,13 +82,13 @@ jobs: brew update-test --commit=HEAD - name: Run brew readall on all taps - run: brew readall --aliases + run: brew readall --eval-all --aliases - name: Run brew style on homebrew-core for Linux run: brew style --display-cop-names homebrew/core - name: Run brew audit --skip-style on all taps - run: brew audit --skip-style --except=version --display-failures-only + run: brew audit --eval-all --skip-style --except=version --display-failures-only - name: Set up all Homebrew taps run: | @@ -301,7 +301,7 @@ jobs: Library/Taps/homebrew/homebrew-services - name: Run brew readall on all taps - run: brew readall --aliases + run: brew readall --eval-all --aliases - name: Install brew tests dependencies run: brew install subversion curl diff --git a/Library/Homebrew/cask/cask.rb b/Library/Homebrew/cask/cask.rb index f46ba38e86..9775e80bd8 100644 --- a/Library/Homebrew/cask/cask.rb +++ b/Library/Homebrew/cask/cask.rb @@ -24,6 +24,11 @@ module Cask attr_accessor :download, :allow_reassignment def self.all + # TODO: uncomment for 3.7.0 and ideally avoid using ARGV by moving to e.g. CLI::Parser + # if !ARGV.include?("--eval-all") && !Homebrew::EnvConfig.eval_all? + # odeprecated "Cask::Cask#all without --all or HOMEBREW_EVAL_ALL" + # end + Tap.flat_map(&:cask_files).map do |f| CaskLoader::FromTapPathLoader.new(f).load(config: nil) rescue CaskUnreadableError => e diff --git a/Library/Homebrew/cli/args.rbi b/Library/Homebrew/cli/args.rbi index 6f7aa4e421..39bb3768e7 100644 --- a/Library/Homebrew/cli/args.rbi +++ b/Library/Homebrew/cli/args.rbi @@ -132,6 +132,9 @@ module Homebrew sig { returns(T::Boolean) } def all?; end + sig { returns(T::Boolean) } + def eval_all?; end + sig { returns(T::Boolean) } def full?; end diff --git a/Library/Homebrew/cmd/deps.rb b/Library/Homebrew/cmd/deps.rb index ff4a96d25a..541f341e4a 100644 --- a/Library/Homebrew/cmd/deps.rb +++ b/Library/Homebrew/cmd/deps.rb @@ -54,8 +54,11 @@ module Homebrew switch "--installed", description: "List dependencies for formulae that are currently installed. If is " \ "specified, list only its dependencies that are currently installed." + switch "--eval-all", + description: "Evaluate all available formulae and casks, whether installed or not, to list " \ + "their dependencies." switch "--all", - description: "List dependencies for all available formulae." + hidden: true switch "--for-each", description: "Switch into the mode used by the `--all` option, but only list dependencies " \ "for each provided , one formula per line. This is used for " \ @@ -66,6 +69,7 @@ module Homebrew description: "Treat all named arguments as casks." conflicts "--tree", "--graph" + conflicts "--installed", "--eval-all" conflicts "--installed", "--all" conflicts "--formula", "--cask" formula_options @@ -77,6 +81,15 @@ module Homebrew def deps args = deps_args.parse + all = args.eval_all? + if args.all? + unless all + odeprecated "brew deps --all", + "brew deps --eval-all or HOMEBREW_EVAL_ALL" + end + all = true + end + Formulary.enable_factory_cache! recursive = !args.direct? @@ -118,7 +131,7 @@ module Homebrew puts_deps_tree dependents, recursive: recursive, args: args return - elsif args.all? + elsif all puts_deps sorted_dependents(Formula.all + Cask::Cask.all), recursive: recursive, args: args return elsif !args.no_named? && args.for_each? diff --git a/Library/Homebrew/cmd/desc.rb b/Library/Homebrew/cmd/desc.rb index d997619543..19076dc140 100644 --- a/Library/Homebrew/cmd/desc.rb +++ b/Library/Homebrew/cmd/desc.rb @@ -18,8 +18,7 @@ module Homebrew Homebrew::CLI::Parser.new do description <<~EOS Display 's name and one-line description. - Formula descriptions are cached; the cache is created on the - first search, making that search slower than subsequent ones. + The cache is created on the first search, making that search slower than subsequent ones. EOS switch "-s", "--search", description: "Search both names and descriptions for . If is flanked by " \ @@ -30,6 +29,9 @@ module Homebrew switch "-d", "--description", description: "Search just descriptions for . If is flanked by slashes, " \ "it is interpreted as a regular expression." + switch "--eval-all", + description: "Evaluate all available formulae and casks, whether installed or not, to search their " \ + "descriptions. Implied if HOMEBREW_EVAL_ALL is set." switch "--formula", "--formulae", description: "Treat all named arguments as formulae." switch "--cask", "--casks", @@ -44,6 +46,10 @@ module Homebrew def desc args = desc_args.parse + if !args.eval_all? && !Homebrew::EnvConfig.eval_all? + odeprecated "brew desc", "brew desc --eval-all or HOMEBREW_EVAL_ALL" + end + search_type = if args.search? :either elsif args.name? diff --git a/Library/Homebrew/cmd/info.rb b/Library/Homebrew/cmd/info.rb index ba91a20fd0..9495fde636 100644 --- a/Library/Homebrew/cmd/info.rb +++ b/Library/Homebrew/cmd/info.rb @@ -58,9 +58,13 @@ module Homebrew switch "--installed", depends_on: "--json", description: "Print JSON of formulae that are currently installed." - switch "--all", + switch "--eval-all", depends_on: "--json", - description: "Print JSON of all available formulae." + description: "Evaluate all available formulae and casks, whether installed or not, to print their " \ + "JSON. Implied if HOMEBREW_EVAL_ALL is set." + switch "--all", + hidden: true, + depends_on: "--json" switch "--variations", depends_on: "--json", description: "Include the variations hash in each formula's JSON output." @@ -71,6 +75,7 @@ module Homebrew switch "--cask", "--casks", description: "Treat all named arguments as casks." + conflicts "--installed", "--eval-all" conflicts "--installed", "--all" conflicts "--formula", "--cask" @@ -103,7 +108,13 @@ module Homebrew print_analytics(args: args) elsif args.json - print_json(args: args) + all = args.eval_all? + if !all && args.all? && !Homebrew::EnvConfig.eval_all? + odeprecated "brew info --all", "brew info --eval-all or HOMEBREW_EVAL_ALL" + all = true + end + + print_json(all, args: args) elsif args.github? raise FormulaOrCaskUnspecifiedError if args.no_named? @@ -187,15 +198,15 @@ module Homebrew version_hash[version] end - sig { params(args: CLI::Args).void } - def print_json(args:) - raise FormulaOrCaskUnspecifiedError if !(args.all? || args.installed?) && args.no_named? + sig { params(all: T::Boolean, args: CLI::Args).void } + def print_json(all, args:) + raise FormulaOrCaskUnspecifiedError if !(all || args.installed?) && args.no_named? json = case json_version(args.json) when :v1, :default raise UsageError, "cannot specify --cask with --json=v1!" if args.cask? - formulae = if args.all? + formulae = if all Formula.all.sort elsif args.installed? Formula.installed.sort @@ -211,7 +222,7 @@ module Homebrew formulae.map(&:to_hash) end when :v2 - formulae, casks = if args.all? + formulae, casks = if all [Formula.all.sort, Cask::Cask.all.sort_by(&:full_name)] elsif args.installed? [Formula.installed.sort, Cask::Caskroom.casks.sort_by(&:full_name)] diff --git a/Library/Homebrew/cmd/options.rb b/Library/Homebrew/cmd/options.rb index c97d57d528..4b80fa5ad5 100644 --- a/Library/Homebrew/cmd/options.rb +++ b/Library/Homebrew/cmd/options.rb @@ -19,8 +19,11 @@ module Homebrew description: "Show all options on a single line separated by spaces." switch "--installed", description: "Show options for formulae that are currently installed." + switch "--eval-all", + description: "Evaluate all available formulae and casks, whether installed or not, to show their " \ + "options." switch "--all", - description: "Show options for all available formulae." + hidden: true flag "--command=", description: "Show options for the specified ." @@ -33,7 +36,13 @@ module Homebrew def options args = options_args.parse + all = args.eval_all? if args.all? + odeprecated "brew info --all", "brew info --eval-all" if !all && !Homebrew::EnvConfig.eval_all? + all = true + end + + if all puts_options Formula.all.sort, args: args elsif args.installed? puts_options Formula.installed.sort, args: args diff --git a/Library/Homebrew/cmd/readall.rb b/Library/Homebrew/cmd/readall.rb index 7c64d8eb09..6413166dda 100644 --- a/Library/Homebrew/cmd/readall.rb +++ b/Library/Homebrew/cmd/readall.rb @@ -3,6 +3,7 @@ require "readall" require "cli/parser" +require "env_config" module Homebrew extend T::Sig @@ -22,6 +23,9 @@ module Homebrew description: "Verify any alias symlinks in each tap." switch "--syntax", description: "Syntax-check all of Homebrew's Ruby files (if no `` is passed)." + switch "--eval-all", + description: "Evaluate all available formulae and casks, whether installed or not. " \ + "Implied if HOMEBREW_EVAL_ALL is set." named_args :tap end @@ -39,6 +43,9 @@ module Homebrew options = { aliases: args.aliases? } taps = if args.no_named? + if !args.eval_all? && !Homebrew::EnvConfig.eval_all? + odeprecated "brew readall", "brew readall --eval-all or HOMEBREW_EVAL_ALL" + end Tap else args.named.to_installed_taps diff --git a/Library/Homebrew/cmd/search.rb b/Library/Homebrew/cmd/search.rb index c0a7a20f99..962a33ea12 100644 --- a/Library/Homebrew/cmd/search.rb +++ b/Library/Homebrew/cmd/search.rb @@ -44,6 +44,10 @@ module Homebrew switch "--desc", description: "Search for formulae with a description matching and casks with " \ "a name or description matching ." + switch "--eval-all", + depends_on: "--desc", + description: "Evaluate all available formulae and casks, whether installed or not, to search their " \ + "descriptions. Implied if HOMEBREW_EVAL_ALL is set." switch "--pull-request", description: "Search for GitHub pull requests containing ." switch "--open", @@ -75,6 +79,9 @@ module Homebrew string_or_regex = query_regexp(query) if args.desc? + if !args.eval_all? && !Homebrew::EnvConfig.eval_all? + odeprecated "brew search --desc", "brew search --desc --eval-all or HOMEBREW_EVAL_ALL" + end search_descriptions(string_or_regex, args) elsif args.pull_request? search_pull_requests(query, args) diff --git a/Library/Homebrew/cmd/tap.rb b/Library/Homebrew/cmd/tap.rb index 019d70c8d3..7eed84b689 100644 --- a/Library/Homebrew/cmd/tap.rb +++ b/Library/Homebrew/cmd/tap.rb @@ -43,6 +43,9 @@ module Homebrew description: "Migrate tapped formulae from symlink-based to directory-based structure." switch "--list-pinned", description: "List all pinned taps." + switch "--eval-all", + description: "Evaluate all the formulae, casks and aliases in the new tap to check validity. " \ + "Implied if HOMEBREW_EVAL_ALL is set." named_args :tap, max: 2 end @@ -65,7 +68,8 @@ module Homebrew tap.install clone_target: args.named.second, force_auto_update: args.force_auto_update?, custom_remote: args.custom_remote?, - quiet: args.quiet? + quiet: args.quiet?, + verify: args.eval_all? || Homebrew::EnvConfig.eval_all? rescue TapRemoteMismatchError, TapNoCustomRemoteError => e odie e rescue TapAlreadyTappedError diff --git a/Library/Homebrew/cmd/uses.rb b/Library/Homebrew/cmd/uses.rb index d5cf623617..c194823d44 100644 --- a/Library/Homebrew/cmd/uses.rb +++ b/Library/Homebrew/cmd/uses.rb @@ -30,9 +30,11 @@ module Homebrew description: "Resolve more than one level of dependencies." switch "--installed", description: "Only list formulae and casks that are currently installed." + switch "--eval-all", + description: "Evaluate all available formulae and casks, whether installed or not, to show " \ + "their dependents." switch "--all", - description: "List all formulae and casks whether installed or not.", - hidden: true + hidden: true switch "--include-build", description: "Include all formulae that specify as `:build` type dependency." switch "--include-test", @@ -88,8 +90,6 @@ module Homebrew show_formulae_and_casks = !args.formula? && !args.cask? includes, ignores = args_includes_ignores(args) - # TODO: 3.6.0: odeprecate not specifying args.all?, require args.installed? - deps = [] if use_runtime_dependents if show_formulae_and_casks || args.formula? @@ -106,6 +106,18 @@ module Homebrew deps else + all = args.eval_all? + if args.all? + unless all + odeprecated "brew uses --all", + "brew uses --eval-all or HOMEBREW_EVAL_ALL" + end + all = true + end + + if !args.installed? && !(all || Homebrew::EnvConfig.eval_all?) + odeprecated "brew uses", "brew uses --eval-all or HOMEBREW_EVAL_ALL" + end if show_formulae_and_casks || args.formula? deps += args.installed? ? Formula.installed : Formula.all end diff --git a/Library/Homebrew/description_cache_store.rb b/Library/Homebrew/description_cache_store.rb index d94885cbe3..e43f88e1ba 100644 --- a/Library/Homebrew/description_cache_store.rb +++ b/Library/Homebrew/description_cache_store.rb @@ -34,9 +34,9 @@ class DescriptionCacheStore < CacheStore # # @return [nil] def populate_if_empty! + return unless Homebrew::EnvConfig.eval_all? return unless database.empty? - # TODO: 3.6.0: consider if we want to actually read all contents of all formulae or odeprecate. Formula.all.each { |f| update!(f.full_name, f.desc) } end @@ -45,6 +45,7 @@ class DescriptionCacheStore < CacheStore # @param report [Report] an update report generated by cmd/update.rb # @return [nil] def update_from_report!(report) + return unless Homebrew::EnvConfig.eval_all? return populate_if_empty! if database.empty? return if report.empty? @@ -63,6 +64,7 @@ class DescriptionCacheStore < CacheStore # @param formula_names [Array] the formulae to update # @return [nil] def update_from_formula_names!(formula_names) + return unless Homebrew::EnvConfig.eval_all? return populate_if_empty! if database.empty? formula_names.each do |name| @@ -100,9 +102,9 @@ class CaskDescriptionCacheStore < DescriptionCacheStore # # @return [nil] def populate_if_empty! + return unless Homebrew::EnvConfig.eval_all? return unless database.empty? - # TODO: 3.6.0: consider if we want to actually read all contents of all casks or odeprecate. Cask::Cask.all.each { |c| update!(c.full_name, [c.name.join(", "), c.desc.presence]) } end @@ -111,6 +113,7 @@ class CaskDescriptionCacheStore < DescriptionCacheStore # @param report [Report] an update report generated by cmd/update.rb # @return [nil] def update_from_report!(report) + return unless Homebrew::EnvConfig.eval_all? return populate_if_empty! if database.empty? return if report.empty? @@ -126,6 +129,7 @@ class CaskDescriptionCacheStore < DescriptionCacheStore # @param cask_tokens [Array] the casks to update # @return [nil] def update_from_cask_tokens!(cask_tokens) + return unless Homebrew::EnvConfig.eval_all? return populate_if_empty! if database.empty? cask_tokens.each do |token| diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index 082e9c01e9..8167e8df0e 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -41,9 +41,11 @@ module Homebrew description: "Run additional, slower style checks that require a network connection." switch "--installed", description: "Only check formulae and casks that are currently installed." + switch "--eval-all", + description: "Evaluate all available formulae and casks, whether installed or not, to audit them. " \ + "Implied if HOMEBREW_EVAL_ALL is set." switch "--all", - description: "Check all formulae and casks whether installed or not.", - hidden: true + hidden: true switch "--new", "--new-formula", "--new-cask", description: "Run various additional style checks to determine if a new formula or cask is eligible " \ "for Homebrew. This should be used when creating new formula and implies " \ @@ -118,8 +120,6 @@ module Homebrew ENV.activate_extensions! ENV.setup_build_environment - # TODO: 3.6.0: odeprecate not specifying args.all?, require args.installed? - audit_formulae, audit_casks = if args.tap Tap.fetch(args.tap).then do |tap| [ @@ -131,6 +131,10 @@ module Homebrew no_named_args = true [Formula.installed, Cask::Caskroom.casks] elsif args.no_named? + if !args.eval_all? && !Homebrew::EnvConfig.eval_all? + odeprecated "brew audit", + "brew audit --eval-all or HOMEBREW_EVAL_ALL" + end no_named_args = true [Formula.all, Cask::Cask.all] else diff --git a/Library/Homebrew/dev-cmd/bump-formula-pr.rb b/Library/Homebrew/dev-cmd/bump-formula-pr.rb index b7715ba306..f4bcff17db 100644 --- a/Library/Homebrew/dev-cmd/bump-formula-pr.rb +++ b/Library/Homebrew/dev-cmd/bump-formula-pr.rb @@ -18,8 +18,8 @@ module Homebrew Create a pull request to update with a new URL or a new tag. If a is specified, the checksum of the new download should also - be specified. A best effort to determine the and name will - be made if either or both values are not supplied by the user. + be specified. A best effort to determine the will be made if not supplied + by the user. If a is specified, the Git commit corresponding to that tag should also be specified. A best effort to determine the will be made @@ -34,9 +34,6 @@ module Homebrew EOS switch "-n", "--dry-run", description: "Print what would be done rather than doing it." - switch "--all", - description: "Read all formulae if necessary to determine URL.", - hidden: true switch "--write-only", description: "Make the expected file modifications without taking any Git actions." switch "--commit", @@ -89,7 +86,6 @@ module Homebrew conflicts "--no-audit", "--strict" conflicts "--no-audit", "--online" conflicts "--url", "--tag" - conflicts "--installed", "--all" named_args :formula, max: 1 end @@ -110,9 +106,7 @@ module Homebrew ENV["BROWSER"] = Homebrew::EnvConfig.browser formula = args.named.to_formulae.first - new_url = args.url - formula ||= determine_formula_from_url(new_url) if new_url.present? raise FormulaUnspecifiedError if formula.blank? odie "This formula is disabled!" if formula.disabled? @@ -368,27 +362,6 @@ module Homebrew GitHub.create_bump_pr(pr_info, args: args) end - def determine_formula_from_url(url) - # Split the new URL on / and find any formulae that have the same URL - # except for the last component, but don't try to match any more than the - # first five components since sometimes the last component isn't the only - # one to change. - url_split = url.split("/") - maximum_url_components_to_match = 5 - components_to_match = [url_split.count - 1, maximum_url_components_to_match].min - base_url = url_split.first(components_to_match).join("/") - base_url = /#{Regexp.escape(base_url)}/ - guesses = [] - # TODO: 3.6.0: odeprecate not specifying args.all? - Formula.all.each do |f| - guesses << f if f.stable&.url&.match(base_url) - end - return guesses.shift if guesses.count == 1 - return if guesses.count <= 1 - - odie "Couldn't guess formula for sure; could be one of these:\n#{guesses.map(&:name).join(", ")}" - end - def determine_mirror(url) case url when %r{.*ftp\.gnu\.org/gnu.*} diff --git a/Library/Homebrew/dev-cmd/livecheck.rb b/Library/Homebrew/dev-cmd/livecheck.rb index 0028cc83aa..bd65c29f6a 100644 --- a/Library/Homebrew/dev-cmd/livecheck.rb +++ b/Library/Homebrew/dev-cmd/livecheck.rb @@ -24,13 +24,15 @@ module Homebrew `~/.brew_livecheck_watchlist`. EOS switch "--full-name", - description: "Print formulae/casks with fully-qualified names." + description: "Print formulae and casks with fully-qualified names." flag "--tap=", - description: "Check formulae/casks within the given tap, specified as `/`." + description: "Check formulae and casks within the given tap, specified as `/`." + switch "--eval-all", + description: "Evaluate all available formulae and casks, whether installed or not, to check them." switch "--all", - description: "Check all available formulae/casks." + hidden: true switch "--installed", - description: "Check formulae/casks that are currently installed." + description: "Check formulae and casks that are currently installed." switch "--newer-only", description: "Show the latest version only if it's newer than the formula/cask." switch "--json", @@ -43,7 +45,7 @@ module Homebrew description: "Only check casks." conflicts "--debug", "--json" - conflicts "--tap=", "--all", "--installed" + conflicts "--tap=", "--eval-all", "--installed" conflicts "--cask", "--formula" named_args [:formula, :cask] @@ -53,6 +55,12 @@ module Homebrew def livecheck args = livecheck_args.parse + all = args.eval_all? + if args.all? + odeprecated "brew livecheck --all", "brew livecheck --eval-all" if !all && !Homebrew::EnvConfig.eval_all? + all = true + end + if args.debug? && args.verbose? puts args puts Homebrew::EnvConfig.livecheck_watchlist if Homebrew::EnvConfig.livecheck_watchlist.present? @@ -67,7 +75,7 @@ module Homebrew formulae = args.cask? ? [] : Formula.installed casks = args.formula? ? [] : Cask::Caskroom.casks formulae + casks - elsif args.all? + elsif all formulae = args.cask? ? [] : Formula.all casks = args.formula? ? [] : Cask::Cask.all formulae + casks diff --git a/Library/Homebrew/dev-cmd/typecheck.rb b/Library/Homebrew/dev-cmd/typecheck.rb index 53b10488a8..f8fa8101c3 100644 --- a/Library/Homebrew/dev-cmd/typecheck.rb +++ b/Library/Homebrew/dev-cmd/typecheck.rb @@ -20,9 +20,8 @@ module Homebrew description: "Silence all non-critical errors." switch "--update", description: "Update RBI files." - switch "--all", - depends_on: "--update", - description: "Regenerate all RBI files rather than just updated gems." + switch "--update-all", + description: "Update all RBI files rather than just updated gems." switch "--suggest-typed", depends_on: "--update", description: "Try upgrading `typed` sigils." @@ -51,7 +50,7 @@ module Homebrew Homebrew.install_bundler_gems!(groups: ["sorbet"]) HOMEBREW_LIBRARY_PATH.cd do - if args.update? + if args.update? || args.update_all? odeprecated "brew typecheck --update --fail-if-not-changed" if args.fail_if_not_changed? excluded_gems = [ @@ -63,7 +62,7 @@ module Homebrew "msgpack:false", # Investigate removing this with Tapioca 0.8 ] tapioca_args = ["--exclude", *excluded_gems, "--typed-overrides", *typed_overrides] - tapioca_args << "--all" if args.all? + tapioca_args << "--all" if args.update_all? ohai "Updating Tapioca RBI files..." safe_system "bundle", "exec", "tapioca", "gem", *tapioca_args diff --git a/Library/Homebrew/dev-cmd/unbottled.rb b/Library/Homebrew/dev-cmd/unbottled.rb index 1880498277..5d8d2bbf96 100644 --- a/Library/Homebrew/dev-cmd/unbottled.rb +++ b/Library/Homebrew/dev-cmd/unbottled.rb @@ -20,11 +20,13 @@ module Homebrew description: "Use the specified bottle tag (e.g. `big_sur`) instead of the current OS." switch "--dependents", description: "Skip getting analytics data and sort by number of dependents instead." - switch "--all", "--total", + switch "--total", description: "Print the number of unbottled and total formulae." + switch "--eval-all", + description: "Evaluate all available formulae and casks, whether installed or not, to check them. " \ + "Implied if HOMEBREW_EVAL_ALL is set." - conflicts "--dependents", "--all" - conflicts "--installed", "--all" + conflicts "--dependents", "--total" named_args :formula end @@ -42,16 +44,22 @@ module Homebrew Utils::Bottles.tag end - # TODO: 3.6.0: odeprecate args.total? + all = args.eval_all? + if args.total? + if !all && !Homebrew::EnvConfig.eval_all? + odeprecated "brew unbottled --total", "brew unbottled --total --eval-all or HOMEBREW_EVAL_ALL" + end + all = true + end if args.named.blank? ohai "Getting formulae..." - elsif args.all? - raise UsageError, "cannot specify `` and `--all`/`--total`." + elsif all + raise UsageError, "cannot specify `` and `--eval-all`/`--total`." end formulae, all_formulae, formula_installs = - formulae_all_installs_from_args(args) + formulae_all_installs_from_args(args, all) deps_hash, uses_hash = deps_uses_from_formulae(all_formulae) if args.dependents? @@ -60,9 +68,7 @@ module Homebrew dependents = uses_hash[f.name]&.length || 0 formula_dependents[f.name] ||= dependents end.reverse - end - - if args.all? + elsif all output_total(formulae) return end @@ -78,16 +84,18 @@ module Homebrew output_unbottled(formulae, deps_hash, noun, hash, args.named.present?) end - def formulae_all_installs_from_args(args) + def formulae_all_installs_from_args(args, all) if args.named.present? formulae = all_formulae = args.named.to_formulae - elsif args.all? - formulae = all_formulae = Formula.all elsif args.dependents? - # TODO: 3.6.0: odeprecate not specifying args.all? for args.dependents? + if !args.all? && !Homebrew::EnvConfig.eval_all? + odeprecated "brew unbottled --dependents", "brew unbottled --all --dependents or HOMEBREW_EVAL_ALL" + end formulae = all_formulae = Formula.all @sort = " (sorted by number of dependents)" + elsif all + formulae = all_formulae = Formula.all else formula_installs = {} diff --git a/Library/Homebrew/env_config.rb b/Library/Homebrew/env_config.rb index 014b24d27d..0d637caa45 100644 --- a/Library/Homebrew/env_config.rb +++ b/Library/Homebrew/env_config.rb @@ -153,6 +153,11 @@ module Homebrew "editors will do strange things in this case.", default_text: "`$EDITOR` or `$VISUAL`.", }, + HOMEBREW_EVAL_ALL: { + description: "If set, `brew` commands evaluate all formulae and casks, executing their arbitrary code, by " \ + "default without requiring --eval-all. Required to cache formula and cask descriptions.", + boolean: true, + }, HOMEBREW_FAIL_LOG_LINES: { description: "Output this many lines of output on formula `system` failures.", default: 15, diff --git a/Library/Homebrew/extend/os/linux/readall.rb b/Library/Homebrew/extend/os/linux/readall.rb index 62c2353250..891761f26e 100644 --- a/Library/Homebrew/extend/os/linux/readall.rb +++ b/Library/Homebrew/extend/os/linux/readall.rb @@ -1,9 +1,9 @@ -# typed: strict +# typed: true # frozen_string_literal: true module Readall class << self - def valid_casks?(*) + def valid_casks?(_casks) true end end diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index f7b7ae033f..269e689c76 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -1806,7 +1806,10 @@ class Formula # this should only be used when users specify `--all` to a command # @private def self.all - # TODO: 3.6.0: consider checking ARGV for --all + # TODO: uncomment for 3.7.0 and ideally avoid using ARGV by moving to e.g. CLI::Parser + # if !ARGV.include?("--eval-all") && !Homebrew::EnvConfig.eval_all? + # odeprecated "Formula#all without --all or HOMEBREW_EVAL_ALL" + # end files.map do |file| Formulary.factory(file) diff --git a/Library/Homebrew/readall.rb b/Library/Homebrew/readall.rb index 47d493d848..c61f0c2027 100644 --- a/Library/Homebrew/readall.rb +++ b/Library/Homebrew/readall.rb @@ -1,4 +1,4 @@ -# typed: false +# typed: true # frozen_string_literal: true require "formula" diff --git a/Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi b/Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi index f22b19bd3a..73a73d0cd9 100644 --- a/Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi +++ b/Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi @@ -2574,6 +2574,8 @@ module Homebrew::EnvConfig def self.temp(); end + def self.eval_all?(); end + def self.update_report_all_formulae?(); end def self.update_to_tag?(); end diff --git a/Library/Homebrew/tap.rb b/Library/Homebrew/tap.rb index 545e0537aa..452c136aca 100644 --- a/Library/Homebrew/tap.rb +++ b/Library/Homebrew/tap.rb @@ -245,7 +245,8 @@ class Tap # logic that skips non-GitHub repositories during auto-updates. # @param quiet [Boolean] If set, suppress all output. # @param custom_remote [Boolean] If set, change the tap's remote if already installed. - def install(quiet: false, clone_target: nil, force_auto_update: nil, custom_remote: false) + # @param verify [Boolean] If set, verify all the formula, casks and aliases in the tap are valid. + def install(quiet: false, clone_target: nil, force_auto_update: nil, custom_remote: false, verify: false) require "descriptions" require "readall" @@ -306,9 +307,8 @@ class Tap begin safe_system "git", *args - # TODO: 3.6.0: consider if we want to actually read all contents of tap or odeprecate. - if !Readall.valid_tap?(self, aliases: true) && !Homebrew::EnvConfig.developer? + if verify && !Readall.valid_tap?(self, aliases: true) && !Homebrew::EnvConfig.developer? raise "Cannot tap #{name}: invalid syntax in tap!" end rescue Interrupt, RuntimeError @@ -807,7 +807,7 @@ class CoreTap < Tap end # CoreTap never allows shallow clones (on request from GitHub). - def install(quiet: false, clone_target: nil, force_auto_update: nil, custom_remote: false) + def install(quiet: false, clone_target: nil, force_auto_update: nil, custom_remote: false, verify: false) remote = Homebrew::EnvConfig.core_git_remote # set by HOMEBREW_CORE_GIT_REMOTE requested_remote = clone_target || remote diff --git a/Library/Homebrew/test/cmd/desc_spec.rb b/Library/Homebrew/test/cmd/desc_spec.rb index efb364b17b..bbc35d702c 100644 --- a/Library/Homebrew/test/cmd/desc_spec.rb +++ b/Library/Homebrew/test/cmd/desc_spec.rb @@ -9,7 +9,7 @@ describe "brew desc" do it "shows a given Formula's description", :integration_test do setup_test_formula "testball" - expect { brew "desc", "testball" } + expect { brew "desc", "--eval-all", "testball" } .to output("testball: Some test\n").to_stdout .and not_to_output.to_stderr .and be_a_success diff --git a/Library/Homebrew/test/cmd/uses_spec.rb b/Library/Homebrew/test/cmd/uses_spec.rb index c0526538a9..7ba3786342 100644 --- a/Library/Homebrew/test/cmd/uses_spec.rb +++ b/Library/Homebrew/test/cmd/uses_spec.rb @@ -14,7 +14,7 @@ describe "brew uses" do depends_on "bar" RUBY - expect { brew "uses", "--recursive", "foo" } + expect { brew "uses", "--eval-all", "--recursive", "foo" } .to output(/(bar\nbaz|baz\nbar)/).to_stdout .and not_to_output.to_stderr .and be_a_success diff --git a/Library/Homebrew/test/description_cache_store_spec.rb b/Library/Homebrew/test/description_cache_store_spec.rb index bff74dfa29..c82649d954 100644 --- a/Library/Homebrew/test/description_cache_store_spec.rb +++ b/Library/Homebrew/test/description_cache_store_spec.rb @@ -10,6 +10,8 @@ describe DescriptionCacheStore do let(:formula_name) { "test_name" } let(:description) { "test_description" } + before { allow(Homebrew::EnvConfig).to receive(:eval_all?).and_return(true) } + describe "#update!" do it "sets the formula description" do expect(database).to receive(:set).with(formula_name, description) diff --git a/completions/bash/brew b/completions/bash/brew index aa964a0711..34ba987107 100644 --- a/completions/bash/brew +++ b/completions/bash/brew @@ -276,6 +276,7 @@ _brew__s() { --debian --debug --desc + --eval-all --fedora --fink --formula @@ -300,12 +301,12 @@ _brew_abv() { case "${cur}" in -*) __brewcomp " - --all --analytics --cask --category --days --debug + --eval-all --formula --github --help @@ -352,6 +353,7 @@ _brew_audit() { --display-cop-names --display-failures-only --display-filename + --eval-all --except --except-cops --fix @@ -728,12 +730,12 @@ _brew_deps() { case "${cur}" in -*) __brewcomp " - --all --annotate --cask --debug --direct --dot + --eval-all --for-each --formula --full-name @@ -767,6 +769,7 @@ _brew_desc() { --cask --debug --description + --eval-all --formula --help --name @@ -1051,12 +1054,12 @@ _brew_info() { case "${cur}" in -*) __brewcomp " - --all --analytics --cask --category --days --debug + --eval-all --formula --github --help @@ -1232,9 +1235,9 @@ _brew_lc() { case "${cur}" in -*) __brewcomp " - --all --cask --debug + --eval-all --formula --full-name --help @@ -1346,9 +1349,9 @@ _brew_livecheck() { case "${cur}" in -*) __brewcomp " - --all --cask --debug + --eval-all --formula --full-name --help @@ -1483,10 +1486,10 @@ _brew_options() { case "${cur}" in -*) __brewcomp " - --all --command --compact --debug + --eval-all --help --installed --quiet @@ -1685,6 +1688,7 @@ _brew_readall() { __brewcomp " --aliases --debug + --eval-all --help --quiet --syntax @@ -1841,6 +1845,7 @@ _brew_search() { --debian --debug --desc + --eval-all --fedora --fink --formula @@ -1913,6 +1918,7 @@ _brew_tap() { __brewcomp " --custom-remote --debug + --eval-all --force-auto-update --help --list-pinned @@ -1973,7 +1979,6 @@ _brew_tc() { case "${cur}" in -*) __brewcomp " - --all --debug --dir --file @@ -1983,6 +1988,7 @@ _brew_tc() { --quiet --suggest-typed --update + --update-all --verbose " return @@ -2041,7 +2047,6 @@ _brew_typecheck() { case "${cur}" in -*) __brewcomp " - --all --debug --dir --file @@ -2051,6 +2056,7 @@ _brew_typecheck() { --quiet --suggest-typed --update + --update-all --verbose " return @@ -2064,12 +2070,13 @@ _brew_unbottled() { case "${cur}" in -*) __brewcomp " - --all --debug --dependents + --eval-all --help --quiet --tag + --total --verbose " return @@ -2408,6 +2415,7 @@ _brew_uses() { __brewcomp " --cask --debug + --eval-all --formula --help --include-build diff --git a/completions/fish/brew.fish b/completions/fish/brew.fish index 4285886c8b..1a0293f845 100644 --- a/completions/fish/brew.fish +++ b/completions/fish/brew.fish @@ -280,6 +280,7 @@ __fish_brew_complete_arg '-S' -l closed -d 'Search for only closed GitHub pull r __fish_brew_complete_arg '-S' -l debian -d 'Search for text in the given database' __fish_brew_complete_arg '-S' -l debug -d 'Display any debugging information' __fish_brew_complete_arg '-S' -l desc -d 'Search for formulae with a description matching text and casks with a name or description matching text' +__fish_brew_complete_arg '-S' -l eval-all -d 'Evaluate all available formulae and casks, whether installed or not, to search their descriptions. Implied if HOMEBREW_EVAL_ALL is set' __fish_brew_complete_arg '-S' -l fedora -d 'Search for text in the given database' __fish_brew_complete_arg '-S' -l fink -d 'Search for text in the given database' __fish_brew_complete_arg '-S' -l formula -d 'Search online and locally for formulae' @@ -295,12 +296,12 @@ __fish_brew_complete_arg '-S' -l verbose -d 'Make some output more verbose' __fish_brew_complete_cmd 'abv' 'Display brief statistics for your Homebrew installation' -__fish_brew_complete_arg 'abv' -l all -d 'Print JSON of all available formulae' __fish_brew_complete_arg 'abv' -l analytics -d 'List global Homebrew analytics data or, if specified, installation and build error data for formula (provided neither `HOMEBREW_NO_ANALYTICS` nor `HOMEBREW_NO_GITHUB_API` are set)' __fish_brew_complete_arg 'abv' -l cask -d 'Treat all named arguments as casks' __fish_brew_complete_arg 'abv' -l category -d 'Which type of analytics data to retrieve. The value for category must be `install`, `install-on-request` or `build-error`; `cask-install` or `os-version` may be specified if formula is not. The default is `install`' __fish_brew_complete_arg 'abv' -l days -d 'How many days of analytics data to retrieve. The value for days must be `30`, `90` or `365`. The default is `30`' __fish_brew_complete_arg 'abv' -l debug -d 'Display any debugging information' +__fish_brew_complete_arg 'abv' -l eval-all -d 'Evaluate all available formulae and casks, whether installed or not, to print their JSON. Implied if HOMEBREW_EVAL_ALL is set' __fish_brew_complete_arg 'abv' -l formula -d 'Treat all named arguments as formulae' __fish_brew_complete_arg 'abv' -l github -d 'Open the GitHub source page for formula and cask in a browser. To view the history locally: `brew log -p` formula or cask' __fish_brew_complete_arg 'abv' -l help -d 'Show this message' @@ -332,6 +333,7 @@ __fish_brew_complete_arg 'audit' -l debug -d 'Display any debugging information' __fish_brew_complete_arg 'audit' -l display-cop-names -d 'Include the RuboCop cop name for each violation in the output' __fish_brew_complete_arg 'audit' -l display-failures-only -d 'Only display casks that fail the audit. This is the default for formulae' __fish_brew_complete_arg 'audit' -l display-filename -d 'Prefix every line of output with the file or formula name being audited, to make output easy to grep' +__fish_brew_complete_arg 'audit' -l eval-all -d 'Evaluate all available formulae and casks, whether installed or not, to audit them. Implied if HOMEBREW_EVAL_ALL is set' __fish_brew_complete_arg 'audit' -l except -d 'Specify a comma-separated method list to skip running the methods named `audit_`method' __fish_brew_complete_arg 'audit' -l except-cops -d 'Specify a comma-separated cops list to skip checking for violations of the listed RuboCop cops' __fish_brew_complete_arg 'audit' -l fix -d 'Fix style violations automatically using RuboCop\'s auto-correct feature' @@ -565,12 +567,12 @@ __fish_brew_complete_arg 'create' -l verbose -d 'Make some output more verbose' __fish_brew_complete_cmd 'deps' 'Show dependencies for formula' -__fish_brew_complete_arg 'deps' -l all -d 'List dependencies for all available formulae' __fish_brew_complete_arg 'deps' -l annotate -d 'Mark any build, test, optional, or recommended dependencies as such in the output' __fish_brew_complete_arg 'deps' -l cask -d 'Treat all named arguments as casks' __fish_brew_complete_arg 'deps' -l debug -d 'Display any debugging information' __fish_brew_complete_arg 'deps' -l direct -d 'Show only the direct dependencies declared in the formula' __fish_brew_complete_arg 'deps' -l dot -d 'Show text-based graph description in DOT format' +__fish_brew_complete_arg 'deps' -l eval-all -d 'Evaluate all available formulae and casks, whether installed or not, to list their dependencies' __fish_brew_complete_arg 'deps' -l for-each -d 'Switch into the mode used by the `--all` option, but only list dependencies for each provided formula, one formula per line. This is used for debugging the `--installed`/`--all` display mode' __fish_brew_complete_arg 'deps' -l formula -d 'Treat all named arguments as formulae' __fish_brew_complete_arg 'deps' -l full-name -d 'List dependencies by their full name' @@ -595,6 +597,7 @@ __fish_brew_complete_cmd 'desc' 'Display formula\'s name and one-line descriptio __fish_brew_complete_arg 'desc' -l cask -d 'Treat all named arguments as casks' __fish_brew_complete_arg 'desc' -l debug -d 'Display any debugging information' __fish_brew_complete_arg 'desc' -l description -d 'Search just descriptions for text. If text is flanked by slashes, it is interpreted as a regular expression' +__fish_brew_complete_arg 'desc' -l eval-all -d 'Evaluate all available formulae and casks, whether installed or not, to search their descriptions. Implied if HOMEBREW_EVAL_ALL is set' __fish_brew_complete_arg 'desc' -l formula -d 'Treat all named arguments as formulae' __fish_brew_complete_arg 'desc' -l help -d 'Show this message' __fish_brew_complete_arg 'desc' -l name -d 'Search just names for text. If text is flanked by slashes, it is interpreted as a regular expression' @@ -755,12 +758,12 @@ __fish_brew_complete_arg 'homepage; and not __fish_seen_argument -l formula -l f __fish_brew_complete_cmd 'info' 'Display brief statistics for your Homebrew installation' -__fish_brew_complete_arg 'info' -l all -d 'Print JSON of all available formulae' __fish_brew_complete_arg 'info' -l analytics -d 'List global Homebrew analytics data or, if specified, installation and build error data for formula (provided neither `HOMEBREW_NO_ANALYTICS` nor `HOMEBREW_NO_GITHUB_API` are set)' __fish_brew_complete_arg 'info' -l cask -d 'Treat all named arguments as casks' __fish_brew_complete_arg 'info' -l category -d 'Which type of analytics data to retrieve. The value for category must be `install`, `install-on-request` or `build-error`; `cask-install` or `os-version` may be specified if formula is not. The default is `install`' __fish_brew_complete_arg 'info' -l days -d 'How many days of analytics data to retrieve. The value for days must be `30`, `90` or `365`. The default is `30`' __fish_brew_complete_arg 'info' -l debug -d 'Display any debugging information' +__fish_brew_complete_arg 'info' -l eval-all -d 'Evaluate all available formulae and casks, whether installed or not, to print their JSON. Implied if HOMEBREW_EVAL_ALL is set' __fish_brew_complete_arg 'info' -l formula -d 'Treat all named arguments as formulae' __fish_brew_complete_arg 'info' -l github -d 'Open the GitHub source page for formula and cask in a browser. To view the history locally: `brew log -p` formula or cask' __fish_brew_complete_arg 'info' -l help -d 'Show this message' @@ -891,17 +894,17 @@ __fish_brew_complete_arg 'irb' -l verbose -d 'Make some output more verbose' __fish_brew_complete_cmd 'lc' 'Check for newer versions of formulae and/or casks from upstream' -__fish_brew_complete_arg 'lc' -l all -d 'Check all available formulae/casks' __fish_brew_complete_arg 'lc' -l cask -d 'Only check casks' __fish_brew_complete_arg 'lc' -l debug -d 'Display any debugging information' +__fish_brew_complete_arg 'lc' -l eval-all -d 'Evaluate all available formulae and casks, whether installed or not, to check them' __fish_brew_complete_arg 'lc' -l formula -d 'Only check formulae' -__fish_brew_complete_arg 'lc' -l full-name -d 'Print formulae/casks with fully-qualified names' +__fish_brew_complete_arg 'lc' -l full-name -d 'Print formulae and casks with fully-qualified names' __fish_brew_complete_arg 'lc' -l help -d 'Show this message' -__fish_brew_complete_arg 'lc' -l installed -d 'Check formulae/casks that are currently installed' +__fish_brew_complete_arg 'lc' -l installed -d 'Check formulae and casks that are currently installed' __fish_brew_complete_arg 'lc' -l json -d 'Output information in JSON format' __fish_brew_complete_arg 'lc' -l newer-only -d 'Show the latest version only if it\'s newer than the formula/cask' __fish_brew_complete_arg 'lc' -l quiet -d 'Suppress warnings, don\'t print a progress bar for JSON output' -__fish_brew_complete_arg 'lc' -l tap -d 'Check formulae/casks within the given tap, specified as user`/`repo' +__fish_brew_complete_arg 'lc' -l tap -d 'Check formulae and casks within the given tap, specified as user`/`repo' __fish_brew_complete_arg 'lc' -l verbose -d 'Make some output more verbose' __fish_brew_complete_arg 'lc; and not __fish_seen_argument -l cask -l casks' -a '(__fish_brew_suggest_formulae_all)' __fish_brew_complete_arg 'lc; and not __fish_seen_argument -l formula -l formulae' -a '(__fish_brew_suggest_casks_all)' @@ -960,17 +963,17 @@ __fish_brew_complete_arg 'list; and not __fish_seen_argument -l formula -l formu __fish_brew_complete_cmd 'livecheck' 'Check for newer versions of formulae and/or casks from upstream' -__fish_brew_complete_arg 'livecheck' -l all -d 'Check all available formulae/casks' __fish_brew_complete_arg 'livecheck' -l cask -d 'Only check casks' __fish_brew_complete_arg 'livecheck' -l debug -d 'Display any debugging information' +__fish_brew_complete_arg 'livecheck' -l eval-all -d 'Evaluate all available formulae and casks, whether installed or not, to check them' __fish_brew_complete_arg 'livecheck' -l formula -d 'Only check formulae' -__fish_brew_complete_arg 'livecheck' -l full-name -d 'Print formulae/casks with fully-qualified names' +__fish_brew_complete_arg 'livecheck' -l full-name -d 'Print formulae and casks with fully-qualified names' __fish_brew_complete_arg 'livecheck' -l help -d 'Show this message' -__fish_brew_complete_arg 'livecheck' -l installed -d 'Check formulae/casks that are currently installed' +__fish_brew_complete_arg 'livecheck' -l installed -d 'Check formulae and casks that are currently installed' __fish_brew_complete_arg 'livecheck' -l json -d 'Output information in JSON format' __fish_brew_complete_arg 'livecheck' -l newer-only -d 'Show the latest version only if it\'s newer than the formula/cask' __fish_brew_complete_arg 'livecheck' -l quiet -d 'Suppress warnings, don\'t print a progress bar for JSON output' -__fish_brew_complete_arg 'livecheck' -l tap -d 'Check formulae/casks within the given tap, specified as user`/`repo' +__fish_brew_complete_arg 'livecheck' -l tap -d 'Check formulae and casks within the given tap, specified as user`/`repo' __fish_brew_complete_arg 'livecheck' -l verbose -d 'Make some output more verbose' __fish_brew_complete_arg 'livecheck; and not __fish_seen_argument -l cask -l casks' -a '(__fish_brew_suggest_formulae_all)' __fish_brew_complete_arg 'livecheck; and not __fish_seen_argument -l formula -l formulae' -a '(__fish_brew_suggest_casks_all)' @@ -1043,10 +1046,10 @@ __fish_brew_complete_arg 'missing' -a '(__fish_brew_suggest_formulae_all)' __fish_brew_complete_cmd 'options' 'Show install options specific to formula' -__fish_brew_complete_arg 'options' -l all -d 'Show options for all available formulae' __fish_brew_complete_arg 'options' -l command -d 'Show options for the specified command' __fish_brew_complete_arg 'options' -l compact -d 'Show all options on a single line separated by spaces' __fish_brew_complete_arg 'options' -l debug -d 'Display any debugging information' +__fish_brew_complete_arg 'options' -l eval-all -d 'Evaluate all available formulae and casks, whether installed or not, to show their options' __fish_brew_complete_arg 'options' -l help -d 'Show this message' __fish_brew_complete_arg 'options' -l installed -d 'Show options for formulae that are currently installed' __fish_brew_complete_arg 'options' -l quiet -d 'Make some output more quiet' @@ -1164,6 +1167,7 @@ __fish_brew_complete_arg 'prof' -a '(__fish_brew_suggest_commands)' __fish_brew_complete_cmd 'readall' 'Import all items from the specified tap, or from all installed taps if none is provided' __fish_brew_complete_arg 'readall' -l aliases -d 'Verify any alias symlinks in each tap' __fish_brew_complete_arg 'readall' -l debug -d 'Display any debugging information' +__fish_brew_complete_arg 'readall' -l eval-all -d 'Evaluate all available formulae and casks, whether installed or not. Implied if HOMEBREW_EVAL_ALL is set' __fish_brew_complete_arg 'readall' -l help -d 'Show this message' __fish_brew_complete_arg 'readall' -l quiet -d 'Make some output more quiet' __fish_brew_complete_arg 'readall' -l syntax -d 'Syntax-check all of Homebrew\'s Ruby files (if no `tap` is passed)' @@ -1265,6 +1269,7 @@ __fish_brew_complete_arg 'search' -l closed -d 'Search for only closed GitHub pu __fish_brew_complete_arg 'search' -l debian -d 'Search for text in the given database' __fish_brew_complete_arg 'search' -l debug -d 'Display any debugging information' __fish_brew_complete_arg 'search' -l desc -d 'Search for formulae with a description matching text and casks with a name or description matching text' +__fish_brew_complete_arg 'search' -l eval-all -d 'Evaluate all available formulae and casks, whether installed or not, to search their descriptions. Implied if HOMEBREW_EVAL_ALL is set' __fish_brew_complete_arg 'search' -l fedora -d 'Search for text in the given database' __fish_brew_complete_arg 'search' -l fink -d 'Search for text in the given database' __fish_brew_complete_arg 'search' -l formula -d 'Search online and locally for formulae' @@ -1308,6 +1313,7 @@ __fish_brew_complete_arg 'style; and not __fish_seen_argument -l formula -l form __fish_brew_complete_cmd 'tap' 'Tap a formula repository' __fish_brew_complete_arg 'tap' -l custom-remote -d 'Install or change a tap with a custom remote. Useful for mirrors' __fish_brew_complete_arg 'tap' -l debug -d 'Display any debugging information' +__fish_brew_complete_arg 'tap' -l eval-all -d 'Evaluate all the formulae, casks and aliases in the new tap to check validity. Implied if HOMEBREW_EVAL_ALL is set' __fish_brew_complete_arg 'tap' -l force-auto-update -d 'Auto-update tap even if it is not hosted on GitHub. By default, only taps hosted on GitHub are auto-updated (for performance reasons)' __fish_brew_complete_arg 'tap' -l help -d 'Show this message' __fish_brew_complete_arg 'tap' -l list-pinned -d 'List all pinned taps' @@ -1341,7 +1347,6 @@ __fish_brew_complete_arg 'tap-new' -a '(__fish_brew_suggest_taps_installed)' __fish_brew_complete_cmd 'tc' 'Check for typechecking errors using Sorbet' -__fish_brew_complete_arg 'tc' -l all -d 'Regenerate all RBI files rather than just updated gems' __fish_brew_complete_arg 'tc' -l debug -d 'Display any debugging information' __fish_brew_complete_arg 'tc' -l dir -d 'Typecheck all files in a specific directory' __fish_brew_complete_arg 'tc' -l file -d 'Typecheck a single file' @@ -1351,6 +1356,7 @@ __fish_brew_complete_arg 'tc' -l ignore -d 'Ignores input files that contain the __fish_brew_complete_arg 'tc' -l quiet -d 'Silence all non-critical errors' __fish_brew_complete_arg 'tc' -l suggest-typed -d 'Try upgrading `typed` sigils' __fish_brew_complete_arg 'tc' -l update -d 'Update RBI files' +__fish_brew_complete_arg 'tc' -l update-all -d 'Update all RBI files rather than just updated gems' __fish_brew_complete_arg 'tc' -l verbose -d 'Make some output more verbose' @@ -1382,7 +1388,6 @@ __fish_brew_complete_arg 'tests' -l verbose -d 'Make some output more verbose' __fish_brew_complete_cmd 'typecheck' 'Check for typechecking errors using Sorbet' -__fish_brew_complete_arg 'typecheck' -l all -d 'Regenerate all RBI files rather than just updated gems' __fish_brew_complete_arg 'typecheck' -l debug -d 'Display any debugging information' __fish_brew_complete_arg 'typecheck' -l dir -d 'Typecheck all files in a specific directory' __fish_brew_complete_arg 'typecheck' -l file -d 'Typecheck a single file' @@ -1392,16 +1397,18 @@ __fish_brew_complete_arg 'typecheck' -l ignore -d 'Ignores input files that cont __fish_brew_complete_arg 'typecheck' -l quiet -d 'Silence all non-critical errors' __fish_brew_complete_arg 'typecheck' -l suggest-typed -d 'Try upgrading `typed` sigils' __fish_brew_complete_arg 'typecheck' -l update -d 'Update RBI files' +__fish_brew_complete_arg 'typecheck' -l update-all -d 'Update all RBI files rather than just updated gems' __fish_brew_complete_arg 'typecheck' -l verbose -d 'Make some output more verbose' __fish_brew_complete_cmd 'unbottled' 'Show the unbottled dependents of formulae' -__fish_brew_complete_arg 'unbottled' -l all -d 'Print the number of unbottled and total formulae' __fish_brew_complete_arg 'unbottled' -l debug -d 'Display any debugging information' __fish_brew_complete_arg 'unbottled' -l dependents -d 'Skip getting analytics data and sort by number of dependents instead' +__fish_brew_complete_arg 'unbottled' -l eval-all -d 'Evaluate all available formulae and casks, whether installed or not, to check them. Implied if HOMEBREW_EVAL_ALL is set' __fish_brew_complete_arg 'unbottled' -l help -d 'Show this message' __fish_brew_complete_arg 'unbottled' -l quiet -d 'Make some output more quiet' __fish_brew_complete_arg 'unbottled' -l tag -d 'Use the specified bottle tag (e.g. `big_sur`) instead of the current OS' +__fish_brew_complete_arg 'unbottled' -l total -d 'Print the number of unbottled and total formulae' __fish_brew_complete_arg 'unbottled' -l verbose -d 'Make some output more verbose' __fish_brew_complete_arg 'unbottled' -a '(__fish_brew_suggest_formulae_all)' @@ -1596,6 +1603,7 @@ __fish_brew_complete_arg 'upgrade; and not __fish_seen_argument -l formula -l fo __fish_brew_complete_cmd 'uses' 'Show formulae and casks that specify formula as a dependency; that is, show dependents of formula' __fish_brew_complete_arg 'uses' -l cask -d 'Include only casks' __fish_brew_complete_arg 'uses' -l debug -d 'Display any debugging information' +__fish_brew_complete_arg 'uses' -l eval-all -d 'Evaluate all available formulae and casks, whether installed or not, to show their dependents' __fish_brew_complete_arg 'uses' -l formula -d 'Include only formulae' __fish_brew_complete_arg 'uses' -l help -d 'Show this message' __fish_brew_complete_arg 'uses' -l include-build -d 'Include all formulae that specify formula as `:build` type dependency' diff --git a/completions/zsh/_brew b/completions/zsh/_brew index df267c6af5..3c5c63c0e0 100644 --- a/completions/zsh/_brew +++ b/completions/zsh/_brew @@ -356,6 +356,7 @@ _brew__s() { '(--repology --macports --fink --opensuse --fedora --archlinux --ubuntu)--debian[Search for text in the given database]' \ '--debug[Display any debugging information]' \ '(--pull-request)--desc[Search for formulae with a description matching text and casks with a name or description matching text]' \ + '--eval-all[Evaluate all available formulae and casks, whether installed or not, to search their descriptions. Implied if HOMEBREW_EVAL_ALL is set]' \ '(--repology --macports --fink --opensuse --archlinux --debian --ubuntu)--fedora[Search for text in the given database]' \ '(--repology --macports --opensuse --fedora --archlinux --debian --ubuntu)--fink[Search for text in the given database]' \ '--formula[Search online and locally for formulae]' \ @@ -373,14 +374,14 @@ _brew__s() { # brew abv _brew_abv() { _arguments \ - '(--installed)--all[Print JSON of all available formulae]' \ '(--bottle)--analytics[List global Homebrew analytics data or, if specified, installation and build error data for formula (provided neither `HOMEBREW_NO_ANALYTICS` nor `HOMEBREW_NO_GITHUB_API` are set)]' \ '--category[Which type of analytics data to retrieve. The value for category must be `install`, `install-on-request` or `build-error`; `cask-install` or `os-version` may be specified if formula is not. The default is `install`]' \ '--days[How many days of analytics data to retrieve. The value for days must be `30`, `90` or `365`. The default is `30`]' \ '--debug[Display any debugging information]' \ + '(--installed)--eval-all[Evaluate all available formulae and casks, whether installed or not, to print their JSON. Implied if HOMEBREW_EVAL_ALL is set]' \ '(--bottle)--github[Open the GitHub source page for formula and cask in a browser. To view the history locally: `brew log -p` formula or cask]' \ '--help[Show this message]' \ - '(--all)--installed[Print JSON of formulae that are currently installed]' \ + '(--eval-all --all)--installed[Print JSON of formulae that are currently installed]' \ '--json[Print a JSON representation. Currently the default value for version is `v1` for formula. For formula and cask use `v2`. See the docs for examples of using the JSON output: https://docs.brew.sh/Querying-Brew]' \ '--quiet[Make some output more quiet]' \ '--variations[Include the variations hash in each formula'\''s JSON output]' \ @@ -413,6 +414,7 @@ _brew_audit() { '(--skip-style --only-cops --except-cops)--display-cop-names[Include the RuboCop cop name for each violation in the output]' \ '--display-failures-only[Only display casks that fail the audit. This is the default for formulae]' \ '--display-filename[Prefix every line of output with the file or formula name being audited, to make output easy to grep]' \ + '--eval-all[Evaluate all available formulae and casks, whether installed or not, to audit them. Implied if HOMEBREW_EVAL_ALL is set]' \ '(--only)--except[Specify a comma-separated method list to skip running the methods named `audit_`method]' \ '(--only-cops --strict --only-cops --only --display-cop-names)--except-cops[Specify a comma-separated cops list to skip checking for violations of the listed RuboCop cops]' \ '--fix[Fix style violations automatically using RuboCop'\''s auto-correct feature]' \ @@ -695,11 +697,11 @@ _brew_create() { # brew deps _brew_deps() { _arguments \ - '(--installed)--all[List dependencies for all available formulae]' \ '--annotate[Mark any build, test, optional, or recommended dependencies as such in the output]' \ '--debug[Display any debugging information]' \ '--direct[Show only the direct dependencies declared in the formula]' \ '--dot[Show text-based graph description in DOT format]' \ + '(--installed)--eval-all[Evaluate all available formulae and casks, whether installed or not, to list their dependencies]' \ '--for-each[Switch into the mode used by the `--all` option, but only list dependencies for each provided formula, one formula per line. This is used for debugging the `--installed`/`--all` display mode]' \ '--full-name[List dependencies by their full name]' \ '(--tree)--graph[Show dependencies as a directed graph]' \ @@ -708,7 +710,7 @@ _brew_deps() { '--include-optional[Include `:optional` dependencies for formula]' \ '--include-requirements[Include requirements in addition to dependencies for formula]' \ '--include-test[Include `:test` dependencies for formula (non-recursive)]' \ - '(--all)--installed[List dependencies for formulae that are currently installed. If formula is specified, list only its dependencies that are currently installed]' \ + '(--eval-all --all)--installed[List dependencies for formulae that are currently installed. If formula is specified, list only its dependencies that are currently installed]' \ '--quiet[Make some output more quiet]' \ '--skip-recommended[Skip `:recommended` dependencies for formula]' \ '--topological[Sort dependencies in topological order]' \ @@ -728,6 +730,7 @@ _brew_desc() { _arguments \ '--debug[Display any debugging information]' \ '(--search --name)--description[Search just descriptions for text. If text is flanked by slashes, it is interpreted as a regular expression]' \ + '--eval-all[Evaluate all available formulae and casks, whether installed or not, to search their descriptions. Implied if HOMEBREW_EVAL_ALL is set]' \ '--help[Show this message]' \ '(--search --description)--name[Search just names for text. If text is flanked by slashes, it is interpreted as a regular expression]' \ '--quiet[Make some output more quiet]' \ @@ -934,14 +937,14 @@ _brew_homepage() { # brew info _brew_info() { _arguments \ - '(--installed)--all[Print JSON of all available formulae]' \ '(--bottle)--analytics[List global Homebrew analytics data or, if specified, installation and build error data for formula (provided neither `HOMEBREW_NO_ANALYTICS` nor `HOMEBREW_NO_GITHUB_API` are set)]' \ '--category[Which type of analytics data to retrieve. The value for category must be `install`, `install-on-request` or `build-error`; `cask-install` or `os-version` may be specified if formula is not. The default is `install`]' \ '--days[How many days of analytics data to retrieve. The value for days must be `30`, `90` or `365`. The default is `30`]' \ '--debug[Display any debugging information]' \ + '(--installed)--eval-all[Evaluate all available formulae and casks, whether installed or not, to print their JSON. Implied if HOMEBREW_EVAL_ALL is set]' \ '(--bottle)--github[Open the GitHub source page for formula and cask in a browser. To view the history locally: `brew log -p` formula or cask]' \ '--help[Show this message]' \ - '(--all)--installed[Print JSON of formulae that are currently installed]' \ + '(--eval-all --all)--installed[Print JSON of formulae that are currently installed]' \ '--json[Print a JSON representation. Currently the default value for version is `v1` for formula. For formula and cask use `v2`. See the docs for examples of using the JSON output: https://docs.brew.sh/Querying-Brew]' \ '--quiet[Make some output more quiet]' \ '--variations[Include the variations hash in each formula'\''s JSON output]' \ @@ -1086,15 +1089,15 @@ _brew_irb() { # brew lc _brew_lc() { _arguments \ - '(--tap --installed)--all[Check all available formulae/casks]' \ '(--json)--debug[Display any debugging information]' \ - '--full-name[Print formulae/casks with fully-qualified names]' \ + '(--tap --installed)--eval-all[Evaluate all available formulae and casks, whether installed or not, to check them]' \ + '--full-name[Print formulae and casks with fully-qualified names]' \ '--help[Show this message]' \ - '(--tap --all)--installed[Check formulae/casks that are currently installed]' \ + '(--tap --eval-all)--installed[Check formulae and casks that are currently installed]' \ '(--debug)--json[Output information in JSON format]' \ '--newer-only[Show the latest version only if it'\''s newer than the formula/cask]' \ '--quiet[Suppress warnings, don'\''t print a progress bar for JSON output]' \ - '(--all --installed)--tap[Check formulae/casks within the given tap, specified as user`/`repo]' \ + '(--eval-all --installed)--tap[Check formulae and casks within the given tap, specified as user`/`repo]' \ '--verbose[Make some output more verbose]' \ - formula \ '(--cask)--formula[Only check formulae]' \ @@ -1171,15 +1174,15 @@ _brew_list() { # brew livecheck _brew_livecheck() { _arguments \ - '(--tap --installed)--all[Check all available formulae/casks]' \ '(--json)--debug[Display any debugging information]' \ - '--full-name[Print formulae/casks with fully-qualified names]' \ + '(--tap --installed)--eval-all[Evaluate all available formulae and casks, whether installed or not, to check them]' \ + '--full-name[Print formulae and casks with fully-qualified names]' \ '--help[Show this message]' \ - '(--tap --all)--installed[Check formulae/casks that are currently installed]' \ + '(--tap --eval-all)--installed[Check formulae and casks that are currently installed]' \ '(--debug)--json[Output information in JSON format]' \ '--newer-only[Show the latest version only if it'\''s newer than the formula/cask]' \ '--quiet[Suppress warnings, don'\''t print a progress bar for JSON output]' \ - '(--all --installed)--tap[Check formulae/casks within the given tap, specified as user`/`repo]' \ + '(--eval-all --installed)--tap[Check formulae and casks within the given tap, specified as user`/`repo]' \ '--verbose[Make some output more verbose]' \ - formula \ '(--cask)--formula[Only check formulae]' \ @@ -1275,10 +1278,10 @@ _brew_missing() { # brew options _brew_options() { _arguments \ - '(--installed --command)--all[Show options for all available formulae]' \ '(--installed --all)--command[Show options for the specified command]' \ '--compact[Show all options on a single line separated by spaces]' \ '--debug[Display any debugging information]' \ + '--eval-all[Evaluate all available formulae and casks, whether installed or not, to show their options]' \ '--help[Show this message]' \ '(--all --command)--installed[Show options for formulae that are currently installed]' \ '--quiet[Make some output more quiet]' \ @@ -1420,6 +1423,7 @@ _brew_readall() { _arguments \ '--aliases[Verify any alias symlinks in each tap]' \ '--debug[Display any debugging information]' \ + '--eval-all[Evaluate all available formulae and casks, whether installed or not. Implied if HOMEBREW_EVAL_ALL is set]' \ '--help[Show this message]' \ '--quiet[Make some output more quiet]' \ '--syntax[Syntax-check all of Homebrew'\''s Ruby files (if no `tap` is passed)]' \ @@ -1542,6 +1546,7 @@ _brew_search() { '(--repology --macports --fink --opensuse --fedora --archlinux --ubuntu)--debian[Search for text in the given database]' \ '--debug[Display any debugging information]' \ '(--pull-request)--desc[Search for formulae with a description matching text and casks with a name or description matching text]' \ + '--eval-all[Evaluate all available formulae and casks, whether installed or not, to search their descriptions. Implied if HOMEBREW_EVAL_ALL is set]' \ '(--repology --macports --fink --opensuse --archlinux --debian --ubuntu)--fedora[Search for text in the given database]' \ '(--repology --macports --opensuse --fedora --archlinux --debian --ubuntu)--fink[Search for text in the given database]' \ '--formula[Search online and locally for formulae]' \ @@ -1598,6 +1603,7 @@ _brew_tap() { _arguments \ '--custom-remote[Install or change a tap with a custom remote. Useful for mirrors]' \ '--debug[Display any debugging information]' \ + '--eval-all[Evaluate all the formulae, casks and aliases in the new tap to check validity. Implied if HOMEBREW_EVAL_ALL is set]' \ '--force-auto-update[Auto-update tap even if it is not hosted on GitHub. By default, only taps hosted on GitHub are auto-updated (for performance reasons)]' \ '--help[Show this message]' \ '--list-pinned[List all pinned taps]' \ @@ -1640,7 +1646,6 @@ _brew_tap_new() { # brew tc _brew_tc() { _arguments \ - '--all[Regenerate all RBI files rather than just updated gems]' \ '--debug[Display any debugging information]' \ '(--file)--dir[Typecheck all files in a specific directory]' \ '(--dir)--file[Typecheck a single file]' \ @@ -1650,6 +1655,7 @@ _brew_tc() { '--quiet[Silence all non-critical errors]' \ '--suggest-typed[Try upgrading `typed` sigils]' \ '--update[Update RBI files]' \ + '--update-all[Update all RBI files rather than just updated gems]' \ '--verbose[Make some output more verbose]' } @@ -1688,7 +1694,6 @@ _brew_tests() { # brew typecheck _brew_typecheck() { _arguments \ - '--all[Regenerate all RBI files rather than just updated gems]' \ '--debug[Display any debugging information]' \ '(--file)--dir[Typecheck all files in a specific directory]' \ '(--dir)--file[Typecheck a single file]' \ @@ -1698,18 +1703,20 @@ _brew_typecheck() { '--quiet[Silence all non-critical errors]' \ '--suggest-typed[Try upgrading `typed` sigils]' \ '--update[Update RBI files]' \ + '--update-all[Update all RBI files rather than just updated gems]' \ '--verbose[Make some output more verbose]' } # brew unbottled _brew_unbottled() { _arguments \ - '(--dependents --installed)--all[Print the number of unbottled and total formulae]' \ '--debug[Display any debugging information]' \ - '(--all)--dependents[Skip getting analytics data and sort by number of dependents instead]' \ + '(--total)--dependents[Skip getting analytics data and sort by number of dependents instead]' \ + '--eval-all[Evaluate all available formulae and casks, whether installed or not, to check them. Implied if HOMEBREW_EVAL_ALL is set]' \ '--help[Show this message]' \ '--quiet[Make some output more quiet]' \ '--tag[Use the specified bottle tag (e.g. `big_sur`) instead of the current OS]' \ + '(--dependents)--total[Print the number of unbottled and total formulae]' \ '--verbose[Make some output more verbose]' \ - formula \ '*::formula:__brew_formulae' @@ -1948,6 +1955,7 @@ _brew_uses() { _arguments \ '(--formula)--cask[Include only casks]' \ '--debug[Display any debugging information]' \ + '--eval-all[Evaluate all available formulae and casks, whether installed or not, to show their dependents]' \ '--help[Show this message]' \ '--include-build[Include all formulae that specify formula as `:build` type dependency]' \ '--include-optional[Include all formulae that specify formula as `:optional` type dependency]' \ diff --git a/docs/Manpage.md b/docs/Manpage.md index f227e55487..00e511a6a8 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -168,8 +168,8 @@ show the intersection of dependencies for each formula. Mark any build, test, optional, or recommended dependencies as such in the output. * `--installed`: List dependencies for formulae that are currently installed. If *`formula`* is specified, list only its dependencies that are currently installed. -* `--all`: - List dependencies for all available formulae. +* `--eval-all`: + Evaluate all available formulae and casks, whether installed or not, to list their dependencies. * `--for-each`: Switch into the mode used by the `--all` option, but only list dependencies for each provided *`formula`*, one formula per line. This is used for debugging the `--installed`/`--all` display mode. * `--formula`: @@ -180,8 +180,7 @@ show the intersection of dependencies for each formula. ### `desc` [*`options`*] *`formula`*|*`cask`*|*`text`*|`/`*`regex`*`/` [...] Display *`formula`*'s name and one-line description. -Formula descriptions are cached; the cache is created on the -first search, making that search slower than subsequent ones. +The cache is created on the first search, making that search slower than subsequent ones. * `-s`, `--search`: Search both names and descriptions for *`text`*. If *`text`* is flanked by slashes, it is interpreted as a regular expression. @@ -189,6 +188,8 @@ first search, making that search slower than subsequent ones. Search just names for *`text`*. If *`text`* is flanked by slashes, it is interpreted as a regular expression. * `-d`, `--description`: Search just descriptions for *`text`*. If *`text`* is flanked by slashes, it is interpreted as a regular expression. +* `--eval-all`: + Evaluate all available formulae and casks, whether installed or not, to search their descriptions. Implied if HOMEBREW_EVAL_ALL is set. * `--formula`: Treat all named arguments as formulae. * `--cask`: @@ -293,8 +294,8 @@ If a *`formula`* or *`cask`* is provided, show summary of information about it. Print a JSON representation. Currently the default value for *`version`* is `v1` for *`formula`*. For *`formula`* and *`cask`* use `v2`. See the docs for examples of using the JSON output: * `--installed`: Print JSON of formulae that are currently installed. -* `--all`: - Print JSON of all available formulae. +* `--eval-all`: + Evaluate all available formulae and casks, whether installed or not, to print their JSON. Implied if HOMEBREW_EVAL_ALL is set. * `--variations`: Include the variations hash in each formula's JSON output. * `-v`, `--verbose`: @@ -470,8 +471,8 @@ Show install options specific to *`formula`*. Show all options on a single line separated by spaces. * `--installed`: Show options for formulae that are currently installed. -* `--all`: - Show options for all available formulae. +* `--eval-all`: + Evaluate all available formulae and casks, whether installed or not, to show their options. * `--command`: Show options for the specified *`command`*. @@ -508,7 +509,7 @@ issuing the `brew upgrade` *`formula`* command. See also `unpin`. Rerun the post-install steps for *`formula`*. -### `readall` [*`--aliases`*] [*`--syntax`*] [*`tap`* ...] +### `readall` [*`options`*] [*`tap`* ...] Import all items from the specified *`tap`*, or from all installed taps if none is provided. This can be useful for debugging issues across all items when making @@ -519,6 +520,8 @@ all items or checking if any current formulae/casks have Ruby issues. Verify any alias symlinks in each tap. * `--syntax`: Syntax-check all of Homebrew's Ruby files (if no `*`tap`*` is passed). +* `--eval-all`: + Evaluate all available formulae and casks, whether installed or not. Implied if HOMEBREW_EVAL_ALL is set. ### `reinstall` [*`options`*] *`formula`*|*`cask`* [...] @@ -578,6 +581,8 @@ The search for *`text`* is extended online to `homebrew/core` and `homebrew/cask Search online and locally for casks. * `--desc`: Search for formulae with a description matching *`text`* and casks with a name or description matching *`text`*. +* `--eval-all`: + Evaluate all available formulae and casks, whether installed or not, to search their descriptions. Implied if HOMEBREW_EVAL_ALL is set. * `--pull-request`: Search for GitHub pull requests containing *`text`*. * `--open`: @@ -634,6 +639,8 @@ using protocols other than HTTPS, e.g. SSH, git, HTTP, FTP(S), rsync. Migrate tapped formulae from symlink-based to directory-based structure. * `--list-pinned`: List all pinned taps. +* `--eval-all`: + Evaluate all the formulae, casks and aliases in the new tap to check validity. Implied if HOMEBREW_EVAL_ALL is set. ### `tap-info` [*`--installed`*] [*`--json`*] [*`tap`* ...] @@ -765,6 +772,8 @@ specify *`formula`* as a required or recommended dependency for their stable bui Resolve more than one level of dependencies. * `--installed`: Only list formulae and casks that are currently installed. +* `--eval-all`: + Evaluate all available formulae and casks, whether installed or not, to show their dependents. * `--include-build`: Include all formulae that specify *`formula`* as `:build` type dependency. * `--include-test`: @@ -866,6 +875,8 @@ non-zero status if any errors are found. Run additional, slower style checks that require a network connection. * `--installed`: Only check formulae and casks that are currently installed. +* `--eval-all`: + Evaluate all available formulae and casks, whether installed or not, to audit them. Implied if HOMEBREW_EVAL_ALL is set. * `--new`: Run various additional style checks to determine if a new formula or cask is eligible for Homebrew. This should be used when creating new formula and implies `--strict` and `--online`. * `--[no-]appcast`: @@ -994,8 +1005,8 @@ supplied by the user. Create a pull request to update *`formula`* with a new URL or a new tag. If a *`URL`* is specified, the *`SHA-256`* checksum of the new download should also -be specified. A best effort to determine the *`SHA-256`* and *`formula`* name will -be made if either or both values are not supplied by the user. +be specified. A best effort to determine the *`SHA-256`* will be made if not supplied +by the user. If a *`tag`* is specified, the Git commit *`revision`* corresponding to that tag should also be specified. A best effort to determine the *`revision`* will be made @@ -1241,13 +1252,13 @@ casks to check is taken from `HOMEBREW_LIVECHECK_WATCHLIST` or `~/.brew_livecheck_watchlist`. * `--full-name`: - Print formulae/casks with fully-qualified names. + Print formulae and casks with fully-qualified names. * `--tap`: - Check formulae/casks within the given tap, specified as *`user`*`/`*`repo`*. -* `--all`: - Check all available formulae/casks. + Check formulae and casks within the given tap, specified as *`user`*`/`*`repo`*. +* `--eval-all`: + Evaluate all available formulae and casks, whether installed or not, to check them. * `--installed`: - Check formulae/casks that are currently installed. + Check formulae and casks that are currently installed. * `--newer-only`: Show the latest version only if it's newer than the formula/cask. * `--json`: @@ -1492,8 +1503,8 @@ Check for typechecking errors using Sorbet. Silence all non-critical errors. * `--update`: Update RBI files. -* `--all`: - Regenerate all RBI files rather than just updated gems. +* `--update-all`: + Update all RBI files rather than just updated gems. * `--suggest-typed`: Try upgrading `typed` sigils. * `--dir`: @@ -1511,8 +1522,10 @@ Show the unbottled dependents of formulae. Use the specified bottle tag (e.g. `big_sur`) instead of the current OS. * `--dependents`: Skip getting analytics data and sort by number of dependents instead. -* `--all`: +* `--total`: Print the number of unbottled and total formulae. +* `--eval-all`: + Evaluate all available formulae and casks, whether installed or not, to check them. Implied if HOMEBREW_EVAL_ALL is set. ### `unpack` [*`options`*] *`formula`* [...] @@ -2055,6 +2068,9 @@ example, run `export HOMEBREW_NO_INSECURE_REDIRECT=1` rather than just *Default:* `$EDITOR` or `$VISUAL`. +- `HOMEBREW_EVAL_ALL` +
If set, `brew` commands evaluate all formulae and casks, executing their arbitrary code, by default without requiring --eval-all. Required to cache formula and cask descriptions. + - `HOMEBREW_FAIL_LOG_LINES`
Output this many lines of output on formula `system` failures. diff --git a/manpages/brew.1 b/manpages/brew.1 index ce0ff42fb2..beb40c2f1b 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -210,8 +210,8 @@ Mark any build, test, optional, or recommended dependencies as such in the outpu List dependencies for formulae that are currently installed\. If \fIformula\fR is specified, list only its dependencies that are currently installed\. . .TP -\fB\-\-all\fR -List dependencies for all available formulae\. +\fB\-\-eval\-all\fR +Evaluate all available formulae and casks, whether installed or not, to list their dependencies\. . .TP \fB\-\-for\-each\fR @@ -226,7 +226,7 @@ Treat all named arguments as formulae\. Treat all named arguments as casks\. . .SS "\fBdesc\fR [\fIoptions\fR] \fIformula\fR|\fIcask\fR|\fItext\fR|\fB/\fR\fIregex\fR\fB/\fR [\.\.\.]" -Display \fIformula\fR\'s name and one\-line description\. Formula descriptions are cached; the cache is created on the first search, making that search slower than subsequent ones\. +Display \fIformula\fR\'s name and one\-line description\. The cache is created on the first search, making that search slower than subsequent ones\. . .TP \fB\-s\fR, \fB\-\-search\fR @@ -241,6 +241,10 @@ Search just names for \fItext\fR\. If \fItext\fR is flanked by slashes, it is in Search just descriptions for \fItext\fR\. If \fItext\fR is flanked by slashes, it is interpreted as a regular expression\. . .TP +\fB\-\-eval\-all\fR +Evaluate all available formulae and casks, whether installed or not, to search their descriptions\. Implied if HOMEBREW_EVAL_ALL is set\. +. +.TP \fB\-\-formula\fR Treat all named arguments as formulae\. . @@ -381,8 +385,8 @@ Print a JSON representation\. Currently the default value for \fIversion\fR is \ Print JSON of formulae that are currently installed\. . .TP -\fB\-\-all\fR -Print JSON of all available formulae\. +\fB\-\-eval\-all\fR +Evaluate all available formulae and casks, whether installed or not, to print their JSON\. Implied if HOMEBREW_EVAL_ALL is set\. . .TP \fB\-\-variations\fR @@ -653,8 +657,8 @@ Show all options on a single line separated by spaces\. Show options for formulae that are currently installed\. . .TP -\fB\-\-all\fR -Show options for all available formulae\. +\fB\-\-eval\-all\fR +Evaluate all available formulae and casks, whether installed or not, to show their options\. . .TP \fB\-\-command\fR @@ -705,7 +709,7 @@ Pin the specified \fIformula\fR, preventing them from being upgraded when issuin .SS "\fBpostinstall\fR \fIinstalled_formula\fR [\.\.\.]" Rerun the post\-install steps for \fIformula\fR\. . -.SS "\fBreadall\fR [\fI\-\-aliases\fR] [\fI\-\-syntax\fR] [\fItap\fR \.\.\.]" +.SS "\fBreadall\fR [\fIoptions\fR] [\fItap\fR \.\.\.]" Import all items from the specified \fItap\fR, or from all installed taps if none is provided\. This can be useful for debugging issues across all items when making significant changes to \fBformula\.rb\fR, testing the performance of loading all items or checking if any current formulae/casks have Ruby issues\. . .TP @@ -716,6 +720,10 @@ Verify any alias symlinks in each tap\. \fB\-\-syntax\fR Syntax\-check all of Homebrew\'s Ruby files (if no \fB\fR is passed)\. . +.TP +\fB\-\-eval\-all\fR +Evaluate all available formulae and casks, whether installed or not\. Implied if HOMEBREW_EVAL_ALL is set\. +. .SS "\fBreinstall\fR [\fIoptions\fR] \fIformula\fR|\fIcask\fR [\.\.\.]" Uninstall and then reinstall a \fIformula\fR or \fIcask\fR using the same options it was originally installed with, plus any appended options specific to a \fIformula\fR\. . @@ -809,6 +817,10 @@ Search online and locally for casks\. Search for formulae with a description matching \fItext\fR and casks with a name or description matching \fItext\fR\. . .TP +\fB\-\-eval\-all\fR +Evaluate all available formulae and casks, whether installed or not, to search their descriptions\. Implied if HOMEBREW_EVAL_ALL is set\. +. +.TP \fB\-\-pull\-request\fR Search for GitHub pull requests containing \fItext\fR\. . @@ -886,6 +898,10 @@ Migrate tapped formulae from symlink\-based to directory\-based structure\. \fB\-\-list\-pinned\fR List all pinned taps\. . +.TP +\fB\-\-eval\-all\fR +Evaluate all the formulae, casks and aliases in the new tap to check validity\. Implied if HOMEBREW_EVAL_ALL is set\. +. .SS "\fBtap\-info\fR [\fI\-\-installed\fR] [\fI\-\-json\fR] [\fItap\fR \.\.\.]" Show detailed information about one or more \fItap\fRs\. . @@ -1066,6 +1082,10 @@ Resolve more than one level of dependencies\. Only list formulae and casks that are currently installed\. . .TP +\fB\-\-eval\-all\fR +Evaluate all available formulae and casks, whether installed or not, to show their dependents\. +. +.TP \fB\-\-include\-build\fR Include all formulae that specify \fIformula\fR as \fB:build\fR type dependency\. . @@ -1201,6 +1221,10 @@ Run additional, slower style checks that require a network connection\. Only check formulae and casks that are currently installed\. . .TP +\fB\-\-eval\-all\fR +Evaluate all available formulae and casks, whether installed or not, to audit them\. Implied if HOMEBREW_EVAL_ALL is set\. +. +.TP \fB\-\-new\fR Run various additional style checks to determine if a new formula or cask is eligible for Homebrew\. This should be used when creating new formula and implies \fB\-\-strict\fR and \fB\-\-online\fR\. . @@ -1412,7 +1436,7 @@ Ignore duplicate open PRs\. Create a pull request to update \fIformula\fR with a new URL or a new tag\. . .P -If a \fIURL\fR is specified, the \fISHA\-256\fR checksum of the new download should also be specified\. A best effort to determine the \fISHA\-256\fR and \fIformula\fR name will be made if either or both values are not supplied by the user\. +If a \fIURL\fR is specified, the \fISHA\-256\fR checksum of the new download should also be specified\. A best effort to determine the \fISHA\-256\fR will be made if not supplied by the user\. . .P If a \fItag\fR is specified, the Git commit \fIrevision\fR corresponding to that tag should also be specified\. A best effort to determine the \fIrevision\fR will be made if the value is not supplied by the user\. @@ -1760,19 +1784,19 @@ If no formula or cask argument is passed, the list of formulae and casks to chec . .TP \fB\-\-full\-name\fR -Print formulae/casks with fully\-qualified names\. +Print formulae and casks with fully\-qualified names\. . .TP \fB\-\-tap\fR -Check formulae/casks within the given tap, specified as \fIuser\fR\fB/\fR\fIrepo\fR\. +Check formulae and casks within the given tap, specified as \fIuser\fR\fB/\fR\fIrepo\fR\. . .TP -\fB\-\-all\fR -Check all available formulae/casks\. +\fB\-\-eval\-all\fR +Evaluate all available formulae and casks, whether installed or not, to check them\. . .TP \fB\-\-installed\fR -Check formulae/casks that are currently installed\. +Check formulae and casks that are currently installed\. . .TP \fB\-\-newer\-only\fR @@ -2133,8 +2157,8 @@ Silence all non\-critical errors\. Update RBI files\. . .TP -\fB\-\-all\fR -Regenerate all RBI files rather than just updated gems\. +\fB\-\-update\-all\fR +Update all RBI files rather than just updated gems\. . .TP \fB\-\-suggest\-typed\fR @@ -2164,9 +2188,13 @@ Use the specified bottle tag (e\.g\. \fBbig_sur\fR) instead of the current OS\. Skip getting analytics data and sort by number of dependents instead\. . .TP -\fB\-\-all\fR +\fB\-\-total\fR Print the number of unbottled and total formulae\. . +.TP +\fB\-\-eval\-all\fR +Evaluate all available formulae and casks, whether installed or not, to check them\. Implied if HOMEBREW_EVAL_ALL is set\. +. .SS "\fBunpack\fR [\fIoptions\fR] \fIformula\fR [\.\.\.]" Unpack the source files for \fIformula\fR into subdirectories of the current working directory\. . @@ -2959,6 +2987,12 @@ Use this editor when editing a single formula, or several formulae in the same d \fIDefault:\fR \fB$EDITOR\fR or \fB$VISUAL\fR\. . .TP +\fBHOMEBREW_EVAL_ALL\fR +. +.br +If set, \fBbrew\fR commands evaluate all formulae and casks, executing their arbitrary code, by default without requiring \-\-eval\-all\. Required to cache formula and cask descriptions\. +. +.TP \fBHOMEBREW_FAIL_LOG_LINES\fR . .br