Merge pull request #10412 from EricFromCanada/adjust-messaging

Adjustments for message output
This commit is contained in:
Eric Knibbe 2021-01-26 16:50:23 -05:00 committed by GitHub
commit f7a718c1fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
128 changed files with 422 additions and 409 deletions

View File

@ -92,7 +92,7 @@ odie() {
}
safe_cd() {
cd "$@" >/dev/null || odie "Error: failed to cd to $*!"
cd "$@" >/dev/null || odie "Failed to cd to $*!"
}
brew() {
@ -382,10 +382,10 @@ else
curl_name_and_version="${curl_version_output%% (*}"
if [[ $(numeric "${curl_name_and_version##* }") -lt $(numeric "$HOMEBREW_MINIMUM_CURL_VERSION") ]]
then
message="Please update your system cURL.
message="Please update your system curl.
Minimum required version: ${HOMEBREW_MINIMUM_CURL_VERSION}
Your cURL version: ${curl_name_and_version##* }
Your cURL executable: $(type -p $HOMEBREW_CURL)"
Your curl version: ${curl_name_and_version##* }
Your curl executable: $(type -p $HOMEBREW_CURL)"
if [[ -z $HOMEBREW_CURL_PATH || -z $HOMEBREW_DEVELOPER ]]; then
HOMEBREW_SYSTEM_CURL_TOO_OLD=1

View File

@ -152,14 +152,18 @@ class Build
system "git", "add", "-A"
end
if args.interactive?
ohai "Entering interactive mode"
puts "Type `exit` to return and finalize the installation."
puts "Install to this prefix: #{formula.prefix}"
ohai "Entering interactive mode..."
puts <<~EOS
Type `exit` to return and finalize the installation.
Install to this prefix: #{formula.prefix}
EOS
if args.git?
puts "This directory is now a git repo. Make your changes and then use:"
puts " git diff | pbcopy"
puts "to copy the diff to the clipboard."
puts <<~EOS
This directory is now a Git repository. Make your changes and then use:
git diff | pbcopy
to copy the diff to the clipboard.
EOS
end
interactive_shell(formula)

View File

@ -133,8 +133,11 @@ module Cask
sig { returns(String) }
def automation_access_instructions
"Enable Automation Access for “Terminal > System Events” in " \
"“System Preferences > Security > Privacy > Automation” if you haven't already."
<<~EOS
Enable Automation access for "Terminal → System Events" in:
System Preferences Security & Privacy Privacy Automation
if you haven't already.
EOS
end
# :quit/:signal must come before :kext so the kext will not be in use by a running process
@ -300,7 +303,7 @@ module Cask
message = "uninstall script #{executable} does not exist"
raise CaskError, "#{message}." unless force
opoo "#{message}, skipping."
opoo "#{message}; skipping."
return
end
@ -367,8 +370,7 @@ module Cask
resolved_paths = each_resolved_path(:trash, paths).to_a
ohai "Trashing files:"
puts resolved_paths.map(&:first)
ohai "Trashing files:", resolved_paths.map(&:first)
trash_paths(*resolved_paths.flat_map(&:last), **options)
end
@ -396,7 +398,7 @@ module Cask
false
end
opoo "The following files could not trashed, please do so manually:"
opoo "The following files could not be trashed, please do so manually:"
$stderr.puts untrashable
[trashed, untrashable]

View File

@ -23,7 +23,7 @@ module Cask
puts <<~EOS
To complete the installation of Cask #{cask}, you must also
run the installer at:
'#{cask.staged_path.join(path)}'
#{cask.staged_path.join(path)}
EOS
end
end

View File

@ -48,7 +48,7 @@ module Cask
raise CaskError, "It seems the #{self.class.english_name} source '#{source}' is not there."
end
ohai "Moving #{self.class.english_name} '#{source.basename}' to '#{target}'."
ohai "Moving #{self.class.english_name} '#{source.basename}' to '#{target}'"
if target.dirname.ascend.find(&:directory?).writable?
target.dirname.mkpath
else
@ -84,7 +84,7 @@ module Cask
raise CaskError, "It seems the #{self.class.english_name} source '#{target}' is not there."
end
ohai "Backing #{self.class.english_name} '#{target.basename}' up to '#{source}'."
ohai "Backing #{self.class.english_name} '#{target.basename}' up to '#{source}'"
source.dirname.mkpath
# We need to preserve extended attributes between copies.
@ -94,7 +94,7 @@ module Cask
end
def delete(target, force: false, command: nil, **_)
ohai "Removing #{self.class.english_name} '#{target}'."
ohai "Removing #{self.class.english_name} '#{target}'"
raise CaskError, "Cannot remove undeletable #{self.class.english_name}." if MacOS.undeletable?(target)
return unless Utils.path_occupied?(target)

View File

@ -39,8 +39,8 @@ module Cask
private
def run_installer(command: nil, verbose: false, **_options)
ohai "Running installer for #{cask}; your password may be necessary."
ohai "Package installers may write to any location; options such as --appdir are ignored."
ohai "Running installer for #{cask}; your password may be necessary.",
"Package installers may write to any location; options such as `--appdir` are ignored."
unless path.exist?
pkg = path.relative_path_from(cask.staged_path)
pkgs = Pathname.glob(cask.staged_path/"**"/"*.pkg").map { |path| path.relative_path_from(cask.staged_path) }

View File

@ -82,7 +82,7 @@ module Cask
altnames = command.run("/usr/bin/xattr",
args: ["-p", ALT_NAME_ATTRIBUTE, file],
print_stderr: false).stdout.sub(/\A\((.*)\)\Z/, '\1')
odebug "Existing metadata is: '#{altnames}'"
odebug "Existing metadata is: #{altnames}"
altnames.concat(", ") unless altnames.empty?
altnames.concat(%Q("#{altname}"))
altnames = "(#{altnames})"

View File

@ -65,14 +65,14 @@ module Cask
end
end
ohai "Linking #{self.class.english_name} '#{source.basename}' to '#{target}'."
ohai "Linking #{self.class.english_name} '#{source.basename}' to '#{target}'"
create_filesystem_link(**options)
end
def unlink(**)
return unless target.symlink?
ohai "Unlinking #{self.class.english_name} '#{target}'."
ohai "Unlinking #{self.class.english_name} '#{target}'"
target.delete
end

View File

@ -82,7 +82,7 @@ module Cask
check_bitbucket_repository
self
rescue => e
odebug "#{e.message}\n#{e.backtrace.join("\n")}"
odebug e, e.backtrace
add_error "exception while auditing #{cask}: #{e.message}"
self
end
@ -416,7 +416,7 @@ module Cask
return unless verified_matches_url?
add_error "The URL's domain #{domain} matches the homepage domain #{homepage}, " \
"the `verified` parameter of the `url` stanza is unnecessary. " \
"the 'verified' parameter of the 'url' stanza is unnecessary. " \
"See https://github.com/Homebrew/homebrew-cask/blob/master/doc/cask_language_reference/stanzas/url.md#when-url-and-homepage-hostnames-differ-add-verified"
end
@ -427,7 +427,7 @@ module Cask
return if verified_present?
add_error "The URL's domain #{domain} does not match the homepage domain #{homepage}, " \
"a `verified` parameter has to be added to the `url` stanza. " \
"a 'verified' parameter has to be added to the 'url' stanza. " \
"See https://github.com/Homebrew/homebrew-cask/blob/master/doc/cask_language_reference/stanzas/url.md#when-url-and-homepage-hostnames-differ-add-verified"
end

View File

@ -115,7 +115,7 @@ module Cask
path.dirname.mkpath
begin
ohai "Downloading #{url}."
ohai "Downloading #{url}"
curl_download url, to: path
rescue ErrorDuringExecution
raise CaskUnavailableError.new(token, "Failed to download #{Formatter.url(url)}.")

View File

@ -22,8 +22,8 @@ module Cask
sudo = !path.parent.writable?
if sudo && !ENV.key?("SUDO_ASKPASS") && $stdout.tty?
ohai "Creating Caskroom at #{path}"
ohai "We'll set permissions properly so we won't need sudo in the future."
ohai "Creating Caskroom directory: #{path}",
"We'll set permissions properly so we won't need sudo in the future."
end
SystemCommand.run("/bin/mkdir", args: ["-p", path], sudo: sudo)

View File

@ -174,7 +174,7 @@ module Cask
[args.remaining.empty? ? NullCommand : UnknownSubcommand.new(args.remaining.first), argv]
if (replacement = DEPRECATED_COMMANDS[command])
odisabled "brew cask #{command.command_name}", replacement
odisabled "`brew cask #{command.command_name}`", replacement
end
if args.help?

View File

@ -129,7 +129,7 @@ module Cask
matches = search_casks(cask_token)
if matches.one?
"Did you mean #{matches.first}?"
"Did you mean '#{matches.first}'?"
elsif !matches.empty?
"Did you mean one of these?\n#{Formatter.columns(matches.take(20))}"
end

View File

@ -43,7 +43,7 @@ module Cask
download = Download.new(cask, **options)
download.clear_cache if args.force?
downloaded_path = download.fetch
ohai "Success! Downloaded to -> #{downloaded_path}"
ohai "Success! Downloaded to: #{downloaded_path}"
end
end
end

View File

@ -80,7 +80,7 @@ module Cask
return if DSL::DSL_METHODS.include?(stanza)
raise UsageError, <<~EOS
Unknown/unsupported stanza: '#{stanza}'
Unknown/unsupported stanza '#{stanza}'.
Check cask reference for supported stanzas.
EOS
end
@ -98,7 +98,7 @@ module Cask
begin
value = cask.send(stanza)
rescue
opoo "failure calling '#{stanza}' on Cask '#{cask}'" unless args.quiet?
opoo "Failure calling '#{stanza}' on Cask '#{cask}'" unless args.quiet?
puts ""
next
end

View File

@ -101,7 +101,7 @@ module Cask
return false if outdated_casks.empty?
if casks.empty? && !greedy
ohai "Casks with `auto_updates` or `version :latest` will not be upgraded; pass `--greedy` to upgrade them."
ohai "Casks with 'auto_updates' or 'version :latest' will not be upgraded; pass `--greedy` to upgrade them."
end
verb = dry_run ? "Would upgrade" : "Upgrading"

View File

@ -63,7 +63,7 @@ module Cask
end
begin
ohai "Verifying checksum for cask '#{@cask}'." if verbose?
ohai "Verifying checksum for cask '#{@cask}'" if verbose?
fn.verify_checksum(@cask.sha256)
rescue ChecksumMissingError
opoo <<~EOS

View File

@ -201,7 +201,7 @@ module Cask
def version(arg = nil)
set_unique_stanza(:version, arg.nil?) do
if !arg.is_a?(String) && arg != :latest
raise CaskInvalidError.new(cask, "invalid 'version' value: '#{arg.inspect}'")
raise CaskInvalidError.new(cask, "invalid 'version' value: #{arg.inspect}")
end
DSL::Version.new(arg)
@ -216,7 +216,7 @@ module Cask
when String
Checksum.new(arg)
else
raise CaskInvalidError.new(cask, "invalid 'sha256' value: '#{arg.inspect}'")
raise CaskInvalidError.new(cask, "invalid 'sha256' value: #{arg.inspect}")
end
end
end

View File

@ -69,22 +69,22 @@ module Cask
end
caveat :unsigned_accessibility do |access = "Accessibility"|
# access: the category in System Preferences -> Security & Privacy -> Privacy the app requires.
# access: the category in System Preferences > Security & Privacy > Privacy the app requires.
<<~EOS
#{@cask} is not signed and requires Accessibility access,
so you will need to re-grant Accessibility access every time the app is updated.
Enable or re-enable it in:
System Preferences Security & Privacy Privacy -> #{access}
To re-enable untick and retick #{@cask}.app.
System Preferences Security & Privacy Privacy #{access}
To re-enable, untick and retick #{@cask}.app.
EOS
end
caveat :path_environment_variable do |path|
<<~EOS
To use #{@cask}, you may need to add the #{path} directory
to your PATH environment variable, e.g. (for bash shell):
to your PATH environment variable, e.g. (for Bash shell):
export PATH=#{path}:"$PATH"
EOS
end

View File

@ -19,7 +19,7 @@ module Cask
def initialize(pairs = {})
@pairs = pairs
pairs.each do |key, value|
raise "invalid container key: '#{key.inspect}'" unless VALID_KEYS.include?(key)
raise "invalid container key: #{key.inspect}" unless VALID_KEYS.include?(key)
send(:"#{key}=", value)
end

View File

@ -52,7 +52,7 @@ module Cask
end
def macos=(*args)
raise "Only a single 'depends_on macos:' is allowed." if defined?(@macos)
raise "Only a single 'depends_on macos' is allowed." if defined?(@macos)
begin
@macos = if args.count > 1

View File

@ -212,11 +212,11 @@ module Cask
end
def install_artifacts
artifacts = @cask.artifacts
already_installed_artifacts = []
odebug "Installing artifacts"
artifacts = @cask.artifacts
odebug "#{artifacts.length} artifact/s defined", artifacts
odebug "#{artifacts.length} #{"artifact".pluralize(artifacts.length)} defined", artifacts
artifacts.each do |artifact|
next unless artifact.respond_to?(:install_phase)
@ -280,7 +280,7 @@ module Cask
raise CaskError,
"Cask #{@cask} depends on hardware architecture being one of " \
"[#{@cask.depends_on.arch.map(&:to_s).join(", ")}], " \
"but you are running #{@current_arch}"
"but you are running #{@current_arch}."
end
def x11_dependencies
@ -356,7 +356,7 @@ module Cask
missing_formulae_and_casks = missing_cask_and_formula_dependencies
if missing_formulae_and_casks.empty?
puts "All Formula dependencies satisfied."
puts "All formula dependencies satisfied."
return
end
@ -459,10 +459,10 @@ module Cask
end
def uninstall_artifacts(clear: false)
odebug "Uninstalling artifacts"
artifacts = @cask.artifacts
odebug "#{artifacts.length} artifact/s defined", artifacts
odebug "Uninstalling artifacts"
odebug "#{artifacts.length} #{"artifact".pluralize(artifacts.length)} defined", artifacts
artifacts.each do |artifact|
if artifact.respond_to?(:uninstall_phase)
@ -482,7 +482,7 @@ module Cask
end
def zap
ohai %Q(Implied "brew uninstall --cask #{@cask}")
ohai "Implied `brew uninstall --cask #{@cask}`"
uninstall_artifacts
if (zap_stanzas = @cask.artifacts.select { |a| a.is_a?(Artifact::Zap) }).empty?
opoo "No zap stanza present for Cask '#{@cask}'"

View File

@ -32,7 +32,7 @@ module Cask
end
if create && !path.directory?
odebug "Creating metadata directory #{path}."
odebug "Creating metadata directory: #{path}"
path.mkpath
end
@ -50,7 +50,7 @@ module Cask
subdir = parent.join(leaf)
if create && !subdir.directory?
odebug "Creating metadata subdirectory #{subdir}."
odebug "Creating metadata subdirectory: #{subdir}"
subdir.mkpath
end

View File

@ -32,7 +32,7 @@ module Cask
odebug "Checking quarantine support"
if !system_command(xattr, print_stderr: false).success?
odebug "There's not a working version of xattr."
odebug "There's no working version of `xattr` on this system."
:xattr_broken
elsif swift.nil?
odebug "Swift is not available on this system."

View File

@ -29,7 +29,7 @@ module Cask
full_paths = remove_nonexistent(paths)
return if full_paths.empty?
ohai "Changing ownership of paths required by #{@cask}; your password may be necessary"
ohai "Changing ownership of paths required by #{@cask}; your password may be necessary."
@command.run!("/usr/sbin/chown", args: ["-R", "--", "#{user}:#{group}", *full_paths],
sudo: true)
end

View File

@ -62,7 +62,7 @@ class Caveats
if f.bin.directory? || f.sbin.directory?
s << <<~EOS
If you need to have #{f.name} first in your PATH run:
If you need to have #{f.name} first in your PATH, run:
EOS
s << " #{Utils::Shell.prepend_path_in_profile(f.opt_bin.to_s)}\n" if f.bin.directory?
s << " #{Utils::Shell.prepend_path_in_profile(f.opt_sbin.to_s)}\n" if f.sbin.directory?

View File

@ -28,6 +28,7 @@ module Homebrew
description: "Only show cache files for formulae."
switch "--cask",
description: "Only show cache files for casks."
conflicts "--build-from-source", "--force-bottle"
conflicts "--formula", "--cask"

View File

@ -45,7 +45,7 @@ module Homebrew
when "all"
0
else
raise UsageError, "--prune= expects an integer or 'all'."
raise UsageError, "`--prune=` expects an integer or `all`."
end
end

View File

@ -61,6 +61,7 @@ module Homebrew
switch "--cask", "--casks",
depends_on: "--installed",
description: "Treat all named arguments as casks."
conflicts "--installed", "--all"
conflicts "--formula", "--cask"
formula_options

View File

@ -57,8 +57,7 @@ module Homebrew
methods.each do |method|
$stderr.puts Formatter.headline("Checking #{method}", color: :magenta) if args.debug?
unless checks.respond_to?(method)
Homebrew.failed = true
puts "No check available by the name: #{method}"
ofail "No check available by the name: #{method}"
next
end

View File

@ -42,12 +42,10 @@ module Homebrew
switch "--[no-]quarantine",
description: "Disable/enable quarantining of downloads (default: enabled).",
env: :cask_opts_quarantine
switch "--formula", "--formulae",
description: "Treat all named arguments as formulae."
switch "--cask", "--casks",
description: "Treat all named arguments as casks."
conflicts "--formula", "--cask"
conflicts "--build-from-source", "--build-bottle", "--force-bottle"
conflicts "--cask", "--HEAD"
@ -55,6 +53,7 @@ module Homebrew
conflicts "--cask", "-s"
conflicts "--cask", "--build-bottle"
conflicts "--cask", "--force-bottle"
conflicts "--formula", "--cask"
named_args [:formula, :cask], min: 1
end
@ -97,7 +96,7 @@ module Homebrew
fetched_bottle = false
onoe e.message
opoo "Bottle fetch failed: fetching the source."
opoo "Bottle fetch failed, fetching the source instead."
else
fetched_bottle = true
end
@ -150,8 +149,8 @@ module Homebrew
def fetch_patch(p, args:)
fetch_fetchable p, args: args
rescue ChecksumMismatchError => e
Homebrew.failed = true
opoo "Patch reports different sha256: #{e.expected}"
Homebrew.failed = true
end
def retry_fetch?(f, args:)

View File

@ -103,7 +103,7 @@ module Homebrew
logs[file.basename.to_s] = { content: contents }
end
end
raise "No logs." if logs.empty?
odie "No logs." if logs.empty?
logs
end

View File

@ -20,6 +20,7 @@ module Homebrew
description: "Treat all named arguments as formulae."
switch "--cask", "--casks",
description: "Treat all named arguments as casks."
conflicts "--formula", "--cask"
named_args [:formula, :cask]

View File

@ -58,14 +58,13 @@ module Homebrew
description: "Print JSON of all available formulae."
switch "-v", "--verbose",
description: "Show more verbose analytics data for <formula>."
switch "--formula", "--formulae",
description: "Treat all named arguments as formulae."
switch "--cask", "--casks",
description: "Treat all named arguments as casks."
conflicts "--formula", "--cask"
conflicts "--installed", "--all"
conflicts "--formula", "--cask"
named_args [:formula, :cask]
end

View File

@ -146,7 +146,7 @@ module Homebrew
if args.ignore_dependencies?
opoo <<~EOS
#{Tty.bold}--ignore-dependencies is an unsupported Homebrew developer flag!#{Tty.reset}
#{Tty.bold}`--ignore-dependencies` is an unsupported Homebrew developer flag!#{Tty.reset}
Adjust your PATH to put any preferred versions of applications earlier in the
PATH rather than using this unsupported flag!
@ -183,14 +183,15 @@ module Homebrew
formulae.each do |f|
# head-only without --HEAD is an error
if !args.HEAD? && f.stable.nil?
raise <<~EOS
#{f.full_name} is a head-only formula
Install with `brew install --HEAD #{f.full_name}`
odie <<~EOS
#{f.full_name} is a head-only formula.
To install it, run:
brew install --HEAD #{f.full_name}
EOS
end
# --HEAD, fail with no head defined
raise "No head is defined for #{f.full_name}" if args.HEAD? && f.head.nil?
odie "No head is defined for #{f.full_name}" if args.HEAD? && f.head.nil?
installed_head_version = f.latest_head_version
if installed_head_version &&
@ -207,15 +208,17 @@ module Homebrew
if f.outdated?
optlinked_version = Keg.for(f.opt_prefix).version
onoe <<~EOS
#{f.full_name} #{optlinked_version} is already installed
To upgrade to #{f.version}, run `brew upgrade #{f.full_name}`
#{f.full_name} #{optlinked_version} is already installed.
To upgrade to #{f.version}, run:
brew upgrade #{f.full_name}
EOS
elsif args.only_dependencies?
installed_formulae << f
elsif !args.quiet?
opoo <<~EOS
#{f.full_name} #{f.pkg_version} is already installed and up-to-date
To reinstall #{f.pkg_version}, run `brew reinstall #{f.name}`
#{f.full_name} #{f.pkg_version} is already installed and up-to-date.
To reinstall #{f.pkg_version}, run:
brew reinstall #{f.name}
EOS
end
elsif (args.HEAD? && new_head_installed) || prefix_installed
@ -236,14 +239,15 @@ module Homebrew
nil
else
<<~EOS
#{msg}
The currently linked version is #{f.linked_version}
#{msg}.
The currently linked version is: #{f.linked_version}
EOS
end
elsif !f.linked? || f.keg_only?
msg = <<~EOS
#{msg}, it's just not linked
You can use `brew link #{f}` to link this version.
#{msg}, it's just not linked.
To link this version, run:
brew link #{f}
EOS
elsif args.only_dependencies?
msg = nil
@ -253,30 +257,36 @@ module Homebrew
nil
else
<<~EOS
#{msg} and up-to-date
To reinstall #{f.pkg_version}, run `brew reinstall #{f.name}`
#{msg} and up-to-date.
To reinstall #{f.pkg_version}, run:
brew reinstall #{f.name}
EOS
end
end
opoo msg if msg
elsif !f.any_version_installed? && old_formula = f.old_installed_formulae.first
msg = "#{old_formula.full_name} #{old_formula.any_installed_version} already installed"
if !old_formula.linked? && !old_formula.keg_only?
msg = <<~EOS
msg = if !old_formula.linked? && !old_formula.keg_only?
<<~EOS
#{msg}, it's just not linked.
You can use `brew link #{old_formula.full_name}` to link this version.
To link this version, run:
brew link #{old_formula.full_name}
EOS
elsif args.quiet?
msg = nil
nil
else
"#{msg}."
end
opoo msg if msg
elsif f.migration_needed? && !args.force?
# Check if the formula we try to install is the same as installed
# but not migrated one. If --force is passed then install anyway.
opoo <<~EOS
#{f.oldname} is already installed, it's just not migrated
You can migrate this formula with `brew migrate #{f}`
Or you can force install it with `brew install #{f} --force`
#{f.oldname} is already installed, it's just not migrated.
To migrate this formula, run:
brew migrate #{f}
Or to force-install it, run:
brew install #{f} --force
EOS
else
# If none of the above is true and the formula is linked, then

View File

@ -86,7 +86,7 @@ module Homebrew
end
if !args.force? && (formula.blank? || !formula.keg_only_reason.versioned_formula?)
opoo "#{keg.name} is keg-only and must be linked with --force"
opoo "#{keg.name} is keg-only and must be linked with `--force`."
puts_keg_only_path_message(keg)
next
end
@ -104,7 +104,7 @@ module Homebrew
puts
raise
else
puts "#{n} symlinks created"
puts "#{n} symlinks created."
end
puts_keg_only_path_message(keg) if keg_only && !Homebrew::EnvConfig.developer?

View File

@ -65,7 +65,7 @@ module Homebrew
if File.exist? "#{repo}/.git/shallow"
opoo <<~EOS
#{name} is a shallow clone so only partial output will be shown.
To get a full clone run:
To get a full clone, run:
git -C "#{git_cd}" fetch --unshallow
EOS
end

View File

@ -31,7 +31,8 @@ module Homebrew
if f.oldname
rack = HOMEBREW_CELLAR/f.oldname
raise NoSuchKegError, f.oldname if !rack.exist? || rack.subdirs.empty?
raise "#{rack} is a symlink" if rack.symlink?
odie "#{rack} is a symlink" if rack.symlink?
end
migrator = Migrator.new(f, force: args.force?)

View File

@ -28,9 +28,9 @@ module Homebrew
switch "--cask",
description: "List only outdated casks."
flag "--json",
description: "Print output in JSON format. There are two versions: v1 and v2. " \
"v1 is deprecated and is currently the default if no version is specified. " \
"v2 prints outdated formulae and casks. "
description: "Print output in JSON format. There are two versions: `v1` and `v2`. " \
"`v1` is deprecated and is currently the default if no version is specified. " \
"`v2` prints outdated formulae and casks. "
switch "--fetch-HEAD",
description: "Fetch the upstream repository to detect if the HEAD installation of the "\
"formula is outdated. Otherwise, the repository's HEAD will only be checked for "\
@ -50,7 +50,7 @@ module Homebrew
case (j = json_version(args.json))
when :v1
odisabled "brew outdated --json#{j == :v1 ? "=v1" : ""}", "brew outdated --json=v2"
odisabled "`brew outdated --json#{j == :v1 ? "=v1" : ""}`", "`brew outdated --json=v2`"
when :v2, :default
formulae, casks = if args.formula?
[outdated_formulae(args: args), []]

View File

@ -51,18 +51,18 @@ module Homebrew
description: "Search for GitHub pull requests containing <text>."
switch "--open",
depends_on: "--pull-request",
description: "Search for only open GitHub pull requests"
description: "Search for only open GitHub pull requests."
switch "--closed",
depends_on: "--pull-request",
description: "Search for only closed GitHub pull requests"
conflicts "--open", "--closed"
description: "Search for only closed GitHub pull requests."
package_manager_switches = PACKAGE_MANAGERS.keys.map { |name| "--#{name}" }
package_manager_switches.each do |s|
switch s,
description: "Search for <text> in the given package manager's list."
end
conflicts("--desc", "--pull-request")
conflicts "--desc", "--pull-request"
conflicts "--open", "--closed"
conflicts(*package_manager_switches)
# TODO: (2.9) add `min: 1` when the `odeprecated`/`odisabled` for `brew search` with no arguments is removed
@ -85,7 +85,7 @@ module Homebrew
puts Formatter.columns(Cask::Cask.to_a.map(&:full_name).sort)
else
odeprecated "'brew search' with no arguments to output formulae", "'brew formulae'"
odeprecated "`brew search` with no arguments to output formulae", "`brew formulae`"
puts Formatter.columns(Formula.full_names.sort)
end
@ -119,15 +119,11 @@ module Homebrew
print_casks = args.cask?
print_formulae = print_casks = true if !print_formulae && !print_casks
if print_formulae && all_formulae.any?
ohai "Formulae"
puts Formatter.columns(all_formulae)
end
ohai "Formulae", Formatter.columns(all_formulae) if print_formulae && all_formulae.any?
if print_casks && all_casks.any?
puts if args.formula? && all_formulae.any?
ohai "Casks"
puts Formatter.columns(all_casks)
ohai "Casks", Formatter.columns(all_casks)
end
count = all_formulae.count + all_casks.count
@ -140,7 +136,7 @@ module Homebrew
puts reason
end
raise "No formulae or casks found for #{query.inspect}." if count.zero?
odie "No formulae or casks found for #{query.inspect}." if count.zero?
end
return unless $stdout.tty?

View File

@ -27,16 +27,16 @@ module Homebrew
switch "--zap",
description: "Remove all files associated with a <cask>. " \
"*May remove files which are shared between applications.*"
conflicts "--formula", "--zap"
switch "--ignore-dependencies",
description: "Don't fail uninstall, even if <formula> is a dependency of any installed "\
"formulae."
switch "--formula", "--formulae",
description: "Treat all named arguments as formulae."
switch "--cask", "--casks",
description: "Treat all named arguments as casks."
conflicts "--formula", "--cask"
conflicts "--formula", "--zap"
named_args [:installed_formula, :installed_cask], min: 1
end

View File

@ -54,7 +54,7 @@ module Homebrew
puts <<~EOS
#{Tty.bold}Read the analytics documentation (and how to opt-out) here:
#{Formatter.url("https://docs.brew.sh/Analytics")}#{Tty.reset}
No analytics have been recorded yet (or will be during this `brew` run).
No analytics have been recorded yet (nor will be during this `brew` run).
EOS
@ -343,7 +343,7 @@ class Reporter
new_tap = Tap.fetch(new_tap_name)
new_tap.install unless new_tap.installed?
ohai "#{name} has been moved to Homebrew.", <<~EOS
To uninstall the cask run:
To uninstall the cask, run:
brew uninstall --cask --force #{name}
EOS
next if (HOMEBREW_CELLAR/new_name.split("/").last).directory?
@ -384,7 +384,7 @@ class Reporter
EOS
else
ohai "#{name} has been moved to Homebrew Cask.", <<~EOS
To uninstall the formula and install the cask run:
To uninstall the formula and install the cask, run:
brew uninstall --force #{name}
brew tap #{new_tap_name}
brew install --cask #{new_name}
@ -470,10 +470,7 @@ class ReporterHub
dump_formula_report :M, "Updated Formulae"
else
updated = select_formula(:M).count
if updated.positive?
ohai "Updated Formulae"
puts "Updated #{updated} #{"formula".pluralize(updated)}."
end
ohai "Updated Formulae", "Updated #{updated} #{"formula".pluralize(updated)}." if updated.positive?
end
dump_formula_report :R, "Renamed Formulae"
dump_formula_report :D, "Deleted Formulae"
@ -482,10 +479,7 @@ class ReporterHub
dump_formula_report :MC, "Updated Casks"
else
updated = select_formula(:MC).count
if updated.positive?
ohai "Updated Casks"
puts "Updated #{updated} #{"cask".pluralize(updated)}."
end
ohai "Updated Casks", "Updated #{updated} #{"cask".pluralize(updated)}." if updated.positive?
end
dump_formula_report :DC, "Deleted Casks"
end
@ -525,8 +519,7 @@ class ReporterHub
return if formulae.empty?
# Dump formula list.
ohai title
puts Formatter.columns(formulae.sort)
ohai title, Formatter.columns(formulae.sort)
end
def installed?(formula)

View File

@ -114,8 +114,8 @@ pop_stash() {
pop_stash_message() {
[[ -z "$STASHED" ]] && return
echo "To restore the stashed changes to $DIR run:"
echo " 'cd $DIR && git stash pop'"
echo "To restore the stashed changes to $DIR, run:"
echo " cd $DIR && git stash pop"
unset STASHED
}
@ -370,7 +370,7 @@ EOS
# we cannot install a Homebrew cURL if homebrew/core is unavailable.
if [[ ! -d "$HOMEBREW_LIBRARY/Taps/homebrew/homebrew-core" ]] || ! brew install curl
then
odie "Curl must be installed and in your PATH!"
odie "'curl' must be installed and in your PATH!"
fi
fi
@ -381,7 +381,7 @@ EOS
# we cannot install a Homebrew Git if homebrew/core is unavailable.
if [[ ! -d "$HOMEBREW_LIBRARY/Taps/homebrew/homebrew-core" ]] || ! brew install git
then
odie "Git must be installed and in your PATH!"
odie "'git' must be installed and in your PATH!"
fi
fi

View File

@ -133,7 +133,7 @@ fetch() {
odie <<EOS
Failed to download $VENDOR_URL and $VENDOR_URL2!
Do not file an issue on GitHub about this: you will need to figure out for
Do not file an issue on GitHub about this; you will need to figure out for
yourself what issue with your internet connection restricts your access to
both Bintray (used for Homebrew bottles/binary packages) and GitHub
(used for Homebrew updates).

View File

@ -56,7 +56,7 @@ HOMEBREW_CELLAR = Pathname(EnvVar["HOMEBREW_CELLAR"]).freeze
# Where downloads (bottles, source tarballs, etc.) are cached
HOMEBREW_CACHE = Pathname(EnvVar["HOMEBREW_CACHE"]).freeze
# Where brews installed via URL are cached
# Where formulae installed via URL are cached
HOMEBREW_CACHE_FORMULA = (HOMEBREW_CACHE/"Formula").freeze
# Where build, postinstall, and test logs of formulae are written to

View File

@ -43,6 +43,10 @@ module Homebrew
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 "\
"`--strict` and `--online`."
switch "--[no-]appcast",
description: "Audit the appcast."
switch "--token-conflicts",
description: "Audit for token conflicts."
flag "--tap=",
description: "Check the formulae within the given tap, specified as <user>`/`<repo>."
switch "--fix",
@ -69,25 +73,18 @@ module Homebrew
comma_array "--except-cops",
description: "Specify a comma-separated <cops> list to skip checking for violations of the listed "\
"RuboCop cops."
switch "--formula", "--formulae",
description: "Treat all named arguments as formulae."
switch "--cask", "--casks",
description: "Treat all named arguments as casks."
switch "--[no-]appcast",
description: "Audit the appcast"
switch "--token-conflicts",
description: "Audit for token conflicts"
conflicts "--formula", "--cask"
conflicts "--only", "--except"
conflicts "--only-cops", "--except-cops", "--strict"
conflicts "--only-cops", "--except-cops", "--only"
conflicts "--display-cop-names", "--skip-style"
conflicts "--display-cop-names", "--only-cops"
conflicts "--display-cop-names", "--except-cops"
conflicts "--formula", "--cask"
named_args [:formula, :cask]
end

View File

@ -400,7 +400,7 @@ module Homebrew
end
odie <<~EOS
--keep-old was passed but there are changes in:
`--keep-old` was passed but there are changes in:
#{mismatches.join("\n")}
EOS
end
@ -566,7 +566,7 @@ module Homebrew
def old_checksums(formula, formula_ast, bottle_hash, args:)
bottle_node = formula_ast.bottle_block
if bottle_node.nil?
odie "--keep-old was passed but there was no existing bottle block!" if args.keep_old?
odie "`--keep-old` was passed but there was no existing bottle block!" if args.keep_old?
return
end
return [] unless args.keep_old?
@ -576,7 +576,7 @@ module Homebrew
mismatches, checksums = merge_bottle_spec(old_keys, old_bottle_spec, bottle_hash["bottle"])
if mismatches.present?
odie <<~EOS
--keep-old was passed but there are changes in:
`--keep-old` was passed but there are changes in:
#{mismatches.join("\n")}
EOS
end

View File

@ -113,7 +113,7 @@ module Homebrew
if new_version.present?
if new_version.latest?
opoo "Ignoring specified --sha256= argument." if new_hash.present?
opoo "Ignoring specified `--sha256=` argument." if new_hash.present?
new_hash = :no_check
elsif new_hash.nil? || cask.languages.present?
tmp_contents = Utils::Inreplace.inreplace_pairs(cask.sourcefile_path,

View File

@ -110,7 +110,7 @@ module Homebrew
ohai "Fetching remote #{homebrew_core_remote}"
safe_system "git", "fetch", homebrew_core_remote, "HEAD", default_origin_branch
if quiet_system "git", "cat-file", "-e", "#{full_origin_branch}:#{formula_path}"
ohai "#{formula.full_name} exists in #{full_origin_branch}"
ohai "#{formula.full_name} exists in #{full_origin_branch}."
safe_system "git", "checkout", full_origin_branch
return tap_full_name, homebrew_core_remote, default_origin_branch, previous_branch
end
@ -196,7 +196,7 @@ module Homebrew
new_revision = Utils.popen_read("git -C \"#{resource_path}\" rev-parse -q --verify HEAD")
new_revision = new_revision.strip
elsif new_revision.blank?
odie "#{formula}: the current URL requires specifying a --revision= argument."
odie "#{formula}: the current URL requires specifying a `--revision=` argument."
end
false
elsif new_url.blank? && new_version.blank?
@ -351,7 +351,7 @@ module Homebrew
alias_rename = alias_update_pair(formula, new_formula_version)
if alias_rename.present?
ohai "renaming alias #{alias_rename.first} to #{alias_rename.last}"
ohai "Renaming alias #{alias_rename.first} to #{alias_rename.last}"
alias_rename.map! { |a| formula.tap.alias_dir/a }
end
@ -424,11 +424,11 @@ module Homebrew
return if new_mirrors.present? || old_mirrors.empty?
if args.force?
opoo "#{formula}: Removing all mirrors because a --mirror= argument was not specified."
opoo "#{formula}: Removing all mirrors because a `--mirror=` argument was not specified."
else
odie <<~EOS
#{formula}: a --mirror= argument for updating the mirror URL(s) was not specified.
Use --force to remove all mirrors.
#{formula}: a `--mirror=` argument for updating the mirror URL(s) was not specified.
Use `--force` to remove all mirrors.
EOS
end
end
@ -439,7 +439,7 @@ module Homebrew
resource.owner = Resource.new(formula.name)
forced_version = new_version && new_version != resource.version
resource.version = new_version if forced_version
odie "No --version= argument specified!" if resource.version.blank?
odie "No `--version=` argument specified!" if resource.version.blank?
[resource.fetch, forced_version]
end

View File

@ -116,9 +116,11 @@ module Homebrew
end
ohai title
puts "Current formula version: #{current_version}"
puts "Latest Repology version: #{repology_latest}"
puts "Latest livecheck version: #{livecheck_latest}"
puts "Open pull requests: #{pull_requests}"
puts <<~EOS
Current formula version: #{current_version}
Latest Repology version: #{repology_latest}
Latest livecheck version: #{livecheck_latest}
Open pull requests: #{pull_requests}
EOS
end
end

View File

@ -19,6 +19,7 @@ module Homebrew
description: "Treat all named arguments as formulae."
switch "--cask", "--casks",
description: "Treat all named arguments as casks."
conflicts "--formula", "--cask"
named_args [:formula, :cask], number: 1

View File

@ -145,7 +145,7 @@ module Homebrew
fc.tap = Tap.fetch(args.tap || "homebrew/core")
raise TapUnavailableError, args.tap unless fc.tap.installed?
fc.url = args.named.first # Pull the first (and only) url from ARGV
fc.url = args.named.first # Pull the first (and only) URL from ARGV
fc.mode = if args.autotools?
:autotools
@ -180,7 +180,7 @@ module Homebrew
# unless --force is specified.
unless args.force?
if reason = MissingFormula.disallowed_reason(fc.name)
raise <<~EOS
odie <<~EOS
The formula '#{fc.name}' is not allowed to be created.
#{reason}
If you really want to create this formula use `--force`.
@ -189,7 +189,7 @@ module Homebrew
if Formula.aliases.include? fc.name
realname = Formulary.canonical_name(fc.name)
raise <<~EOS
odie <<~EOS
The formula '#{realname}' is already aliased to '#{fc.name}'.
Please check that you are not creating a duplicate.
To force creation use `--force`.

View File

@ -21,6 +21,7 @@ module Homebrew
description: "Treat all named arguments as formulae."
switch "--cask", "--casks",
description: "Treat all named arguments as casks."
conflicts "--formula", "--cask"
named_args [:formula, :cask]
@ -32,7 +33,7 @@ module Homebrew
args = edit_args.parse
unless (HOMEBREW_REPOSITORY/".git").directory?
raise <<~EOS
odie <<~EOS
Changes will be lost!
The first time you `brew update`, all local changes will be lost; you should
thus `brew update` before you `brew edit`!
@ -44,10 +45,10 @@ module Homebrew
raise UsageError, "#{path} doesn't exist on disk. " \
"Run #{Formatter.identifier("brew create --set-name #{path.basename} $URL")} " \
"to create a new Formula!"
"to create a new formula!"
end.presence
# If no brews are listed, open the project root in an editor.
# If no formulae are listed, open the project root in an editor.
paths ||= [HOMEBREW_REPOSITORY]
exec_editor(*paths)

View File

@ -214,8 +214,7 @@ module Homebrew
odebug "Overwriting existing formula at #{path}"
path.delete
end
ohai "Writing formula for #{name} from revision #{rev} to:"
puts path
ohai "Writing formula for #{name} from revision #{rev} to:", path
path.write result
end

View File

@ -40,10 +40,12 @@ module Homebrew
args = irb_args.parse(ARGV.dup.freeze)
if args.examples?
puts "'v8'.f # => instance of the v8 formula"
puts ":hub.f.latest_version_installed?"
puts ":lua.f.methods - 1.methods"
puts ":mpd.f.recursive_dependencies.reject(&:installed?)"
puts <<~EOS
'v8'.f # => instance of the v8 formula
:hub.f.latest_version_installed?
:lua.f.methods - 1.methods
:mpd.f.recursive_dependencies.reject(&:installed?)
EOS
return
end
@ -59,8 +61,7 @@ module Homebrew
require "keg"
require "cask"
ohai "Interactive Homebrew Shell"
puts "Example commands available with: brew irb --examples"
ohai "Interactive Homebrew Shell", "Example commands available with: `brew irb --examples`"
if args.pry?
Pry.start
else

View File

@ -44,6 +44,7 @@ module Homebrew
description: "Only check formulae."
switch "--cask", "--casks",
description: "Only check casks."
conflicts "--debug", "--json"
conflicts "--tap=", "--all", "--installed"
conflicts "--cask", "--formula"

View File

@ -22,7 +22,7 @@ module Homebrew
description <<~EOS
Generate Homebrew's manpages.
Not (yet) working on Apple Silicon.
*Note:* Not (yet) working on Apple Silicon.
EOS
switch "--fail-if-changed",
description: "Return a failing status code if changes are detected in the manpage outputs. This "\

View File

@ -49,7 +49,7 @@ module Homebrew
_, user, repo, issue = *url_match
odie "Not a GitHub pull request: #{arg}" unless issue
if args.tap.present? && !"#{user}/#{repo}".casecmp(tap.full_name).zero?
odie "Pull request URL is for #{user}/#{repo} but --tap=#{tap.full_name}!"
odie "Pull request URL is for #{user}/#{repo} but `--tap=#{tap.full_name}` was specified!"
end
ohai "Dispatching #{tap} pull request ##{issue}"

View File

@ -340,7 +340,7 @@ module Homebrew
end
def download_artifact(url, dir, pr)
raise "Credentials must be set to access the Artifacts API" if GitHub.api_credentials_type == :none
odie "Credentials must be set to access the Artifacts API" if GitHub.api_credentials_type == :none
token = GitHub.api_credentials
curl_args = ["--header", "Authorization: token #{token}"]
@ -414,7 +414,7 @@ module Homebrew
workflow_run.first.blank?
# Ignore that workflow as it was not executed and we specified
# that we could skip it.
ohai "Ignoring workflow #{workflow} as requested by --ignore-missing-artifacts"
ohai "Ignoring workflow #{workflow} as requested by `--ignore-missing-artifacts`"
next
end

View File

@ -81,8 +81,11 @@ module Homebrew
else
"Bintray"
end
puts "brew #{bottle_args.join " "}"
puts "Upload bottles described by these JSON files to #{service}:\n #{json_files.join("\n ")}"
puts <<~EOS
brew #{bottle_args.join " "}
Upload bottles described by these JSON files to #{service}:
#{json_files.join("\n ")}
EOS
return
end

View File

@ -37,7 +37,7 @@ module Homebrew
branch = args.branch || "main"
tap = args.named.to_taps.first
raise "Invalid tap name '#{tap_name}'" unless tap.path.to_s.match?(HOMEBREW_TAP_PATH_REGEX)
odie "Invalid tap name '#{tap_name}'" unless tap.path.to_s.match?(HOMEBREW_TAP_PATH_REGEX)
titleized_user = tap.user.dup
titleized_repo = tap.repo.dup
@ -169,7 +169,7 @@ module Homebrew
def write_path(tap, filename, content)
path = tap.path/filename
tap.path.mkpath
raise "#{path} already exists" if path.exist?
odie "#{path} already exists" if path.exist?
path.write content
end

View File

@ -23,8 +23,8 @@ module Homebrew
switch "--update",
description: "Update RBI files."
switch "--suggest-typed",
description: "Try upgrading `typed` sigils.",
depends_on: "--update"
depends_on: "--update",
description: "Try upgrading `typed` sigils."
switch "--fail-if-not-changed",
description: "Return a failing status code if all gems are up to date " \
"and gem definitions do not need a tapioca update."

View File

@ -13,14 +13,15 @@ module Homebrew
def unbottled_args
Homebrew::CLI::Parser.new do
description <<~EOS
Outputs the unbottled dependents of formulae.
Show the unbottled dependents of formulae.
EOS
flag "--tag=",
description: "Use the specified bottle tag (e.g. big_sur) instead of the current OS."
description: "Use the specified bottle tag (e.g. `big_sur`) instead of the current OS."
switch "--dependents",
description: "Don't get analytics data and sort by number of dependents instead."
description: "Skip getting analytics data and sort by number of dependents instead."
switch "--total",
description: "Output the number of unbottled and total formulae."
description: "Print the number of unbottled and total formulae."
conflicts "--dependents", "--total"
named_args :formula

View File

@ -45,13 +45,13 @@ module Homebrew
unpack_dir = Pathname.pwd
end
raise "Cannot write to #{unpack_dir}" unless unpack_dir.writable_real?
odie "Cannot write to #{unpack_dir}" unless unpack_dir.writable_real?
formulae.each do |f|
stage_dir = unpack_dir/"#{f.name}-#{f.version}"
if stage_dir.exist?
raise "Destination #{stage_dir} already exists!" unless args.force?
odie "Destination #{stage_dir} already exists!" unless args.force?
rm_rf stage_dir
end
@ -68,7 +68,7 @@ module Homebrew
next unless args.git?
ohai "Setting up git repository"
ohai "Setting up Git repository"
cd stage_dir
system "git", "init", "-q"
system "git", "add", "-A"

View File

@ -95,8 +95,10 @@ module Homebrew
end
end
puts "Start commit: #{start_commit}"
puts " End commit: #{end_commit}"
puts <<~EOS
Start commit: #{start_commit}
End commit: #{end_commit}
EOS
mkdir "update-test"
chdir "update-test" do
@ -127,15 +129,15 @@ module Homebrew
quiet_system "brew", "help"
# run brew update
oh1 "Running brew update..."
oh1 "Running `brew update`..."
safe_system "brew", "update", "--verbose", "--debug"
actual_end_commit = Utils.popen_read("git", "rev-parse", branch).chomp
if actual_end_commit != end_commit
start_log = Utils.popen_read("git", "log", "-1", "--decorate", "--oneline", start_commit).chomp
end_log = Utils.popen_read("git", "log", "-1", "--decorate", "--oneline", end_commit).chomp
actual_log = Utils.popen_read("git", "log", "-1", "--decorate", "--oneline", actual_end_commit).chomp
raise <<~EOS
brew update didn't update #{branch}!
odie <<~EOS
`brew update` didn't update #{branch}!
Start commit: #{start_log}
Expected end commit: #{end_log}
Actual end commit: #{actual_log}

View File

@ -264,11 +264,11 @@ module Homebrew
]
__check_stray_files "/usr/local/lib/pkgconfig", "*.pc", allow_list, <<~EOS
Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
Unbrewed '.pc' files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected .pc files:
Unexpected '.pc' files:
EOS
end
@ -285,11 +285,11 @@ module Homebrew
]
__check_stray_files "/usr/local/lib", "*.la", allow_list, <<~EOS
Unbrewed .la files were found in /usr/local/lib.
Unbrewed '.la' files were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected .la files:
Unexpected '.la' files:
EOS
end
@ -335,7 +335,8 @@ module Homebrew
<<~EOS
#{HOMEBREW_TEMP} is world-writable but does not have the sticky bit set.
Please execute `sudo chmod +t #{HOMEBREW_TEMP}` in your Terminal.
To set it, run the following command:
sudo chmod +t #{HOMEBREW_TEMP}
EOS
end
alias generic_check_tmpdir_sticky_bit check_tmpdir_sticky_bit
@ -350,7 +351,7 @@ module Homebrew
The following directories do not exist:
#{not_exist_dirs.join("\n")}
You should create these directories and change their ownership to your account.
You should create these directories and change their ownership to your user.
sudo mkdir -p #{not_exist_dirs.join(" ")}
sudo chown -R $(whoami) #{not_exist_dirs.join(" ")}
EOS
@ -404,7 +405,7 @@ module Homebrew
unless conflicts.empty?
message = inject_file_list conflicts, <<~EOS
/usr/bin occurs before #{HOMEBREW_PREFIX}/bin
/usr/bin occurs before #{HOMEBREW_PREFIX}/bin in your PATH.
This means that system-provided programs will be used instead of those
provided by Homebrew. Consider setting your PATH so that
#{HOMEBREW_PREFIX}/bin occurs before /usr/bin. Here is a one-liner:
@ -428,8 +429,8 @@ module Homebrew
return if @seen_prefix_bin
<<~EOS
Homebrew's bin was not found in your PATH.
Consider setting the PATH for example like so:
Homebrew's "bin" was not found in your PATH.
Consider setting your PATH for example like so:
#{Utils::Shell.prepend_path_in_profile("#{HOMEBREW_PREFIX}/bin")}
EOS
end
@ -444,9 +445,9 @@ module Homebrew
return if sbin.children.one? && sbin.children.first.basename.to_s == ".keepme"
<<~EOS
Homebrew's sbin was not found in your PATH but you have installed
Homebrew's "sbin" was not found in your PATH but you have installed
formulae that put executables in #{HOMEBREW_PREFIX}/sbin.
Consider setting the PATH for example like so:
Consider setting your PATH for example like so:
#{Utils::Shell.prepend_path_in_profile("#{HOMEBREW_PREFIX}/sbin")}
EOS
end
@ -715,7 +716,7 @@ module Homebrew
return if (paths & gnubin).empty?
<<~EOS
Putting non-prefixed coreutils in your path can cause gmp builds to fail.
Putting non-prefixed coreutils in your path can cause GMP builds to fail.
EOS
rescue FormulaUnavailableError
nil
@ -725,7 +726,7 @@ module Homebrew
return unless File.exist? "#{ENV["HOME"]}/.pydistutils.cfg"
<<~EOS
A .pydistutils.cfg file was found in $HOME, which may cause Python
A '.pydistutils.cfg' file was found in $HOME, which may cause Python
builds to fail. See:
#{Formatter.url("https://bugs.python.org/issue6138")}
#{Formatter.url("https://bugs.python.org/issue4655")}
@ -767,7 +768,7 @@ module Homebrew
inject_file_list unlinked, <<~EOS
You have unlinked kegs in your Cellar.
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
Leaving kegs unlinked can lead to build-trouble and cause formulae that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
EOS
end
@ -897,7 +898,8 @@ module Homebrew
<<~EOS
The staging path #{user_tilde(path.to_s)} is not writable by the current user.
To fix, run \'sudo chown -R $(whoami):staff #{user_tilde(path.to_s)}'
To fix, run:
sudo chown -R $(whoami):staff #{user_tilde(path.to_s)}
EOS
end
@ -970,16 +972,18 @@ module Homebrew
if result.include? "Python 2.7"
<<~EOS
Your Python installation has a broken version of setuptools.
To fix, reinstall macOS or run 'sudo /usr/bin/python -m pip install -I setuptools'.
To fix, reinstall macOS or run:
sudo /usr/bin/python -m pip install -I setuptools
EOS
else
<<~EOS
The system Python version is wrong.
To fix, run 'defaults write com.apple.versioner.python Version 2.7'.
To fix, run:
defaults write com.apple.versioner.python Version 2.7
EOS
end
elsif result.stderr.include? "pkg_resources.DistributionNotFound"
"Your Python installation is unable to find xattr."
"Your Python installation is unable to find `xattr`."
else
"unknown xattr error: #{result.stderr.split("\n").last}"
end
@ -990,7 +994,7 @@ module Homebrew
when :quarantine_available
nil
when :xattr_broken
"There's not a working version of xattr."
"There's no working version of `xattr` on this system."
when :no_swift
"Swift is not available on this system."
when :no_quarantine

View File

@ -16,8 +16,8 @@ module Homebrew
default: "native",
},
HOMEBREW_ARTIFACT_DOMAIN: {
description: "Prefix all download URLs, including those for bottles, with this " \
"variable. For example, `HOMEBREW_ARTIFACT_DOMAIN=http://localhost:8080` will cause a " \
description: "Prefix all download URLs, including those for bottles, with this value. " \
"For example, `HOMEBREW_ARTIFACT_DOMAIN=http://localhost:8080` will cause a " \
"formula with the URL `https://example.com/foo.tar.gz` to instead download from " \
"`http://localhost:8080/example.com/foo.tar.gz`.",
},
@ -241,7 +241,7 @@ module Homebrew
HOMEBREW_NO_INSTALL_CLEANUP: {
description: "If set, `brew install`, `brew upgrade` and `brew reinstall` will never automatically " \
"cleanup installed/upgraded/reinstalled formulae or all formulae every " \
"HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS days.",
"`HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS` days.",
boolean: true,
},
HOMEBREW_PRY: {

View File

@ -384,8 +384,8 @@ class FormulaUnknownPythonError < RuntimeError
The version of Python to use with the virtualenv in the `#{formula.full_name}` formula
cannot be guessed automatically because a recognised Python dependency could not be found.
If you are using a non-standard Python depedency, please add `:using => "python@x.y"` to
`virtualenv_install_with_resources` to resolve the issue manually.
If you are using a non-standard Python dependency, please add `:using => "python@x.y"`
to 'virtualenv_install_with_resources' to resolve the issue manually.
EOS
end
end
@ -394,10 +394,11 @@ end
class FormulaAmbiguousPythonError < RuntimeError
def initialize(formula)
super <<~EOS
The version of python to use with the virtualenv in the `#{formula.full_name}` formula
cannot be guessed automatically. If the simultaneous use of multiple pythons
is intentional, please add `:using => "python@x.y"` to
`virtualenv_install_with_resources` to resolve the ambiguity manually.
The version of Python to use with the virtualenv in the `#{formula.full_name}` formula
cannot be guessed automatically.
If the simultaneous use of multiple Pythons is intentional, please add `:using => "python@x.y"`
to 'virtualenv_install_with_resources' to resolve the ambiguity manually.
EOS
end
end

View File

@ -276,14 +276,13 @@ module SharedEnvExtension
flags = []
if fc
ohai "Building with an alternative Fortran compiler"
puts "This is unsupported."
ohai "Building with an alternative Fortran compiler", "This is unsupported."
self["F77"] ||= fc
else
if (gfortran = which("gfortran", (HOMEBREW_PREFIX/"bin").to_s))
ohai "Using Homebrew-provided Fortran compiler."
ohai "Using Homebrew-provided Fortran compiler"
elsif (gfortran = which("gfortran", PATH.new(ORIGINAL_PATHS)))
ohai "Using a Fortran compiler found at #{gfortran}."
ohai "Using a Fortran compiler found at #{gfortran}"
end
if gfortran
puts "This may be changed by setting the FC environment variable."

View File

@ -7,7 +7,7 @@ module OnOS
# # Do something Mac-specific
# end</pre>
def on_macos(&block)
raise "No block content defined for on_macos block" unless block
raise "No block content defined for 'on_macos' block" unless block
end
# Block only executed on Linux. No-op on macOS.
@ -15,7 +15,7 @@ module OnOS
# # Do something Linux-specific
# end</pre>
def on_linux(&block)
raise "No block content defined for on_linux block" unless block
raise "No block content defined for 'on_linux' block" unless block
end
end

View File

@ -3,7 +3,7 @@
module OnOS
def on_linux(&block)
raise "No block content defined for on_linux block" unless block
raise "No block content defined for 'on_linux' block" unless block
yield
end

View File

@ -3,7 +3,7 @@
module OnOS
def on_macos(&block)
raise "No block content defined for on_macos block" unless block
raise "No block content defined for 'on_macos' block" unless block
yield
end

View File

@ -100,13 +100,13 @@ class Pathname
src.resource.stage { install(*src.files) }
when Array
if src.empty?
opoo "tried to install empty array to #{self}"
opoo "Tried to install empty array to #{self}"
break
end
src.each { |s| install_p(s, File.basename(s)) }
when Hash
if src.empty?
opoo "tried to install empty hash to #{self}"
opoo "Tried to install empty hash to #{self}"
break
end
src.each { |s, new_basename| install_p(s, new_basename) }
@ -372,7 +372,7 @@ class Pathname
def write_exec_script(*targets)
targets.flatten!
if targets.empty?
opoo "tried to write exec scripts to #{self} for an empty list of targets"
opoo "Tried to write exec scripts to #{self} for an empty list of targets"
return
end
mkpath

View File

@ -828,7 +828,7 @@ class Formula
HOMEBREW_PREFIX/"var"
end
# The directory where the formula's ZSH function files should be
# The directory where the formula's zsh function files should be
# installed.
# This is symlinked into `HOMEBREW_PREFIX` after installation or with
# `brew link` for formulae that are not keg-only.
@ -852,7 +852,7 @@ class Formula
prefix/"etc/bash_completion.d"
end
# The directory where the formula's ZSH completion files should be
# The directory where the formula's zsh completion files should be
# installed.
# This is symlinked into `HOMEBREW_PREFIX` after installation or with
# `brew link` for formulae that are not keg-only.
@ -1705,7 +1705,7 @@ class Formula
deps ||= declared_runtime_dependencies unless undeclared
deps ||= (declared_runtime_dependencies | undeclared_runtime_dependencies)
rescue FormulaUnavailableError
onoe "could not get runtime dependencies from #{path}!"
onoe "Could not get runtime dependencies from #{path}!"
deps ||= []
end
deps

View File

@ -221,13 +221,13 @@ module Homebrew
# Don't complain about missing cross-tap dependencies
next
rescue FormulaUnavailableError
problem "Can't find dependency #{dep.name.inspect}."
problem "Can't find dependency '#{dep.name.inspect}'."
next
rescue TapFormulaAmbiguityError
problem "Ambiguous dependency #{dep.name.inspect}."
problem "Ambiguous dependency '#{dep.name.inspect}'."
next
rescue TapFormulaWithOldnameAmbiguityError
problem "Ambiguous oldname dependency #{dep.name.inspect}."
problem "Ambiguous oldname dependency '#{dep.name.inspect}'."
next
end
@ -258,10 +258,10 @@ module Homebrew
end
end
problem "Dependency #{dep} does not define option #{opt.name.inspect}"
problem "Dependency '#{dep}' does not define option #{opt.name.inspect}"
end
problem "Don't use git as a dependency (it's always available)" if @new_formula && dep.name == "git"
problem "Don't use 'git' as a dependency (it's always available)" if @new_formula && dep.name == "git"
problem "Dependency '#{dep.name}' is marked as :run. Remove :run; it is a no-op." if dep.tags.include?(:run)

View File

@ -19,7 +19,7 @@ module FormulaCellarChecks
return if ORIGINAL_PATHS.include? prefix_bin
<<~EOS
#{prefix_bin} is not in your PATH
"#{prefix_bin}" is not in your PATH.
You can amend this by altering your #{Utils::Shell.profile} file.
EOS
end
@ -29,9 +29,9 @@ module FormulaCellarChecks
return unless (formula.prefix/"man").directory?
<<~EOS
A top-level "man" directory was found
Homebrew requires that man pages live under share.
This can often be fixed by passing "--mandir=\#{man}" to configure.
A top-level "man" directory was found.
Homebrew requires that man pages live under "share".
This can often be fixed by passing `--mandir=\#{man}` to `configure`.
EOS
end
@ -40,9 +40,9 @@ module FormulaCellarChecks
return unless (formula.prefix/"info").directory?
<<~EOS
A top-level "info" directory was found
Homebrew suggests that info pages live under share.
This can often be fixed by passing "--infodir=\#{info}" to configure.
A top-level "info" directory was found.
Homebrew suggests that info pages live under "share".
This can often be fixed by passing `--infodir=\#{info}` to `configure`.
EOS
end
@ -53,11 +53,11 @@ module FormulaCellarChecks
return if jars.empty?
<<~EOS
JARs were installed to "#{formula.lib}"
JARs were installed to "#{formula.lib}".
Installing JARs to "lib" can cause conflicts between packages.
For Java software, it is typically better for the formula to
install to "libexec" and then symlink or wrap binaries into "bin".
See "activemq", "jruby", etc. for examples.
See formulae 'activemq', 'jruby', etc. for examples.
The offending files are:
#{jars * "\n "}
EOS
@ -81,7 +81,7 @@ module FormulaCellarChecks
return if non_libraries.empty?
<<~EOS
Non-libraries were installed to "#{formula.lib}"
Non-libraries were installed to "#{formula.lib}".
Installing non-libraries to "lib" is discouraged.
The offending files are:
#{non_libraries * "\n "}
@ -95,7 +95,7 @@ module FormulaCellarChecks
return if non_exes.empty?
<<~EOS
Non-executables were installed to "#{bin}"
Non-executables were installed to "#{bin}".
The offending files are:
#{non_exes * "\n "}
EOS
@ -109,11 +109,10 @@ module FormulaCellarChecks
return if generics.empty?
<<~EOS
Generic binaries were installed to "#{bin}"
Binaries with generic names are likely to conflict with other software,
and suggest that this software should be installed to "libexec" and then
Generic binaries were installed to "#{bin}".
Binaries with generic names are likely to conflict with other software.
Homebrew suggests that this software is installed to "libexec" and then
symlinked as needed.
The offending files are:
#{generics * "\n "}
EOS
@ -124,9 +123,9 @@ module FormulaCellarChecks
return if pth_found.empty?
<<~EOS
easy-install.pth files were found
These .pth files are likely to cause link conflicts. Please invoke
setup.py using Language::Python.setup_install_args.
'easy-install.pth' files were found.
These '.pth' files are likely to cause link conflicts.
Please invoke `setup.py` using 'Language::Python.setup_install_args'.
The offending files are:
#{pth_found * "\n "}
EOS
@ -144,7 +143,7 @@ module FormulaCellarChecks
return unless bad_dir_name
<<~EOS
Emacs Lisp files were installed into the wrong site-lisp subdirectory.
Emacs Lisp files were installed into the wrong "site-lisp" subdirectory.
They should be installed into:
#{share}/emacs/site-lisp/#{name}
EOS
@ -161,11 +160,10 @@ module FormulaCellarChecks
return if elisps.empty?
<<~EOS
Emacs Lisp files were linked directly to #{HOMEBREW_PREFIX}/share/emacs/site-lisp
Emacs Lisp files were linked directly to "#{HOMEBREW_PREFIX}/share/emacs/site-lisp".
This may cause conflicts with other packages.
They should instead be installed into:
#{share}/emacs/site-lisp/#{name}
The offending files are:
#{elisps * "\n "}
EOS
@ -251,7 +249,7 @@ module FormulaCellarChecks
Dir.chdir("/") do
unless File.exist?(program_location)
return <<~EOS
The plist #{key} does not exist:
The plist "#{key}" does not exist:
#{program_location}
EOS
end
@ -260,7 +258,7 @@ module FormulaCellarChecks
end
<<~EOS
The plist #{key} is not executable:
The plist "#{key}" is not executable:
#{program_location}
EOS
end
@ -274,7 +272,7 @@ module FormulaCellarChecks
link.exist? && File.realpath(link).start_with?(HOMEBREW_CELLAR/name)
end
"Python formulae that are keg-only should not create `pip3` and `wheel3` symlinks"
"Python formulae that are keg-only should not create `pip3` and `wheel3` symlinks."
end
def audit_installed

View File

@ -362,14 +362,16 @@ class FormulaInstaller
EOS
if formula.outdated? && !formula.head?
message += <<~EOS
To upgrade to #{formula.pkg_version}, run `brew upgrade #{formula.full_name}`.
To upgrade to #{formula.pkg_version}, run:
brew upgrade #{formula.full_name}
EOS
elsif only_deps?
message = nil
else
# some other version is already installed *and* linked
message += <<~EOS
To install #{formula.pkg_version}, first run `brew unlink #{formula.name}`.
To install #{formula.pkg_version}, first run:
brew unlink #{formula.name}
EOS
end
raise CannotInstallFormulaError, message if message
@ -804,8 +806,9 @@ class FormulaInstaller
fix_dynamic_linkage(keg) if !@poured_bottle || !formula.bottle_specification.skip_relocation?
if build_bottle?
ohai "Not running post_install as we're building a bottle"
puts "You can run it manually using `brew postinstall #{formula.full_name}`"
ohai "Not running 'post_install' as we're building a bottle"
puts "You can run it manually using:"
puts " brew postinstall #{formula.full_name}"
else
post_install
end
@ -951,10 +954,9 @@ class FormulaInstaller
begin
keg.optlink(verbose: verbose?)
rescue Keg::LinkError => e
onoe "Failed to create #{formula.opt_prefix}"
ofail "Failed to create #{formula.opt_prefix}"
puts "Things that depend on #{formula.full_name} will probably not build."
puts e
Homebrew.failed = true
end
return
end
@ -991,25 +993,23 @@ class FormulaInstaller
link_overwrite_backup[conflict_file] = backup_file
retry
end
onoe "The `brew link` step did not complete successfully"
ofail "The `brew link` step did not complete successfully"
puts "The formula built, but is not symlinked into #{HOMEBREW_PREFIX}"
puts e
puts
puts "Possible conflicting files are:"
keg.link(dry_run: true, overwrite: true, verbose: verbose?)
@show_summary_heading = true
Homebrew.failed = true
rescue Keg::LinkError => e
onoe "The `brew link` step did not complete successfully"
ofail "The `brew link` step did not complete successfully"
puts "The formula built, but is not symlinked into #{HOMEBREW_PREFIX}"
puts e
puts
puts "You can try again using:"
puts " brew link #{formula.name}"
@show_summary_heading = true
Homebrew.failed = true
rescue Exception => e # rubocop:disable Lint/RescueException
onoe "An unexpected error occurred during the `brew link` step"
ofail "An unexpected error occurred during the `brew link` step"
puts "The formula built, but is not symlinked into #{HOMEBREW_PREFIX}"
puts e
puts e.backtrace if debug?
@ -1021,16 +1021,15 @@ class FormulaInstaller
FileUtils.mv backup, origin
end
end
Homebrew.failed = true
raise
end
return if link_overwrite_backup.empty?
opoo "These files were overwritten during `brew link` step:"
opoo "These files were overwritten during the `brew link` step:"
puts link_overwrite_backup.keys
puts
puts "They have been backed up in #{backup_dir}"
puts "They have been backed up to: #{backup_dir}"
@show_summary_heading = true
end
@ -1043,20 +1042,18 @@ class FormulaInstaller
log = formula.var/"log"
log.mkpath if formula.plist.include? log.to_s
rescue Exception => e # rubocop:disable Lint/RescueException
onoe "Failed to install plist file"
ofail "Failed to install plist file"
odebug e, e.backtrace
Homebrew.failed = true
end
sig { params(keg: Keg).void }
def fix_dynamic_linkage(keg)
keg.fix_dynamic_linkage
rescue Exception => e # rubocop:disable Lint/RescueException
onoe "Failed to fix install linkage"
ofail "Failed to fix install linkage"
puts "The formula built, but you may encounter issues using it or linking other"
puts "formulae against it."
odebug e, e.backtrace
Homebrew.failed = true
@show_summary_heading = true
end
@ -1066,7 +1063,7 @@ class FormulaInstaller
Cleaner.new(formula).clean
rescue Exception => e # rubocop:disable Lint/RescueException
opoo "The cleaning step did not complete successfully"
puts "Still, the installation was successful, so we will link it into your prefix"
puts "Still, the installation was successful, so we will link it into your prefix."
odebug e, e.backtrace
Homebrew.failed = true
@show_summary_heading = true
@ -1103,7 +1100,8 @@ class FormulaInstaller
end
rescue Exception => e # rubocop:disable Lint/RescueException
opoo "The post-install step did not complete successfully"
puts "You can try again using `brew postinstall #{formula.full_name}`"
puts "You can try again using:"
puts " brew postinstall #{formula.full_name}"
odebug e, e.backtrace, always_display: Homebrew::EnvConfig.developer?
Homebrew.failed = true
@show_summary_heading = true

View File

@ -50,7 +50,7 @@ class FormulaVersions
rescue *IGNORED_EXCEPTIONS => e
# We rescue these so that we can skip bad versions and
# continue walking the history
odebug "#{e} in #{name} at revision #{rev}", e.backtrace if debug?
odebug "#{e} in #{name} at revision #{rev}", e.backtrace
rescue FormulaUnavailableError
nil
ensure
@ -69,7 +69,7 @@ class FormulaVersions
end
return map if versions_seen > MAX_VERSIONS_DEPTH
rescue MacOSVersionError => e
odebug "#{e} in #{name} at revision #{rev}" if debug?
odebug "#{e} in #{name} at revision #{rev}"
break
end
map

View File

@ -225,10 +225,10 @@ module Formulary
def load_file(flags:)
if %r{githubusercontent.com/[\w-]+/[\w-]+/[a-f0-9]{40}(?:/Formula)?/(?<formula_name>[\w+-.@]+).rb} =~ url # rubocop:disable Style/CaseLikeIf
raise UsageError, "Installation of #{formula_name} from a GitHub commit URL is unsupported! " \
"'brew extract #{formula_name}' to stable tap on GitHub instead."
"`brew extract #{formula_name}` to a stable tap on GitHub instead."
elsif url.match?(%r{^(https?|ftp)://})
raise UsageError, "Non-checksummed download of #{name} formula file from an arbitrary URL is unsupported! ",
"'brew extract' or 'brew create' and 'brew tap-new' to create a "\
"`brew extract` or `brew create` and `brew tap-new` to create a "\
"formula file in a tap on GitHub instead."
end
HOMEBREW_CACHE_FORMULA.mkpath

View File

@ -603,7 +603,7 @@ class Keg
begin
keg = Keg.for(src)
rescue NotAKegError
puts "Won't resolve conflicts for symlink #{dst} as it doesn't resolve into the Cellar" if verbose
puts "Won't resolve conflicts for symlink #{dst} as it doesn't resolve into the Cellar." if verbose
return
end

View File

@ -15,9 +15,9 @@ module Language
def self.stage_deps(resources, target)
if resources.empty?
if Homebrew::EnvConfig.developer?
odie "tried to stage empty Language::Go resources array"
odie "Tried to stage empty Language::Go resources array"
else
opoo "tried to stage empty Language::Go resources array"
opoo "Tried to stage empty Language::Go resources array"
end
end
resources.grep(Resource::Go) { |resource| resource.stage(target) }

View File

@ -492,7 +492,7 @@ module Homebrew
end
if livecheck_strategy.present? && livecheck_url.blank?
odebug "#{strategy_name} strategy requires a url"
odebug "#{strategy_name} strategy requires a URL"
next
end

View File

@ -104,7 +104,7 @@ can take several different forms:
* An arbitrary file:
Homebrew can install formulae from a local path. It can point to either a
formula file or a bottle.
Prefix relative paths with `./` to prevent them being interpreted as a
Prefix relative paths with `./` to prevent them from being interpreted as a
formula or tap name.
## SPECIFYING CASKS

View File

@ -17,8 +17,8 @@ class Migrator
class MigrationNeededError < RuntimeError
def initialize(formula)
super <<~EOS
#{formula.oldname} was renamed to #{formula.name} and needs to be migrated.
Please run `brew migrate #{formula.oldname}`
#{formula.oldname} was renamed to #{formula.name} and needs to be migrated by running:
brew migrate #{formula.oldname}
EOS
end
end
@ -48,7 +48,8 @@ class Migrator
super <<~EOS
#{formula.name} from #{formula.tap} is given, but old name #{formula.oldname} was installed from #{tap || "path or url"}.
#{msg}To force migration use `brew migrate --force #{formula.oldname}`.
#{msg}To force migration, run:
brew migrate --force #{formula.oldname}
EOS
end
end
@ -220,7 +221,7 @@ class Migrator
rescue Interrupt
ignore_interrupts { backup_oldname }
rescue Exception => e # rubocop:disable Lint/RescueException
onoe "Error occurred while migrating."
onoe "The migration did not complete successfully."
puts e
puts e.backtrace if debug?
puts "Backing up..."
@ -314,14 +315,14 @@ class Migrator
begin
new_keg.link(overwrite: true, verbose: verbose?)
rescue Keg::ConflictError => e
onoe "Error while executing `brew link` step on #{newname}"
onoe "The `brew link` step did not complete successfully."
puts e
puts
puts "Possible conflicting files are:"
new_keg.link(dry_run: true, overwrite: true, verbose: verbose?)
raise
rescue Keg::LinkError => e
onoe "Error while linking"
onoe "The `brew link` step did not complete successfully."
puts e
puts
puts "You can try again using:"

View File

@ -141,7 +141,7 @@ module Homebrew
ohai "Searching for a previously deleted formula (in the last month)..."
if (tap.path/".git/shallow").exist?
opoo <<~EOS
#{tap} is shallow clone. To get complete history run:
#{tap} is shallow clone. To get its complete history, run:
git -C "$(brew --repo #{tap})" fetch --unshallow
EOS
@ -168,10 +168,10 @@ module Homebrew
#{name} was deleted from #{tap.name} in commit #{short_hash}:
#{commit_message}
To show the formula before removal run:
To show the formula before removal, run:
git -C "$(brew --repo #{tap})" show #{short_hash}^:#{relative_path}
If you still use this formula consider creating your own tap:
If you still use this formula, consider creating your own tap:
#{Formatter.url("https://docs.brew.sh/How-to-Create-and-Maintain-a-Tap")}
EOS
end

View File

@ -65,9 +65,6 @@ class Mktemp
ignore_interrupts { rm_rf(tmpdir) } unless retain?
end
ensure
if retain? && !@tmpdir.nil? && !@quiet
ohai "Kept temporary files"
puts "Temporary files retained at #{@tmpdir}"
end
ohai "Temporary files retained at:", @tmpdir.to_s if retain? && !@tmpdir.nil? && !@quiet
end
end

View File

@ -160,7 +160,7 @@ module ELFShim
def save_using_patchelf(new_interpreter, new_rpath)
patchelf = DevelopmentTools.locate "patchelf"
odie "Could not locate patchelf, please: brew install patchelf." if patchelf.blank?
odie "Could not locate `patchelf`; please run `brew install patchelf`" if patchelf.blank?
args = []
args << "--set-interpreter" << new_interpreter if new_interpreter.present?
args << "--force-rpath" << "--set-rpath" << new_rpath if new_rpath.present?

View File

@ -266,7 +266,7 @@ module OS
Update them from Software Update in #{software_update_location} or run:
softwareupdate --all --install --force
If that doesn't show you an update run:
If that doesn't show you any updates, run:
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install

View File

@ -150,7 +150,7 @@ class Resource
def verify_download_integrity(fn)
if fn.file?
ohai "Verifying checksum for '#{fn.basename}'." if verbose?
ohai "Verifying checksum for '#{fn.basename}'" if verbose?
fn.verify_checksum(checksum)
end
rescue ChecksumMissingError

View File

@ -293,7 +293,7 @@ module RuboCop
next if url_has_revision?(parameters(url).last)
offending_node(url)
problem "Formulae in homebrew/core should specify a revision for git urls"
problem "Formulae in homebrew/core should specify a revision for git URLs"
end
end
@ -316,7 +316,7 @@ module RuboCop
next if url_has_tag?(parameters(url).last)
offending_node(url)
problem "Formulae in homebrew/core should specify a tag for git urls"
problem "Formulae in homebrew/core should specify a tag for git URLs"
end
end

View File

@ -127,8 +127,7 @@ class Sandbox
end
if @failed && Homebrew::EnvConfig.verbose?
ohai "Sandbox log"
puts logs
ohai "Sandbox Log", logs
$stdout.flush # without it, brew test-bot would fail to catch the log
end
end

View File

@ -356,7 +356,7 @@ class BottleSpecification
if [HOMEBREW_DEFAULT_PREFIX,
HOMEBREW_MACOS_ARM_DEFAULT_PREFIX,
HOMEBREW_LINUX_DEFAULT_PREFIX].exclude?(prefix)
odeprecated "setting `prefix` for bottles"
odeprecated "setting 'prefix' for bottles"
end
@prefix = prefix
end

View File

@ -89,7 +89,7 @@ class SystemCommand
env.each_key do |name|
next if /^[\w&&\D]\w*$/.match?(name)
raise ArgumentError, "Invalid variable name: '#{name}'"
raise ArgumentError, "Invalid variable name: #{name}"
end
@env = env
@input = Array(input)

View File

@ -209,7 +209,7 @@ class Tap
return "N/A" unless installed?
pretty_revision = git_short_head
return "(no git repository)" unless pretty_revision
return "(no Git repository)" unless pretty_revision
"(git revision #{pretty_revision}; last commit #{git_last_commit_date})"
end

View File

@ -26,8 +26,8 @@ begin
trap("INT", old_trap)
if Homebrew::EnvConfig.developer? || ENV["CI"].present?
raise "cannot find child processes without `pgrep`, please install!" unless which("pgrep")
raise "cannot kill child processes without `pkill`, please install!" unless which("pkill")
raise "Cannot find child processes without `pgrep`, please install!" unless which("pgrep")
raise "Cannot kill child processes without `pkill`, please install!" unless which("pkill")
end
formula = T.must(args.named.to_resolved_formulae.first)

View File

@ -25,7 +25,7 @@ describe "Bash" do
end
context "every `.sh` file" do
it "has valid bash syntax" do
it "has valid Bash syntax" do
Pathname.glob("#{HOMEBREW_LIBRARY_PATH}/**/*.sh").each do |path|
relative_path = path.relative_path_from(HOMEBREW_LIBRARY_PATH)
next if relative_path.to_s.start_with?("shims/", "test/", "vendor/")
@ -42,7 +42,7 @@ describe "Bash" do
end
context "every shim script" do
it "has valid bash syntax" do
it "has valid Bash syntax" do
# These have no file extension, but can be identified by their shebang.
(HOMEBREW_LIBRARY_PATH/"shims").find do |path|
next if path.directory?

View File

@ -89,8 +89,8 @@ describe Cask::Artifact::App, :cask do
describe "target is both writable and user-owned" do
it "overwrites the existing app" do
stdout = <<~EOS
==> Removing App '#{target_path}'.
==> Moving App 'Caffeine.app' to '#{target_path}'.
==> Removing App '#{target_path}'
==> Moving App 'Caffeine.app' to '#{target_path}'
EOS
stderr = <<~EOS
@ -137,8 +137,8 @@ describe Cask::Artifact::App, :cask do
).and_call_original
stdout = <<~EOS
==> Removing App '#{target_path}'.
==> Moving App 'Caffeine.app' to '#{target_path}'.
==> Removing App '#{target_path}'
==> Moving App 'Caffeine.app' to '#{target_path}'
EOS
stderr = <<~EOS
@ -180,8 +180,8 @@ describe Cask::Artifact::App, :cask do
it "overwrites the existing app" do
stdout = <<~EOS
==> Removing App '#{target_path}'.
==> Moving App 'Caffeine.app' to '#{target_path}'.
==> Removing App '#{target_path}'
==> Moving App 'Caffeine.app' to '#{target_path}'
EOS
stderr = <<~EOS

View File

@ -18,7 +18,7 @@ describe Cask::Artifact::Installer, :cask do
it "shows a message prompting to run the installer manually" do
expect {
installer.install_phase(command: command)
}.to output(%r{run the installer at:\s+'#{staged_path}/installer'}).to_stdout
}.to output(%r{run the installer at:\s+#{staged_path}/installer}).to_stdout
end
end

View File

@ -917,7 +917,7 @@ describe Cask::Audit, :cask do
RUBY
end
it { is_expected.to fail_with(/a `verified` parameter has to be added/) }
it { is_expected.to fail_with(/a 'verified' parameter has to be added/) }
end
context "when the url does not match the homepage with verified" do

View File

@ -41,13 +41,13 @@ describe Cask::Cask, :cask do
expect(c.token).to eq("local-caffeine")
end
it "returns an instance of the Cask from a url" do
it "returns an instance of the Cask from a URL" do
c = Cask::CaskLoader.load("file://#{tap_path}/Casks/local-caffeine.rb")
expect(c).to be_kind_of(described_class)
expect(c.token).to eq("local-caffeine")
end
it "raises an error when failing to download a Cask from a url" do
it "raises an error when failing to download a Cask from a URL" do
expect {
url = "file://#{tap_path}/Casks/notacask.rb"

Some files were not shown because too many files have changed in this diff Show More