Merge branch 'master' into audit_line_rubocop_part_4_rebase_attempt_1
This commit is contained in:
commit
7b2fab8ec5
@ -29,7 +29,7 @@ Layout/IndentArray:
|
|||||||
EnforcedStyle: special_inside_parentheses
|
EnforcedStyle: special_inside_parentheses
|
||||||
|
|
||||||
Layout/IndentHeredoc:
|
Layout/IndentHeredoc:
|
||||||
EnforcedStyle: unindent
|
EnforcedStyle: squiggly
|
||||||
|
|
||||||
# conflicts with DSL-style path concatenation with `/`
|
# conflicts with DSL-style path concatenation with `/`
|
||||||
Layout/SpaceAroundOperators:
|
Layout/SpaceAroundOperators:
|
||||||
@ -73,6 +73,8 @@ Metrics/CyclomaticComplexity:
|
|||||||
|
|
||||||
Metrics/LineLength:
|
Metrics/LineLength:
|
||||||
Max: 324
|
Max: 324
|
||||||
|
# ignore manpage comments
|
||||||
|
IgnoredPatterns: ['#: ']
|
||||||
|
|
||||||
Metrics/MethodLength:
|
Metrics/MethodLength:
|
||||||
Max: 222
|
Max: 222
|
||||||
|
|||||||
@ -253,7 +253,7 @@ module Hbc
|
|||||||
end
|
end
|
||||||
|
|
||||||
def trash_paths(*paths, command: nil, **_)
|
def trash_paths(*paths, command: nil, **_)
|
||||||
result = command.run!("/usr/bin/osascript", args: ["-e", <<-'EOS'.undent, *paths])
|
result = command.run!("/usr/bin/osascript", args: ["-e", <<~'EOS', *paths])
|
||||||
on run argv
|
on run argv
|
||||||
repeat with i from 1 to (count argv)
|
repeat with i from 1 to (count argv)
|
||||||
set item i of argv to (item i of argv as POSIX file)
|
set item i of argv to (item i of argv as POSIX file)
|
||||||
|
|||||||
@ -10,7 +10,7 @@ module Hbc
|
|||||||
|
|
||||||
module ManualInstaller
|
module ManualInstaller
|
||||||
def install_phase(**)
|
def install_phase(**)
|
||||||
puts <<-EOS.undent
|
puts <<~EOS
|
||||||
To complete the installation of Cask #{cask}, you must also
|
To complete the installation of Cask #{cask}, you must also
|
||||||
run the installer at
|
run the installer at
|
||||||
|
|
||||||
|
|||||||
@ -174,7 +174,7 @@ module Hbc
|
|||||||
add_warning "error retrieving appcast: #{result[:command_result].stderr}"
|
add_warning "error retrieving appcast: #{result[:command_result].stderr}"
|
||||||
else
|
else
|
||||||
expected = cask.appcast.checkpoint
|
expected = cask.appcast.checkpoint
|
||||||
add_warning <<-EOS.undent unless expected == actual_checkpoint
|
add_warning <<~EOS unless expected == actual_checkpoint
|
||||||
appcast checkpoint mismatch
|
appcast checkpoint mismatch
|
||||||
Expected: #{expected}
|
Expected: #{expected}
|
||||||
Actual: #{actual_checkpoint}
|
Actual: #{actual_checkpoint}
|
||||||
|
|||||||
@ -190,7 +190,7 @@ module Hbc
|
|||||||
when 2..Float::INFINITY
|
when 2..Float::INFINITY
|
||||||
loaders = possible_tap_casks.map(&FromTapPathLoader.method(:new))
|
loaders = possible_tap_casks.map(&FromTapPathLoader.method(:new))
|
||||||
|
|
||||||
raise CaskError, <<-EOS.undent
|
raise CaskError, <<~EOS
|
||||||
Cask #{ref} exists in multiple taps:
|
Cask #{ref} exists in multiple taps:
|
||||||
#{loaders.map { |loader| " #{loader.tap}/#{loader.token}" }.join("\n")}
|
#{loaders.map { |loader| " #{loader.tap}/#{loader.token}" }.join("\n")}
|
||||||
EOS
|
EOS
|
||||||
|
|||||||
@ -235,7 +235,7 @@ module Hbc
|
|||||||
end
|
end
|
||||||
|
|
||||||
def purpose
|
def purpose
|
||||||
puts <<-EOS.undent
|
puts <<~EOS
|
||||||
brew-cask provides a friendly homebrew-style CLI workflow for the
|
brew-cask provides a friendly homebrew-style CLI workflow for the
|
||||||
administration of macOS applications distributed as binaries.
|
administration of macOS applications distributed as binaries.
|
||||||
|
|
||||||
|
|||||||
@ -21,7 +21,7 @@ module Hbc
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.template(cask_token)
|
def self.template(cask_token)
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
cask '#{cask_token}' do
|
cask '#{cask_token}' do
|
||||||
version ''
|
version ''
|
||||||
sha256 ''
|
sha256 ''
|
||||||
|
|||||||
@ -16,7 +16,7 @@ module Hbc
|
|||||||
super
|
super
|
||||||
|
|
||||||
if args.count != 1
|
if args.count != 1
|
||||||
raise ArgumentError, <<-EOS.undent
|
raise ArgumentError, <<~EOS
|
||||||
This command requires exactly one argument.
|
This command requires exactly one argument.
|
||||||
|
|
||||||
#{self.class.usage}
|
#{self.class.usage}
|
||||||
@ -31,7 +31,7 @@ module Hbc
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.usage
|
def self.usage
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Usage: brew cask _audit_modified_casks [options...] <commit range>
|
Usage: brew cask _audit_modified_casks [options...] <commit range>
|
||||||
|
|
||||||
Given a range of Git commits, find any Casks that were modified and run `brew
|
Given a range of Git commits, find any Casks that were modified and run `brew
|
||||||
|
|||||||
@ -25,7 +25,7 @@ module Hbc
|
|||||||
|
|
||||||
single = versions.count == 1
|
single = versions.count == 1
|
||||||
|
|
||||||
puts <<-EOS.undent
|
puts <<~EOS
|
||||||
#{cask} #{versions.join(", ")} #{single ? "is" : "are"} still installed.
|
#{cask} #{versions.join(", ")} #{single ? "is" : "are"} still installed.
|
||||||
Remove #{single ? "it" : "them all"} with `brew cask uninstall --force #{cask}`.
|
Remove #{single ? "it" : "them all"} with `brew cask uninstall --force #{cask}`.
|
||||||
EOS
|
EOS
|
||||||
|
|||||||
@ -13,7 +13,7 @@ module Hbc
|
|||||||
|
|
||||||
def self.installer_cmd
|
def self.installer_cmd
|
||||||
return @installer_cmd ||= INSTALLER_PATHNAME if installer_exist?
|
return @installer_cmd ||= INSTALLER_PATHNAME if installer_exist?
|
||||||
raise CaskError, <<-EOS.undent
|
raise CaskError, <<~EOS
|
||||||
Adobe AIR runtime not present, try installing it via
|
Adobe AIR runtime not present, try installing it via
|
||||||
|
|
||||||
brew cask install adobe-air
|
brew cask install adobe-air
|
||||||
|
|||||||
@ -9,22 +9,22 @@ module Hbc
|
|||||||
class DSL
|
class DSL
|
||||||
class Caveats < Base
|
class Caveats < Base
|
||||||
def path_environment_variable(path)
|
def path_environment_variable(path)
|
||||||
puts <<-EOS.undent
|
puts <<~EOS
|
||||||
To use #{@cask}, you may need to add the #{path} directory
|
To use #{@cask}, you may need to add the #{path} directory
|
||||||
to your PATH environment variable, eg (for bash shell):
|
to your PATH environment variable, eg (for bash shell):
|
||||||
|
|
||||||
export PATH=#{path}:"$PATH"
|
export PATH=#{path}:"$PATH"
|
||||||
|
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
def zsh_path_helper(path)
|
def zsh_path_helper(path)
|
||||||
puts <<-EOS.undent
|
puts <<~EOS
|
||||||
To use #{@cask}, zsh users may need to add the following line to their
|
To use #{@cask}, zsh users may need to add the following line to their
|
||||||
~/.zprofile. (Among other effects, #{path} will be added to the
|
~/.zprofile. (Among other effects, #{path} will be added to the
|
||||||
PATH environment variable):
|
PATH environment variable):
|
||||||
|
|
||||||
eval `/usr/libexec/path_helper -s`
|
eval `/usr/libexec/path_helper -s`
|
||||||
|
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
@ -32,7 +32,7 @@ module Hbc
|
|||||||
def files_in_usr_local
|
def files_in_usr_local
|
||||||
localpath = "/usr/local"
|
localpath = "/usr/local"
|
||||||
return unless HOMEBREW_PREFIX.to_s.downcase.start_with?(localpath)
|
return unless HOMEBREW_PREFIX.to_s.downcase.start_with?(localpath)
|
||||||
puts <<-EOS.undent
|
puts <<~EOS
|
||||||
Cask #{@cask} installs files under "#{localpath}". The presence of such
|
Cask #{@cask} installs files under "#{localpath}". The presence of such
|
||||||
files can cause warnings when running "brew doctor", which is considered
|
files can cause warnings when running "brew doctor", which is considered
|
||||||
to be a bug in Homebrew-Cask.
|
to be a bug in Homebrew-Cask.
|
||||||
@ -42,72 +42,72 @@ module Hbc
|
|||||||
|
|
||||||
def depends_on_java(java_version = "any")
|
def depends_on_java(java_version = "any")
|
||||||
if java_version == "any"
|
if java_version == "any"
|
||||||
puts <<-EOS.undent
|
puts <<~EOS
|
||||||
#{@cask} requires Java. You can install the latest version with
|
#{@cask} requires Java. You can install the latest version with
|
||||||
|
|
||||||
brew cask install java
|
brew cask install java
|
||||||
|
|
||||||
EOS
|
EOS
|
||||||
elsif java_version.include?("9") || java_version.include?("+")
|
elsif java_version.include?("9") || java_version.include?("+")
|
||||||
puts <<-EOS.undent
|
puts <<~EOS
|
||||||
#{@cask} requires Java #{java_version}. You can install the latest version with
|
#{@cask} requires Java #{java_version}. You can install the latest version with
|
||||||
|
|
||||||
brew cask install java
|
brew cask install java
|
||||||
|
|
||||||
EOS
|
EOS
|
||||||
else
|
else
|
||||||
puts <<-EOS.undent
|
puts <<~EOS
|
||||||
#{@cask} requires Java #{java_version}. You can install it with
|
#{@cask} requires Java #{java_version}. You can install it with
|
||||||
|
|
||||||
brew cask install caskroom/versions/java#{java_version}
|
brew cask install caskroom/versions/java#{java_version}
|
||||||
|
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def logout
|
def logout
|
||||||
puts <<-EOS.undent
|
puts <<~EOS
|
||||||
You must log out and log back in for the installation of #{@cask}
|
You must log out and log back in for the installation of #{@cask}
|
||||||
to take effect.
|
to take effect.
|
||||||
|
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
def reboot
|
def reboot
|
||||||
puts <<-EOS.undent
|
puts <<~EOS
|
||||||
You must reboot for the installation of #{@cask} to take effect.
|
You must reboot for the installation of #{@cask} to take effect.
|
||||||
|
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
def discontinued
|
def discontinued
|
||||||
puts <<-EOS.undent
|
puts <<~EOS
|
||||||
#{@cask} has been officially discontinued upstream.
|
#{@cask} has been officially discontinued upstream.
|
||||||
It may stop working correctly (or at all) in recent versions of macOS.
|
It may stop working correctly (or at all) in recent versions of macOS.
|
||||||
|
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
def free_license(web_page)
|
def free_license(web_page)
|
||||||
puts <<-EOS.undent
|
puts <<~EOS
|
||||||
The vendor offers a free license for #{@cask} at
|
The vendor offers a free license for #{@cask} at
|
||||||
#{web_page}
|
#{web_page}
|
||||||
|
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
def malware(radar_number)
|
def malware(radar_number)
|
||||||
puts <<-EOS.undent
|
puts <<~EOS
|
||||||
#{@cask} has been reported to bundle malware. Like with any app, use at your own risk.
|
#{@cask} has been reported to bundle malware. Like with any app, use at your own risk.
|
||||||
|
|
||||||
A report has been made to Apple about this app. Their certificate will hopefully be revoked.
|
A report has been made to Apple about this app. Their certificate will hopefully be revoked.
|
||||||
See the public report at
|
See the public report at
|
||||||
#{Formatter.url("https://openradar.appspot.com/#{radar_number}")}
|
#{Formatter.url("https://openradar.appspot.com/#{radar_number}")}
|
||||||
|
|
||||||
If this report is accurate, please duplicate it at
|
If this report is accurate, please duplicate it at
|
||||||
#{Formatter.url("https://bugreport.apple.com/")}
|
#{Formatter.url("https://bugreport.apple.com/")}
|
||||||
If this report is a mistake, please let us know by opening an issue at
|
If this report is a mistake, please let us know by opening an issue at
|
||||||
#{Formatter.url("https://github.com/caskroom/homebrew-cask/issues/new")}
|
#{Formatter.url("https://github.com/caskroom/homebrew-cask/issues/new")}
|
||||||
|
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|||||||
@ -44,7 +44,7 @@ module Hbc
|
|||||||
|
|
||||||
class CaskAlreadyInstalledError < AbstractCaskErrorWithToken
|
class CaskAlreadyInstalledError < AbstractCaskErrorWithToken
|
||||||
def to_s
|
def to_s
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Cask '#{token}' is already installed.
|
Cask '#{token}' is already installed.
|
||||||
|
|
||||||
To re-install #{token}, run:
|
To re-install #{token}, run:
|
||||||
@ -80,7 +80,7 @@ module Hbc
|
|||||||
|
|
||||||
class CaskX11DependencyError < AbstractCaskErrorWithToken
|
class CaskX11DependencyError < AbstractCaskErrorWithToken
|
||||||
def to_s
|
def to_s
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Cask '#{token}' requires XQuartz/X11, which can be installed using Homebrew-Cask by running
|
Cask '#{token}' requires XQuartz/X11, which can be installed using Homebrew-Cask by running
|
||||||
#{Formatter.identifier("brew cask install xquartz")}
|
#{Formatter.identifier("brew cask install xquartz")}
|
||||||
|
|
||||||
@ -132,7 +132,7 @@ module Hbc
|
|||||||
|
|
||||||
class CaskSha256MissingError < CaskSha256Error
|
class CaskSha256MissingError < CaskSha256Error
|
||||||
def to_s
|
def to_s
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Cask '#{token}' requires a checksum:
|
Cask '#{token}' requires a checksum:
|
||||||
#{Formatter.identifier("sha256 '#{actual}'")}
|
#{Formatter.identifier("sha256 '#{actual}'")}
|
||||||
EOS
|
EOS
|
||||||
@ -148,7 +148,7 @@ module Hbc
|
|||||||
end
|
end
|
||||||
|
|
||||||
def to_s
|
def to_s
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Checksum for Cask '#{token}' does not match.
|
Checksum for Cask '#{token}' does not match.
|
||||||
|
|
||||||
Expected: #{Formatter.success(expected.to_s)}
|
Expected: #{Formatter.success(expected.to_s)}
|
||||||
@ -162,7 +162,7 @@ module Hbc
|
|||||||
|
|
||||||
class CaskNoShasumError < CaskSha256Error
|
class CaskNoShasumError < CaskSha256Error
|
||||||
def to_s
|
def to_s
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Cask '#{token}' does not have a sha256 checksum defined and was not installed.
|
Cask '#{token}' does not have a sha256 checksum defined and was not installed.
|
||||||
This means you have the #{Formatter.identifier("--require-sha")} option set, perhaps in your HOMEBREW_CASK_OPTS.
|
This means you have the #{Formatter.identifier("--require-sha")} option set, perhaps in your HOMEBREW_CASK_OPTS.
|
||||||
EOS
|
EOS
|
||||||
|
|||||||
@ -326,7 +326,7 @@ module Hbc
|
|||||||
],
|
],
|
||||||
sudo: true)
|
sudo: true)
|
||||||
else
|
else
|
||||||
opoo <<-EOS.undent
|
opoo <<~EOS
|
||||||
Accessibility access cannot be enabled automatically on this version of macOS.
|
Accessibility access cannot be enabled automatically on this version of macOS.
|
||||||
See System Preferences to enable it manually.
|
See System Preferences to enable it manually.
|
||||||
EOS
|
EOS
|
||||||
@ -347,7 +347,7 @@ module Hbc
|
|||||||
],
|
],
|
||||||
sudo: true)
|
sudo: true)
|
||||||
else
|
else
|
||||||
opoo <<-EOS.undent
|
opoo <<~EOS
|
||||||
Accessibility access cannot be disabled automatically on this version of macOS.
|
Accessibility access cannot be disabled automatically on this version of macOS.
|
||||||
See System Preferences to disable it manually.
|
See System Preferences to disable it manually.
|
||||||
EOS
|
EOS
|
||||||
|
|||||||
@ -166,12 +166,12 @@ module Hbc
|
|||||||
_warn_plist_garbage(command, Regexp.last_match[2])
|
_warn_plist_garbage(command, Regexp.last_match[2])
|
||||||
xml = Plist.parse_xml(output)
|
xml = Plist.parse_xml(output)
|
||||||
unless xml.respond_to?(:keys) && !xml.keys.empty?
|
unless xml.respond_to?(:keys) && !xml.keys.empty?
|
||||||
raise CaskError, <<-EOS
|
raise CaskError, <<~EOS
|
||||||
Empty result parsing plist output from command.
|
Empty result parsing plist output from command.
|
||||||
command was:
|
command was:
|
||||||
#{command}
|
#{command}
|
||||||
output we attempted to parse:
|
output we attempted to parse:
|
||||||
#{output}
|
#{output}
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
xml
|
xml
|
||||||
|
|||||||
@ -90,7 +90,7 @@ module Hbc
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.error_message_with_suggestions
|
def self.error_message_with_suggestions
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Follow the instructions here:
|
Follow the instructions here:
|
||||||
#{Formatter.url(BUG_REPORTS_URL)}
|
#{Formatter.url(BUG_REPORTS_URL)}
|
||||||
EOS
|
EOS
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
module Hbc
|
module Hbc
|
||||||
def self.full_version
|
def self.full_version
|
||||||
@full_version ||= begin
|
@full_version ||= begin
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Homebrew-Cask #{HOMEBREW_VERSION}
|
Homebrew-Cask #{HOMEBREW_VERSION}
|
||||||
caskroom/homebrew-cask #{Hbc.default_tap.version_string}
|
caskroom/homebrew-cask #{Hbc.default_tap.version_string}
|
||||||
EOS
|
EOS
|
||||||
|
|||||||
@ -44,7 +44,7 @@ class Caveats
|
|||||||
def keg_only_text
|
def keg_only_text
|
||||||
return unless f.keg_only?
|
return unless f.keg_only?
|
||||||
|
|
||||||
s = <<-EOS.undent
|
s = <<~EOS
|
||||||
This formula is keg-only, which means it was not symlinked into #{HOMEBREW_PREFIX},
|
This formula is keg-only, which means it was not symlinked into #{HOMEBREW_PREFIX},
|
||||||
because #{f.keg_only_reason.to_s.chomp}.
|
because #{f.keg_only_reason.to_s.chomp}.
|
||||||
EOS
|
EOS
|
||||||
@ -86,12 +86,12 @@ class Caveats
|
|||||||
|
|
||||||
case shell
|
case shell
|
||||||
when :bash
|
when :bash
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Bash completion has been installed to:
|
Bash completion has been installed to:
|
||||||
#{HOMEBREW_PREFIX}/etc/bash_completion.d
|
#{HOMEBREW_PREFIX}/etc/bash_completion.d
|
||||||
EOS
|
EOS
|
||||||
when :zsh
|
when :zsh
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
zsh #{installed.join(" and ")} have been installed to:
|
zsh #{installed.join(" and ")} have been installed to:
|
||||||
#{HOMEBREW_PREFIX}/share/zsh/site-functions
|
#{HOMEBREW_PREFIX}/share/zsh/site-functions
|
||||||
EOS
|
EOS
|
||||||
@ -111,7 +111,7 @@ class Caveats
|
|||||||
homebrew_site_packages = Language::Python.homebrew_site_packages
|
homebrew_site_packages = Language::Python.homebrew_site_packages
|
||||||
user_site_packages = Language::Python.user_site_packages "python"
|
user_site_packages = Language::Python.user_site_packages "python"
|
||||||
pth_file = user_site_packages/"homebrew.pth"
|
pth_file = user_site_packages/"homebrew.pth"
|
||||||
instructions = <<-EOS.undent.gsub(/^/, " ")
|
instructions = <<~EOS.gsub(/^/, " ")
|
||||||
mkdir -p #{user_site_packages}
|
mkdir -p #{user_site_packages}
|
||||||
echo 'import site; site.addsitedir("#{homebrew_site_packages}")' >> #{pth_file}
|
echo 'import site; site.addsitedir("#{homebrew_site_packages}")' >> #{pth_file}
|
||||||
EOS
|
EOS
|
||||||
@ -119,7 +119,7 @@ class Caveats
|
|||||||
if f.keg_only?
|
if f.keg_only?
|
||||||
keg_site_packages = f.opt_prefix/"lib/python2.7/site-packages"
|
keg_site_packages = f.opt_prefix/"lib/python2.7/site-packages"
|
||||||
unless Language::Python.in_sys_path?("python", keg_site_packages)
|
unless Language::Python.in_sys_path?("python", keg_site_packages)
|
||||||
s = <<-EOS.undent
|
s = <<~EOS
|
||||||
If you need Python to find bindings for this keg-only formula, run:
|
If you need Python to find bindings for this keg-only formula, run:
|
||||||
echo #{keg_site_packages} >> #{homebrew_site_packages/f.name}.pth
|
echo #{keg_site_packages} >> #{homebrew_site_packages/f.name}.pth
|
||||||
EOS
|
EOS
|
||||||
@ -131,7 +131,7 @@ class Caveats
|
|||||||
return if Language::Python.reads_brewed_pth_files?("python")
|
return if Language::Python.reads_brewed_pth_files?("python")
|
||||||
|
|
||||||
if !Language::Python.in_sys_path?("python", homebrew_site_packages)
|
if !Language::Python.in_sys_path?("python", homebrew_site_packages)
|
||||||
s = <<-EOS.undent
|
s = <<~EOS
|
||||||
Python modules have been installed and Homebrew's site-packages is not
|
Python modules have been installed and Homebrew's site-packages is not
|
||||||
in your Python sys.path, so you will not be able to import the modules
|
in your Python sys.path, so you will not be able to import the modules
|
||||||
this formula installed. If you plan to develop with these modules,
|
this formula installed. If you plan to develop with these modules,
|
||||||
@ -139,7 +139,7 @@ class Caveats
|
|||||||
EOS
|
EOS
|
||||||
s += instructions
|
s += instructions
|
||||||
elsif keg.python_pth_files_installed?
|
elsif keg.python_pth_files_installed?
|
||||||
s = <<-EOS.undent
|
s = <<~EOS
|
||||||
This formula installed .pth files to Homebrew's site-packages and your
|
This formula installed .pth files to Homebrew's site-packages and your
|
||||||
Python isn't configured to process them, so you will not be able to
|
Python isn't configured to process them, so you will not be able to
|
||||||
import the modules this formula installed. If you plan to develop
|
import the modules this formula installed. If you plan to develop
|
||||||
@ -155,55 +155,13 @@ class Caveats
|
|||||||
return unless keg
|
return unless keg
|
||||||
return unless keg.elisp_installed?
|
return unless keg.elisp_installed?
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Emacs Lisp files have been installed to:
|
Emacs Lisp files have been installed to:
|
||||||
#{HOMEBREW_PREFIX}/share/emacs/site-lisp/#{f.name}
|
#{HOMEBREW_PREFIX}/share/emacs/site-lisp/#{f.name}
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
def plist_caveats
|
def plist_caveats; end
|
||||||
s = []
|
|
||||||
if f.plist || (keg&.plist_installed?)
|
|
||||||
plist_domain = f.plist_path.basename(".plist")
|
|
||||||
|
|
||||||
# we readlink because this path probably doesn't exist since caveats
|
|
||||||
# occurs before the link step of installation
|
|
||||||
# Yosemite security measures mildly tighter rules:
|
|
||||||
# https://github.com/Homebrew/legacy-homebrew/issues/33815
|
|
||||||
if !plist_path.file? || !plist_path.symlink?
|
|
||||||
if f.plist_startup
|
|
||||||
s << "To have launchd start #{f.full_name} now and restart at startup:"
|
|
||||||
s << " sudo brew services start #{f.full_name}"
|
|
||||||
else
|
|
||||||
s << "To have launchd start #{f.full_name} now and restart at login:"
|
|
||||||
s << " brew services start #{f.full_name}"
|
|
||||||
end
|
|
||||||
# For startup plists, we cannot tell whether it's running on launchd,
|
|
||||||
# as it requires for `sudo launchctl list` to get real result.
|
|
||||||
elsif f.plist_startup
|
|
||||||
s << "To restart #{f.full_name} after an upgrade:"
|
|
||||||
s << " sudo brew services restart #{f.full_name}"
|
|
||||||
elsif Kernel.system "/bin/launchctl list #{plist_domain} &>/dev/null"
|
|
||||||
s << "To restart #{f.full_name} after an upgrade:"
|
|
||||||
s << " brew services restart #{f.full_name}"
|
|
||||||
else
|
|
||||||
s << "To start #{f.full_name}:"
|
|
||||||
s << " brew services start #{f.full_name}"
|
|
||||||
end
|
|
||||||
|
|
||||||
if f.plist_manual
|
|
||||||
s << "Or, if you don't want/need a background service you can just run:"
|
|
||||||
s << " #{f.plist_manual}"
|
|
||||||
end
|
|
||||||
|
|
||||||
# pbpaste is the system clipboard tool on macOS and fails with `tmux` by default
|
|
||||||
# check if this is being run under `tmux` to avoid failing
|
|
||||||
if ENV["TMUX"] && !quiet_system("/usr/bin/pbpaste")
|
|
||||||
s << "" << "WARNING: brew services will fail when run under tmux."
|
|
||||||
end
|
|
||||||
end
|
|
||||||
s.join("\n") + "\n" unless s.empty?
|
|
||||||
end
|
|
||||||
|
|
||||||
def plist_path
|
def plist_path
|
||||||
destination = if f.plist_startup
|
destination = if f.plist_startup
|
||||||
@ -222,3 +180,5 @@ class Caveats
|
|||||||
destination_path/plist_filename
|
destination_path/plist_filename
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
require "extend/os/caveats"
|
||||||
|
|||||||
@ -38,7 +38,7 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
def report_unremovable_kegs
|
def report_unremovable_kegs
|
||||||
ofail <<-EOS.undent
|
ofail <<~EOS
|
||||||
Could not cleanup old kegs! Fix your permissions on:
|
Could not cleanup old kegs! Fix your permissions on:
|
||||||
#{Cleanup.unremovable_kegs.join "\n "}
|
#{Cleanup.unremovable_kegs.join "\n "}
|
||||||
EOS
|
EOS
|
||||||
|
|||||||
@ -16,12 +16,12 @@ module Homebrew
|
|||||||
else
|
else
|
||||||
# Find commands in Homebrew/cmd
|
# Find commands in Homebrew/cmd
|
||||||
puts "Built-in commands"
|
puts "Built-in commands"
|
||||||
puts Formatter.columns(internal_commands)
|
puts Formatter.columns(internal_commands.sort)
|
||||||
|
|
||||||
# Find commands in Homebrew/dev-cmd
|
# Find commands in Homebrew/dev-cmd
|
||||||
puts
|
puts
|
||||||
puts "Built-in developer commands"
|
puts "Built-in developer commands"
|
||||||
puts Formatter.columns(internal_developer_commands)
|
puts Formatter.columns(internal_developer_commands.sort)
|
||||||
|
|
||||||
# Find commands in the path
|
# Find commands in the path
|
||||||
unless (exts = external_commands).empty?
|
unless (exts = external_commands).empty?
|
||||||
@ -51,8 +51,8 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
def find_internal_commands(directory)
|
def find_internal_commands(directory)
|
||||||
directory.children.each_with_object([]) do |f, cmds|
|
Pathname.glob(directory/"*")
|
||||||
cmds << f.basename.to_s.sub(/\.(?:rb|sh)$/, "") if f.file?
|
.select(&:file?)
|
||||||
end
|
.map { |f| f.basename.to_s.sub(/\.(?:rb|sh)$/, "") }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -68,16 +68,16 @@ module Homebrew
|
|||||||
|
|
||||||
if mode.tree?
|
if mode.tree?
|
||||||
if mode.installed?
|
if mode.installed?
|
||||||
puts_deps_tree Formula.installed, !ARGV.one?
|
puts_deps_tree Formula.installed.sort, !ARGV.one?
|
||||||
else
|
else
|
||||||
raise FormulaUnspecifiedError if ARGV.named.empty?
|
raise FormulaUnspecifiedError if ARGV.named.empty?
|
||||||
puts_deps_tree ARGV.formulae, !ARGV.one?
|
puts_deps_tree ARGV.formulae, !ARGV.one?
|
||||||
end
|
end
|
||||||
elsif mode.all?
|
elsif mode.all?
|
||||||
puts_deps Formula
|
puts_deps Formula.sort
|
||||||
elsif ARGV.named.empty?
|
elsif ARGV.named.empty?
|
||||||
raise FormulaUnspecifiedError unless mode.installed?
|
raise FormulaUnspecifiedError unless mode.installed?
|
||||||
puts_deps Formula.installed
|
puts_deps Formula.installed.sort
|
||||||
elsif mode.for_each?
|
elsif mode.for_each?
|
||||||
puts_deps ARGV.formulae
|
puts_deps ARGV.formulae
|
||||||
else
|
else
|
||||||
|
|||||||
@ -43,7 +43,7 @@ module Homebrew
|
|||||||
detected_name = basename[/(.*?)-?#{Regexp.escape(version)}/, 1] || basename
|
detected_name = basename[/(.*?)-?#{Regexp.escape(version)}/, 1] || basename
|
||||||
canonical_name = Formulary.canonical_name(detected_name)
|
canonical_name = Formulary.canonical_name(detected_name)
|
||||||
|
|
||||||
odie <<-EOS.undent if detected_name != canonical_name
|
odie <<~EOS if detected_name != canonical_name
|
||||||
The detected name #{detected_name.inspect} exists in Homebrew as an alias
|
The detected name #{detected_name.inspect} exists in Homebrew as an alias
|
||||||
of #{canonical_name.inspect}. Consider using the canonical name instead:
|
of #{canonical_name.inspect}. Consider using the canonical name instead:
|
||||||
brew diy --name=#{canonical_name}
|
brew diy --name=#{canonical_name}
|
||||||
|
|||||||
@ -43,7 +43,7 @@ module Homebrew
|
|||||||
out = checks.send(method)
|
out = checks.send(method)
|
||||||
next if out.nil? || out.empty?
|
next if out.nil? || out.empty?
|
||||||
if first_warning
|
if first_warning
|
||||||
$stderr.puts <<-EOS.undent
|
$stderr.puts <<~EOS
|
||||||
#{Tty.bold}Please note that these warnings are just used to help the Homebrew maintainers
|
#{Tty.bold}Please note that these warnings are just used to help the Homebrew maintainers
|
||||||
with debugging if you file an issue. If everything you use Homebrew for is
|
with debugging if you file an issue. If everything you use Homebrew for is
|
||||||
working fine: please don't worry and just ignore them. Thanks!#{Tty.reset}
|
working fine: please don't worry and just ignore them. Thanks!#{Tty.reset}
|
||||||
|
|||||||
@ -29,7 +29,7 @@ module Homebrew
|
|||||||
files["00.config.out"] = { content: s.string }
|
files["00.config.out"] = { content: s.string }
|
||||||
files["00.doctor.out"] = { content: `brew doctor 2>&1` }
|
files["00.doctor.out"] = { content: `brew doctor 2>&1` }
|
||||||
unless f.core_formula?
|
unless f.core_formula?
|
||||||
tap = <<-EOS.undent
|
tap = <<~EOS
|
||||||
Formula: #{f.name}
|
Formula: #{f.name}
|
||||||
Tap: #{f.tap}
|
Tap: #{f.tap}
|
||||||
Path: #{f.path}
|
Path: #{f.path}
|
||||||
@ -47,7 +47,7 @@ module Homebrew
|
|||||||
|
|
||||||
if ARGV.include?("--new-issue") || ARGV.switch?("n")
|
if ARGV.include?("--new-issue") || ARGV.switch?("n")
|
||||||
if GitHub.api_credentials_type == :none
|
if GitHub.api_credentials_type == :none
|
||||||
puts <<-EOS.undent
|
puts <<~EOS
|
||||||
You can create a new personal access token:
|
You can create a new personal access token:
|
||||||
#{GitHub::ALL_SCOPES_URL}
|
#{GitHub::ALL_SCOPES_URL}
|
||||||
and then set the new HOMEBREW_GITHUB_API_TOKEN as the authentication method.
|
and then set the new HOMEBREW_GITHUB_API_TOKEN as the authentication method.
|
||||||
@ -64,7 +64,7 @@ module Homebrew
|
|||||||
|
|
||||||
def brief_build_info(f)
|
def brief_build_info(f)
|
||||||
build_time_str = f.logs.ctime.strftime("%Y-%m-%d %H:%M:%S")
|
build_time_str = f.logs.ctime.strftime("%Y-%m-%d %H:%M:%S")
|
||||||
s = <<-EOS.undent
|
s = <<~EOS
|
||||||
Homebrew build logs for #{f.full_name} on #{OS_VERSION}
|
Homebrew build logs for #{f.full_name} on #{OS_VERSION}
|
||||||
EOS
|
EOS
|
||||||
if ARGV.include?("--with-hostname")
|
if ARGV.include?("--with-hostname")
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
HOMEBREW_HELP = <<-EOS.unindent.freeze
|
HOMEBREW_HELP = <<~EOS.freeze
|
||||||
Example usage:
|
Example usage:
|
||||||
brew search [TEXT|/REGEX/]
|
brew search [TEXT|/REGEX/]
|
||||||
brew (info|home|options) [FORMULA...]
|
brew (info|home|options) [FORMULA...]
|
||||||
|
|||||||
@ -67,9 +67,9 @@ module Homebrew
|
|||||||
|
|
||||||
def print_json
|
def print_json
|
||||||
ff = if ARGV.include? "--all"
|
ff = if ARGV.include? "--all"
|
||||||
Formula
|
Formula.sort
|
||||||
elsif ARGV.include? "--installed"
|
elsif ARGV.include? "--installed"
|
||||||
Formula.installed
|
Formula.installed.sort
|
||||||
else
|
else
|
||||||
ARGV.formulae
|
ARGV.formulae
|
||||||
end
|
end
|
||||||
@ -128,7 +128,7 @@ module Homebrew
|
|||||||
"#{c.name}#{reason}"
|
"#{c.name}#{reason}"
|
||||||
end.sort!
|
end.sort!
|
||||||
unless conflicts.empty?
|
unless conflicts.empty?
|
||||||
puts <<-EOS.undent
|
puts <<~EOS
|
||||||
Conflicts with:
|
Conflicts with:
|
||||||
#{conflicts.join("\n ")}
|
#{conflicts.join("\n ")}
|
||||||
EOS
|
EOS
|
||||||
|
|||||||
@ -110,17 +110,17 @@ module Homebrew
|
|||||||
ARGV.formulae.each do |f|
|
ARGV.formulae.each do |f|
|
||||||
# head-only without --HEAD is an error
|
# head-only without --HEAD is an error
|
||||||
if !ARGV.build_head? && f.stable.nil? && f.devel.nil?
|
if !ARGV.build_head? && f.stable.nil? && f.devel.nil?
|
||||||
raise <<-EOS.undent
|
raise <<~EOS
|
||||||
#{f.full_name} is a head-only formula
|
#{f.full_name} is a head-only formula
|
||||||
Install with `brew install --HEAD #{f.full_name}`
|
Install with `brew install --HEAD #{f.full_name}`
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
# devel-only without --devel is an error
|
# devel-only without --devel is an error
|
||||||
if !ARGV.build_devel? && f.stable.nil? && f.head.nil?
|
if !ARGV.build_devel? && f.stable.nil? && f.head.nil?
|
||||||
raise <<-EOS.undent
|
raise <<~EOS
|
||||||
#{f.full_name} is a devel-only formula
|
#{f.full_name} is a devel-only formula
|
||||||
Install with `brew install --devel #{f.full_name}`
|
Install with `brew install --devel #{f.full_name}`
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -150,12 +150,12 @@ module Homebrew
|
|||||||
# sure --force flag is passed.
|
# sure --force flag is passed.
|
||||||
if f.outdated?
|
if f.outdated?
|
||||||
optlinked_version = Keg.for(f.opt_prefix).version
|
optlinked_version = Keg.for(f.opt_prefix).version
|
||||||
onoe <<-EOS.undent
|
onoe <<~EOS
|
||||||
#{f.full_name} #{optlinked_version} is already installed
|
#{f.full_name} #{optlinked_version} is already installed
|
||||||
To upgrade to #{f.version}, run `brew upgrade #{f.name}`
|
To upgrade to #{f.version}, run `brew upgrade #{f.name}`
|
||||||
EOS
|
EOS
|
||||||
else
|
else
|
||||||
opoo <<-EOS.undent
|
opoo <<~EOS
|
||||||
#{f.full_name} #{f.pkg_version} is already installed
|
#{f.full_name} #{f.pkg_version} is already installed
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
@ -173,13 +173,13 @@ module Homebrew
|
|||||||
msg = "#{f.full_name} #{installed_version} is already installed"
|
msg = "#{f.full_name} #{installed_version} is already installed"
|
||||||
linked_not_equals_installed = f.linked_version != installed_version
|
linked_not_equals_installed = f.linked_version != installed_version
|
||||||
if f.linked? && linked_not_equals_installed
|
if f.linked? && linked_not_equals_installed
|
||||||
msg = <<-EOS.undent
|
msg = <<~EOS
|
||||||
#{msg}
|
#{msg}
|
||||||
The currently linked version is #{f.linked_version}
|
The currently linked version is #{f.linked_version}
|
||||||
You can use `brew switch #{f} #{installed_version}` to link this version.
|
You can use `brew switch #{f} #{installed_version}` to link this version.
|
||||||
EOS
|
EOS
|
||||||
elsif !f.linked? || f.keg_only?
|
elsif !f.linked? || f.keg_only?
|
||||||
msg = <<-EOS.undent
|
msg = <<~EOS
|
||||||
#{msg}, it's just not linked.
|
#{msg}, it's just not linked.
|
||||||
You can use `brew link #{f}` to link this version.
|
You can use `brew link #{f}` to link this version.
|
||||||
EOS
|
EOS
|
||||||
@ -188,7 +188,7 @@ module Homebrew
|
|||||||
elsif !f.any_version_installed? && old_formula = f.old_installed_formulae.first
|
elsif !f.any_version_installed? && old_formula = f.old_installed_formulae.first
|
||||||
msg = "#{old_formula.full_name} #{old_formula.installed_version} already installed"
|
msg = "#{old_formula.full_name} #{old_formula.installed_version} already installed"
|
||||||
if !old_formula.linked? && !old_formula.keg_only?
|
if !old_formula.linked? && !old_formula.keg_only?
|
||||||
msg = <<-EOS.undent
|
msg = <<~EOS
|
||||||
#{msg}, it's just not linked.
|
#{msg}, it's just not linked.
|
||||||
You can use `brew link #{old_formula.full_name}` to link this version.
|
You can use `brew link #{old_formula.full_name}` to link this version.
|
||||||
EOS
|
EOS
|
||||||
@ -197,7 +197,7 @@ module Homebrew
|
|||||||
elsif f.migration_needed? && !ARGV.force?
|
elsif f.migration_needed? && !ARGV.force?
|
||||||
# Check if the formula we try to install is the same as installed
|
# Check if the formula we try to install is the same as installed
|
||||||
# but not migrated one. If --force passed then install anyway.
|
# but not migrated one. If --force passed then install anyway.
|
||||||
opoo <<-EOS.undent
|
opoo <<~EOS
|
||||||
#{f.oldname} already installed, it's just not migrated
|
#{f.oldname} already installed, it's just not migrated
|
||||||
You can migrate formula with `brew migrate #{f}`
|
You can migrate formula with `brew migrate #{f}`
|
||||||
Or you can force install it with `brew install #{f} --force`
|
Or you can force install it with `brew install #{f} --force`
|
||||||
@ -283,7 +283,7 @@ module Homebrew
|
|||||||
def check_ppc
|
def check_ppc
|
||||||
case Hardware::CPU.type
|
case Hardware::CPU.type
|
||||||
when :ppc
|
when :ppc
|
||||||
abort <<-EOS.undent
|
abort <<~EOS
|
||||||
Sorry, Homebrew does not support your computer's CPU architecture.
|
Sorry, Homebrew does not support your computer's CPU architecture.
|
||||||
For PPC support, see: https://github.com/mistydemeo/tigerbrew
|
For PPC support, see: https://github.com/mistydemeo/tigerbrew
|
||||||
EOS
|
EOS
|
||||||
@ -308,7 +308,7 @@ module Homebrew
|
|||||||
def check_cellar
|
def check_cellar
|
||||||
FileUtils.mkdir_p HOMEBREW_CELLAR unless File.exist? HOMEBREW_CELLAR
|
FileUtils.mkdir_p HOMEBREW_CELLAR unless File.exist? HOMEBREW_CELLAR
|
||||||
rescue
|
rescue
|
||||||
raise <<-EOS.undent
|
raise <<~EOS
|
||||||
Could not create #{HOMEBREW_CELLAR}
|
Could not create #{HOMEBREW_CELLAR}
|
||||||
Check you have permission to write to #{HOMEBREW_CELLAR.parent}
|
Check you have permission to write to #{HOMEBREW_CELLAR.parent}
|
||||||
EOS
|
EOS
|
||||||
|
|||||||
@ -9,7 +9,7 @@ module Homebrew
|
|||||||
module_function
|
module_function
|
||||||
|
|
||||||
def leaves
|
def leaves
|
||||||
installed = Formula.installed
|
installed = Formula.installed.sort
|
||||||
deps_of_installed = Set.new
|
deps_of_installed = Set.new
|
||||||
|
|
||||||
installed.each do |f|
|
installed.each do |f|
|
||||||
|
|||||||
@ -29,7 +29,7 @@ module Homebrew
|
|||||||
keg_only = keg_only?(keg.rack)
|
keg_only = keg_only?(keg.rack)
|
||||||
if HOMEBREW_PREFIX.to_s == "/usr/local" && keg_only &&
|
if HOMEBREW_PREFIX.to_s == "/usr/local" && keg_only &&
|
||||||
keg.name.start_with?("openssl", "libressl")
|
keg.name.start_with?("openssl", "libressl")
|
||||||
opoo <<-EOS.undent
|
opoo <<~EOS
|
||||||
Refusing to link: #{keg.name}
|
Refusing to link: #{keg.name}
|
||||||
Linking keg-only #{keg.name} means you may end up linking against the insecure,
|
Linking keg-only #{keg.name} means you may end up linking against the insecure,
|
||||||
deprecated system OpenSSL while using the headers from Homebrew's #{keg.name}.
|
deprecated system OpenSSL while using the headers from Homebrew's #{keg.name}.
|
||||||
|
|||||||
@ -19,7 +19,7 @@ module Homebrew
|
|||||||
module_function
|
module_function
|
||||||
|
|
||||||
def linkapps
|
def linkapps
|
||||||
opoo <<-EOS.undent
|
opoo <<~EOS
|
||||||
`brew linkapps` has been deprecated and will eventually be removed!
|
`brew linkapps` has been deprecated and will eventually be removed!
|
||||||
|
|
||||||
Unfortunately `brew linkapps` cannot behave nicely with e.g. Spotlight using
|
Unfortunately `brew linkapps` cannot behave nicely with e.g. Spotlight using
|
||||||
|
|||||||
@ -39,7 +39,7 @@ module Homebrew
|
|||||||
filtered_list
|
filtered_list
|
||||||
elsif ARGV.named.empty?
|
elsif ARGV.named.empty?
|
||||||
if ARGV.include? "--full-name"
|
if ARGV.include? "--full-name"
|
||||||
full_names = Formula.installed.map(&:full_name).sort &tap_and_name_comparison
|
full_names = Formula.installed.map(&:full_name).sort(&tap_and_name_comparison)
|
||||||
return if full_names.empty?
|
return if full_names.empty?
|
||||||
puts Formatter.columns(full_names)
|
puts Formatter.columns(full_names)
|
||||||
else
|
else
|
||||||
@ -87,7 +87,7 @@ module Homebrew
|
|||||||
dirs.delete "etc"
|
dirs.delete "etc"
|
||||||
dirs.delete "var"
|
dirs.delete "var"
|
||||||
|
|
||||||
args = dirs + %w[-type f (]
|
args = dirs.sort + %w[-type f (]
|
||||||
args.concat UNBREWED_EXCLUDE_FILES.flat_map { |f| %W[! -name #{f}] }
|
args.concat UNBREWED_EXCLUDE_FILES.flat_map { |f| %W[! -name #{f}] }
|
||||||
args.concat UNBREWED_EXCLUDE_PATHS.flat_map { |d| %W[! -path #{d}] }
|
args.concat UNBREWED_EXCLUDE_PATHS.flat_map { |d| %W[! -path #{d}] }
|
||||||
args.concat %w[)]
|
args.concat %w[)]
|
||||||
|
|||||||
@ -31,7 +31,7 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
if File.exist? "#{repo}/.git/shallow"
|
if File.exist? "#{repo}/.git/shallow"
|
||||||
opoo <<-EOS.undent
|
opoo <<~EOS
|
||||||
#{name} is a shallow clone so only partial output will be shown.
|
#{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
|
git -C "#{git_cd}" fetch --unshallow
|
||||||
|
|||||||
@ -16,9 +16,9 @@ module Homebrew
|
|||||||
return unless HOMEBREW_CELLAR.exist?
|
return unless HOMEBREW_CELLAR.exist?
|
||||||
|
|
||||||
ff = if ARGV.named.empty?
|
ff = if ARGV.named.empty?
|
||||||
Formula.installed
|
Formula.installed.sort
|
||||||
else
|
else
|
||||||
ARGV.resolved_formulae
|
ARGV.resolved_formulae.sort
|
||||||
end
|
end
|
||||||
|
|
||||||
ff.each do |f|
|
ff.each do |f|
|
||||||
|
|||||||
@ -16,9 +16,9 @@ module Homebrew
|
|||||||
|
|
||||||
def options
|
def options
|
||||||
if ARGV.include? "--all"
|
if ARGV.include? "--all"
|
||||||
puts_options Formula.to_a
|
puts_options Formula.to_a.sort
|
||||||
elsif ARGV.include? "--installed"
|
elsif ARGV.include? "--installed"
|
||||||
puts_options Formula.installed
|
puts_options Formula.installed.sort
|
||||||
else
|
else
|
||||||
raise FormulaUnspecifiedError if ARGV.named.empty?
|
raise FormulaUnspecifiedError if ARGV.named.empty?
|
||||||
puts_options ARGV.formulae
|
puts_options ARGV.formulae
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
#: @hide_from_man_page
|
#: @hide_from_man_page
|
||||||
#: * `readall` [tap]:
|
#: * `readall` [tap]:
|
||||||
#: Import all formulae in a tap (defaults to core tap).
|
#: Import all formulae from specified taps (defaults to
|
||||||
|
#: all installed taps).
|
||||||
#:
|
#:
|
||||||
#: This can be useful for debugging issues across all formulae
|
#: This can be useful for debugging issues across all formulae
|
||||||
#: when making significant changes to `formula.rb`,
|
#: when making significant changes to `formula.rb`,
|
||||||
@ -13,16 +14,8 @@ module Homebrew
|
|||||||
|
|
||||||
def readall
|
def readall
|
||||||
if ARGV.include?("--syntax")
|
if ARGV.include?("--syntax")
|
||||||
ruby_files = []
|
scan_files = "#{HOMEBREW_LIBRARY_PATH}/**/*.rb"
|
||||||
scan_files = %W[
|
ruby_files = Dir.glob(scan_files).reject { |file| file =~ %r{/(vendor|cask)/} }
|
||||||
#{HOMEBREW_LIBRARY}/*.rb
|
|
||||||
#{HOMEBREW_LIBRARY}/Homebrew/**/*.rb
|
|
||||||
]
|
|
||||||
Dir.glob(scan_files).each do |rb|
|
|
||||||
next if rb.include?("/vendor/")
|
|
||||||
next if rb.include?("/cask/")
|
|
||||||
ruby_files << rb
|
|
||||||
end
|
|
||||||
|
|
||||||
Homebrew.failed = true unless Readall.valid_ruby_syntax?(ruby_files)
|
Homebrew.failed = true unless Readall.valid_ruby_syntax?(ruby_files)
|
||||||
end
|
end
|
||||||
@ -31,7 +24,7 @@ module Homebrew
|
|||||||
taps = if ARGV.named.empty?
|
taps = if ARGV.named.empty?
|
||||||
Tap
|
Tap
|
||||||
else
|
else
|
||||||
[Tap.fetch(ARGV.named.first)]
|
ARGV.named.map { |t| Tap.fetch(t) }
|
||||||
end
|
end
|
||||||
taps.each do |tap|
|
taps.each do |tap|
|
||||||
Homebrew.failed = true unless Readall.valid_tap?(tap, options)
|
Homebrew.failed = true unless Readall.valid_tap?(tap, options)
|
||||||
|
|||||||
@ -24,7 +24,7 @@ module Homebrew
|
|||||||
|
|
||||||
def search
|
def search
|
||||||
if ARGV.empty?
|
if ARGV.empty?
|
||||||
puts Formatter.columns(Formula.full_names)
|
puts Formatter.columns(Formula.full_names.sort)
|
||||||
elsif ARGV.include? "--macports"
|
elsif ARGV.include? "--macports"
|
||||||
exec_browser "https://www.macports.org/ports.php?by=name&substr=#{ARGV.next}"
|
exec_browser "https://www.macports.org/ports.php?by=name&substr=#{ARGV.next}"
|
||||||
elsif ARGV.include? "--fink"
|
elsif ARGV.include? "--fink"
|
||||||
@ -52,15 +52,15 @@ module Homebrew
|
|||||||
results = search_taps(name)
|
results = search_taps(name)
|
||||||
end
|
end
|
||||||
|
|
||||||
puts Formatter.columns(results) unless results.empty?
|
puts Formatter.columns(results.sort) unless results.empty?
|
||||||
else
|
else
|
||||||
query = ARGV.first
|
query = ARGV.first
|
||||||
regex = query_regexp(query)
|
regex = query_regexp(query)
|
||||||
local_results = search_formulae(regex)
|
local_results = search_formulae(regex)
|
||||||
puts Formatter.columns(local_results) unless local_results.empty?
|
puts Formatter.columns(local_results.sort) unless local_results.empty?
|
||||||
|
|
||||||
tap_results = search_taps(query)
|
tap_results = search_taps(query)
|
||||||
puts Formatter.columns(tap_results) unless tap_results.empty?
|
puts Formatter.columns(tap_results.sort) unless tap_results.empty?
|
||||||
|
|
||||||
if $stdout.tty?
|
if $stdout.tty?
|
||||||
count = local_results.length + tap_results.length
|
count = local_results.length + tap_results.length
|
||||||
@ -87,7 +87,7 @@ module Homebrew
|
|||||||
arg.include?(char) && !arg.start_with?("/")
|
arg.include?(char) && !arg.start_with?("/")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
ohai <<-EOS.undent
|
ohai <<~EOS
|
||||||
Did you mean to perform a regular expression search?
|
Did you mean to perform a regular expression search?
|
||||||
Surround your query with /slashes/ to search locally by regex.
|
Surround your query with /slashes/ to search locally by regex.
|
||||||
EOS
|
EOS
|
||||||
|
|||||||
@ -27,14 +27,14 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
ENV["PS1"] = 'brew \[\033[1;32m\]\w\[\033[0m\]$ '
|
ENV["PS1"] = 'brew \[\033[1;32m\]\w\[\033[0m\]$ '
|
||||||
ENV["VERBOSE"] = "1"
|
ENV["VERBOSE"] = "1"
|
||||||
puts <<-EOS.undent_________________________________________________________72
|
puts <<~EOS
|
||||||
Your shell has been configured to use Homebrew's build environment;
|
Your shell has been configured to use Homebrew's build environment;
|
||||||
this should help you build stuff. Notably though, the system versions of
|
this should help you build stuff. Notably though, the system versions of
|
||||||
gem and pip will ignore our configuration and insist on using the
|
gem and pip will ignore our configuration and insist on using the
|
||||||
environment they were built under (mostly). Sadly, scons will also
|
environment they were built under (mostly). Sadly, scons will also
|
||||||
ignore our configuration.
|
ignore our configuration.
|
||||||
When done, type `exit'.
|
When done, type `exit'.
|
||||||
EOS
|
EOS
|
||||||
$stdout.flush
|
$stdout.flush
|
||||||
exec ENV["SHELL"]
|
exec ENV["SHELL"]
|
||||||
end
|
end
|
||||||
|
|||||||
@ -21,10 +21,11 @@ module Homebrew
|
|||||||
module_function
|
module_function
|
||||||
|
|
||||||
def tap_info
|
def tap_info
|
||||||
|
# TODO: This still returns a non-alphabetised list on APFS.
|
||||||
if ARGV.include? "--installed"
|
if ARGV.include? "--installed"
|
||||||
taps = Tap
|
taps = Tap
|
||||||
else
|
else
|
||||||
taps = ARGV.named.map do |name|
|
taps = ARGV.named.sort.map do |name|
|
||||||
Tap.fetch(name)
|
Tap.fetch(name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -131,7 +131,7 @@ module Homebrew
|
|||||||
|
|
||||||
class DeveloperDependentsMessage < DependentsMessage
|
class DeveloperDependentsMessage < DependentsMessage
|
||||||
def output
|
def output
|
||||||
opoo <<-EOS.undent
|
opoo <<~EOS
|
||||||
#{list reqs} #{are_required_by_deps}.
|
#{list reqs} #{are_required_by_deps}.
|
||||||
You can silence this warning with:
|
You can silence this warning with:
|
||||||
#{sample_command}
|
#{sample_command}
|
||||||
@ -141,7 +141,7 @@ module Homebrew
|
|||||||
|
|
||||||
class NondeveloperDependentsMessage < DependentsMessage
|
class NondeveloperDependentsMessage < DependentsMessage
|
||||||
def output
|
def output
|
||||||
ofail <<-EOS.undent
|
ofail <<~EOS
|
||||||
Refusing to uninstall #{list reqs}
|
Refusing to uninstall #{list reqs}
|
||||||
because #{they reqs} #{are_required_by_deps}.
|
because #{they reqs} #{are_required_by_deps}.
|
||||||
You can override this and force removal with:
|
You can override this and force removal with:
|
||||||
|
|||||||
@ -20,7 +20,7 @@ module Homebrew
|
|||||||
module_function
|
module_function
|
||||||
|
|
||||||
def unlinkapps
|
def unlinkapps
|
||||||
opoo <<-EOS.undent
|
opoo <<~EOS
|
||||||
`brew unlinkapps` has been deprecated and will eventually be removed!
|
`brew unlinkapps` has been deprecated and will eventually be removed!
|
||||||
|
|
||||||
Unfortunately `brew linkapps` cannot behave nicely with e.g. Spotlight using either aliases or symlinks and Homebrew formulae do not build "proper" `.app` bundles that can be relocated. Instead, please consider using `brew cask` and migrate formulae using `.app`s to casks.
|
Unfortunately `brew linkapps` cannot behave nicely with e.g. Spotlight using either aliases or symlinks and Homebrew formulae do not build "proper" `.app` bundles that can be relocated. Instead, please consider using `brew cask` and migrate formulae using `.app`s to casks.
|
||||||
|
|||||||
@ -33,7 +33,7 @@ module Homebrew
|
|||||||
|
|
||||||
# Use an extra newline and bold to avoid this being missed.
|
# Use an extra newline and bold to avoid this being missed.
|
||||||
ohai "Homebrew has enabled anonymous aggregate user behaviour analytics."
|
ohai "Homebrew has enabled anonymous aggregate user behaviour analytics."
|
||||||
puts <<-EOS.undent
|
puts <<~EOS
|
||||||
#{Tty.bold}Read the analytics documentation (and how to opt-out) here:
|
#{Tty.bold}Read the analytics documentation (and how to opt-out) here:
|
||||||
#{Formatter.url("https://docs.brew.sh/Analytics.html")}#{Tty.reset}
|
#{Formatter.url("https://docs.brew.sh/Analytics.html")}#{Tty.reset}
|
||||||
|
|
||||||
@ -167,7 +167,7 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
if @migration_failed
|
if @migration_failed
|
||||||
opoo <<-EOS.undent
|
opoo <<~EOS
|
||||||
Failed to migrate #{legacy_cache} to
|
Failed to migrate #{legacy_cache} to
|
||||||
#{HOMEBREW_CACHE}. Please do so manually.
|
#{HOMEBREW_CACHE}. Please do so manually.
|
||||||
EOS
|
EOS
|
||||||
@ -176,7 +176,7 @@ module Homebrew
|
|||||||
FileUtils.rm_rf legacy_cache
|
FileUtils.rm_rf legacy_cache
|
||||||
if legacy_cache.exist?
|
if legacy_cache.exist?
|
||||||
FileUtils.touch migration_attempted_file
|
FileUtils.touch migration_attempted_file
|
||||||
opoo <<-EOS.undent
|
opoo <<~EOS
|
||||||
Failed to delete #{legacy_cache}.
|
Failed to delete #{legacy_cache}.
|
||||||
Please do so manually.
|
Please do so manually.
|
||||||
EOS
|
EOS
|
||||||
@ -191,7 +191,7 @@ module Homebrew
|
|||||||
ohai "Migrating HOMEBREW_REPOSITORY (please wait)..."
|
ohai "Migrating HOMEBREW_REPOSITORY (please wait)..."
|
||||||
|
|
||||||
unless HOMEBREW_PREFIX.writable_real?
|
unless HOMEBREW_PREFIX.writable_real?
|
||||||
ofail <<-EOS.undent
|
ofail <<~EOS
|
||||||
#{HOMEBREW_PREFIX} is not writable.
|
#{HOMEBREW_PREFIX} is not writable.
|
||||||
|
|
||||||
You should change the ownership and permissions of #{HOMEBREW_PREFIX}
|
You should change the ownership and permissions of #{HOMEBREW_PREFIX}
|
||||||
@ -205,7 +205,7 @@ module Homebrew
|
|||||||
new_homebrew_repository = Pathname.new "/usr/local/Homebrew"
|
new_homebrew_repository = Pathname.new "/usr/local/Homebrew"
|
||||||
new_homebrew_repository.rmdir_if_possible
|
new_homebrew_repository.rmdir_if_possible
|
||||||
if new_homebrew_repository.exist?
|
if new_homebrew_repository.exist?
|
||||||
ofail <<-EOS.undent
|
ofail <<~EOS
|
||||||
#{new_homebrew_repository} already exists.
|
#{new_homebrew_repository} already exists.
|
||||||
Please remove it manually or uninstall and reinstall Homebrew into a new
|
Please remove it manually or uninstall and reinstall Homebrew into a new
|
||||||
location as the migration cannot be done automatically.
|
location as the migration cannot be done automatically.
|
||||||
@ -258,7 +258,7 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
unless unremovable_paths.empty?
|
unless unremovable_paths.empty?
|
||||||
ofail <<-EOS.undent
|
ofail <<~EOS
|
||||||
Could not remove old HOMEBREW_REPOSITORY paths!
|
Could not remove old HOMEBREW_REPOSITORY paths!
|
||||||
Please do this manually with:
|
Please do this manually with:
|
||||||
sudo rm -rf #{unremovable_paths.join " "}
|
sudo rm -rf #{unremovable_paths.join " "}
|
||||||
@ -274,7 +274,7 @@ module Homebrew
|
|||||||
begin
|
begin
|
||||||
FileUtils.ln_s(src.relative_path_from(dst.parent), dst)
|
FileUtils.ln_s(src.relative_path_from(dst.parent), dst)
|
||||||
rescue Errno::EACCES, Errno::ENOENT
|
rescue Errno::EACCES, Errno::ENOENT
|
||||||
ofail <<-EOS.undent
|
ofail <<~EOS
|
||||||
Could not create symlink at #{dst}!
|
Could not create symlink at #{dst}!
|
||||||
Please do this manually with:
|
Please do this manually with:
|
||||||
sudo ln -sf #{src} #{dst}
|
sudo ln -sf #{src} #{dst}
|
||||||
@ -285,13 +285,13 @@ module Homebrew
|
|||||||
link_completions_manpages_and_docs(new_homebrew_repository)
|
link_completions_manpages_and_docs(new_homebrew_repository)
|
||||||
|
|
||||||
ohai "Migrated HOMEBREW_REPOSITORY to #{new_homebrew_repository}!"
|
ohai "Migrated HOMEBREW_REPOSITORY to #{new_homebrew_repository}!"
|
||||||
puts <<-EOS.undent
|
puts <<~EOS
|
||||||
Homebrew no longer needs to have ownership of /usr/local. If you wish you can
|
Homebrew no longer needs to have ownership of /usr/local. If you wish you can
|
||||||
return /usr/local to its default ownership with:
|
return /usr/local to its default ownership with:
|
||||||
sudo chown root:wheel #{HOMEBREW_PREFIX}
|
sudo chown root:wheel #{HOMEBREW_PREFIX}
|
||||||
EOS
|
EOS
|
||||||
rescue => e
|
rescue => e
|
||||||
ofail <<-EOS.undent
|
ofail <<~EOS
|
||||||
#{Tty.bold}Failed to migrate HOMEBREW_REPOSITORY to #{new_homebrew_repository}!#{Tty.reset}
|
#{Tty.bold}Failed to migrate HOMEBREW_REPOSITORY to #{new_homebrew_repository}!#{Tty.reset}
|
||||||
The error was:
|
The error was:
|
||||||
#{e}
|
#{e}
|
||||||
@ -309,7 +309,7 @@ module Homebrew
|
|||||||
Utils::Link.link_manpages(repository, command)
|
Utils::Link.link_manpages(repository, command)
|
||||||
Utils::Link.link_docs(repository, command)
|
Utils::Link.link_docs(repository, command)
|
||||||
rescue => e
|
rescue => e
|
||||||
ofail <<-EOS.undent
|
ofail <<~EOS
|
||||||
Failed to link all completions, docs and manpages:
|
Failed to link all completions, docs and manpages:
|
||||||
#{e}
|
#{e}
|
||||||
EOS
|
EOS
|
||||||
@ -449,7 +449,7 @@ class Reporter
|
|||||||
next unless (HOMEBREW_PREFIX/"Caskroom"/new_name).exist?
|
next unless (HOMEBREW_PREFIX/"Caskroom"/new_name).exist?
|
||||||
new_tap = Tap.fetch(new_tap_name)
|
new_tap = Tap.fetch(new_tap_name)
|
||||||
new_tap.install unless new_tap.installed?
|
new_tap.install unless new_tap.installed?
|
||||||
ohai "#{name} has been moved to Homebrew.", <<-EOS.undent
|
ohai "#{name} has been moved to Homebrew.", <<~EOS
|
||||||
To uninstall the cask run:
|
To uninstall the cask run:
|
||||||
brew cask uninstall --force #{name}
|
brew cask uninstall --force #{name}
|
||||||
EOS
|
EOS
|
||||||
@ -480,14 +480,14 @@ class Reporter
|
|||||||
system HOMEBREW_BREW_FILE, "prune"
|
system HOMEBREW_BREW_FILE, "prune"
|
||||||
ohai "brew cask install #{new_name}"
|
ohai "brew cask install #{new_name}"
|
||||||
system HOMEBREW_BREW_FILE, "cask", "install", new_name
|
system HOMEBREW_BREW_FILE, "cask", "install", new_name
|
||||||
ohai <<-EOS.undent
|
ohai <<~EOS
|
||||||
#{name} has been moved to Homebrew-Cask.
|
#{name} has been moved to Homebrew-Cask.
|
||||||
The existing keg has been unlinked.
|
The existing keg has been unlinked.
|
||||||
Please uninstall the formula when convenient by running:
|
Please uninstall the formula when convenient by running:
|
||||||
brew uninstall --force #{name}
|
brew uninstall --force #{name}
|
||||||
EOS
|
EOS
|
||||||
else
|
else
|
||||||
ohai "#{name} has been moved to Homebrew-Cask.", <<-EOS.undent
|
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 uninstall --force #{name}
|
||||||
brew cask install #{new_name}
|
brew cask install #{new_name}
|
||||||
@ -598,7 +598,7 @@ class ReporterHub
|
|||||||
return if formulae.empty?
|
return if formulae.empty?
|
||||||
# Dump formula list.
|
# Dump formula list.
|
||||||
ohai title
|
ohai title
|
||||||
puts Formatter.columns(formulae)
|
puts Formatter.columns(formulae.sort)
|
||||||
end
|
end
|
||||||
|
|
||||||
def installed?(formula)
|
def installed?(formula)
|
||||||
|
|||||||
@ -26,7 +26,7 @@ module Homebrew
|
|||||||
Homebrew.perform_preinstall_checks
|
Homebrew.perform_preinstall_checks
|
||||||
|
|
||||||
if ARGV.include?("--all")
|
if ARGV.include?("--all")
|
||||||
opoo <<-EOS.undent
|
opoo <<~EOS
|
||||||
We decided to not change the behaviour of `brew upgrade` so
|
We decided to not change the behaviour of `brew upgrade` so
|
||||||
`brew upgrade --all` is equivalent to `brew upgrade` without any other
|
`brew upgrade --all` is equivalent to `brew upgrade` without any other
|
||||||
arguments (so the `--all` is a no-op and can be removed).
|
arguments (so the `--all` is a no-op and can be removed).
|
||||||
|
|||||||
@ -125,7 +125,7 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
return if uses.empty?
|
return if uses.empty?
|
||||||
puts Formatter.columns(uses.map(&:full_name))
|
puts Formatter.columns(uses.map(&:full_name).sort)
|
||||||
odie "Missing formulae should not have dependents!" if used_formulae_missing
|
odie "Missing formulae should not have dependents!" if used_formulae_missing
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -21,8 +21,8 @@ then
|
|||||||
fi
|
fi
|
||||||
elif [[ -n "$HOMEBREW_LINUX" ]]
|
elif [[ -n "$HOMEBREW_LINUX" ]]
|
||||||
then
|
then
|
||||||
ruby_URL="https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.x86_64_linux.bottle.tar.gz"
|
ruby_URL="https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.x86_64_linux.bottle.1.tar.gz"
|
||||||
ruby_SHA="543c18bd33a300e6c16671437b1e0f17b03bb64e6a485fc15ff7de1eb1a0bc2a"
|
ruby_SHA="33643b1ca6f860d6df01686636326785763e5e81cf0cef37d8a7ab96a6ca1fa1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fetch() {
|
fetch() {
|
||||||
@ -81,9 +81,9 @@ fetch() {
|
|||||||
trap - SIGINT
|
trap - SIGINT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -x "$(which shasum)" ]]
|
if [[ -x "/usr/bin/shasum" ]]
|
||||||
then
|
then
|
||||||
sha="$(shasum -a 256 "$CACHED_LOCATION" | cut -d' ' -f1)"
|
sha="$(/usr/bin/shasum -a 256 "$CACHED_LOCATION" | cut -d' ' -f1)"
|
||||||
elif [[ -x "$(which sha256sum)" ]]
|
elif [[ -x "$(which sha256sum)" ]]
|
||||||
then
|
then
|
||||||
sha="$(sha256sum "$CACHED_LOCATION" | cut -d' ' -f1)"
|
sha="$(sha256sum "$CACHED_LOCATION" | cut -d' ' -f1)"
|
||||||
|
|||||||
@ -26,3 +26,4 @@ require "compat/ENV/shared"
|
|||||||
require "compat/ENV/std"
|
require "compat/ENV/std"
|
||||||
require "compat/ENV/super"
|
require "compat/ENV/super"
|
||||||
require "compat/utils/shell"
|
require "compat/utils/shell"
|
||||||
|
require "compat/extend/string"
|
||||||
|
|||||||
18
Library/Homebrew/compat/extend/string.rb
Normal file
18
Library/Homebrew/compat/extend/string.rb
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
class String
|
||||||
|
def undent
|
||||||
|
gsub(/^[ \t]{#{(slice(/^[ \t]+/) || '').length}}/, "")
|
||||||
|
end
|
||||||
|
alias unindent undent
|
||||||
|
|
||||||
|
# eg:
|
||||||
|
# if foo then <<-EOS.undent_________________________________________________________72
|
||||||
|
# Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
|
||||||
|
# eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
|
||||||
|
# minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip
|
||||||
|
# ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
|
||||||
|
# voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
|
||||||
|
# sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
|
||||||
|
# mollit anim id est laborum.
|
||||||
|
# EOS
|
||||||
|
alias undent_________________________________________________________72 undent
|
||||||
|
end
|
||||||
@ -31,7 +31,7 @@ class AmazonWebServicesFormula < Formula
|
|||||||
def standard_instructions(home_name, home_value = libexec)
|
def standard_instructions(home_name, home_value = libexec)
|
||||||
odeprecated "AmazonWebServicesFormula#standard_instructions", "Formula#caveats"
|
odeprecated "AmazonWebServicesFormula#standard_instructions", "Formula#caveats"
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Before you can use these tools you must export some variables to your $SHELL.
|
Before you can use these tools you must export some variables to your $SHELL.
|
||||||
|
|
||||||
To export the needed variables, add them to your dotfiles.
|
To export the needed variables, add them to your dotfiles.
|
||||||
|
|||||||
@ -5,7 +5,7 @@ module Hbc
|
|||||||
include Options
|
include Options
|
||||||
|
|
||||||
option "--binarydir=PATH", (lambda do |*|
|
option "--binarydir=PATH", (lambda do |*|
|
||||||
opoo <<-EOS.undent
|
opoo <<~EOS
|
||||||
Option --binarydir is obsolete!
|
Option --binarydir is obsolete!
|
||||||
Homebrew-Cask now uses the same location as your Homebrew installation for executable links.
|
Homebrew-Cask now uses the same location as your Homebrew installation for executable links.
|
||||||
EOS
|
EOS
|
||||||
|
|||||||
@ -17,3 +17,4 @@ PythonDependency = PythonRequirement
|
|||||||
TuntapDependency = TuntapRequirement
|
TuntapDependency = TuntapRequirement
|
||||||
X11Dependency = X11Requirement
|
X11Dependency = X11Requirement
|
||||||
ConflictsWithBinaryOsxfuse = NonBinaryOsxfuseRequirement
|
ConflictsWithBinaryOsxfuse = NonBinaryOsxfuseRequirement
|
||||||
|
MinimumMacOSRequirement = MacOSRequirement
|
||||||
|
|||||||
@ -2,4 +2,4 @@
|
|||||||
|
|
||||||
# RuboCop version used for `brew style` and `brew cask style`
|
# RuboCop version used for `brew style` and `brew cask style`
|
||||||
HOMEBREW_RUBOCOP_VERSION = "0.50.0"
|
HOMEBREW_RUBOCOP_VERSION = "0.50.0"
|
||||||
HOMEBREW_RUBOCOP_CASK_VERSION = "~> 0.14.2" # has to be updated when RuboCop version changes
|
HOMEBREW_RUBOCOP_CASK_VERSION = "~> 0.14.4" # has to be updated when RuboCop version changes
|
||||||
|
|||||||
@ -5,7 +5,7 @@ class CxxStdlib
|
|||||||
|
|
||||||
class CompatibilityError < StandardError
|
class CompatibilityError < StandardError
|
||||||
def initialize(formula, dep, stdlib)
|
def initialize(formula, dep, stdlib)
|
||||||
super <<-EOS.undent
|
super <<~EOS
|
||||||
#{formula.full_name} dependency #{dep.name} was built with a different C++ standard
|
#{formula.full_name} dependency #{dep.name} was built with a different C++ standard
|
||||||
library (#{stdlib.type_string} from #{stdlib.compiler}). This may cause problems at runtime.
|
library (#{stdlib.type_string} from #{stdlib.compiler}). This may cause problems at runtime.
|
||||||
EOS
|
EOS
|
||||||
|
|||||||
@ -105,7 +105,8 @@ class DependencyCollector
|
|||||||
case spec
|
case spec
|
||||||
when :x11 then X11Requirement.new(spec.to_s, tags)
|
when :x11 then X11Requirement.new(spec.to_s, tags)
|
||||||
when :xcode then XcodeRequirement.new(tags)
|
when :xcode then XcodeRequirement.new(tags)
|
||||||
when :macos then MinimumMacOSRequirement.new(tags)
|
when :linux then LinuxRequirement.new(tags)
|
||||||
|
when :macos then MacOSRequirement.new(tags)
|
||||||
when :mysql then MysqlRequirement.new(tags)
|
when :mysql then MysqlRequirement.new(tags)
|
||||||
when :postgresql then PostgresqlRequirement.new(tags)
|
when :postgresql then PostgresqlRequirement.new(tags)
|
||||||
when :gpg then GPG2Requirement.new(tags)
|
when :gpg then GPG2Requirement.new(tags)
|
||||||
|
|||||||
@ -368,7 +368,7 @@ class FormulaAuditor
|
|||||||
|
|
||||||
if valid_versioned_aliases.empty?
|
if valid_versioned_aliases.empty?
|
||||||
if formula.tap
|
if formula.tap
|
||||||
problem <<-EOS.undent
|
problem <<~EOS
|
||||||
Formula has other versions so create a versioned alias:
|
Formula has other versions so create a versioned alias:
|
||||||
cd #{formula.tap.alias_dir}
|
cd #{formula.tap.alias_dir}
|
||||||
ln -s #{formula.path.to_s.gsub(formula.tap.path, "..")} #{alias_name}
|
ln -s #{formula.path.to_s.gsub(formula.tap.path, "..")} #{alias_name}
|
||||||
@ -379,7 +379,7 @@ class FormulaAuditor
|
|||||||
end
|
end
|
||||||
|
|
||||||
unless invalid_versioned_aliases.empty?
|
unless invalid_versioned_aliases.empty?
|
||||||
problem <<-EOS.undent
|
problem <<~EOS
|
||||||
Formula has invalid versioned aliases:
|
Formula has invalid versioned aliases:
|
||||||
#{invalid_versioned_aliases.join("\n ")}
|
#{invalid_versioned_aliases.join("\n ")}
|
||||||
EOS
|
EOS
|
||||||
@ -476,7 +476,7 @@ class FormulaAuditor
|
|||||||
when "gfortran"
|
when "gfortran"
|
||||||
problem "Use `depends_on :fortran` instead of `depends_on 'gfortran'`"
|
problem "Use `depends_on :fortran` instead of `depends_on 'gfortran'`"
|
||||||
when "ruby"
|
when "ruby"
|
||||||
problem <<-EOS.undent
|
problem <<~EOS
|
||||||
Don't use "ruby" as a dependency. If this formula requires a
|
Don't use "ruby" as a dependency. If this formula requires a
|
||||||
minimum Ruby version not provided by the system you should
|
minimum Ruby version not provided by the system you should
|
||||||
use the RubyRequirement:
|
use the RubyRequirement:
|
||||||
@ -484,7 +484,7 @@ class FormulaAuditor
|
|||||||
where "1.8" is the minimum version of Ruby required.
|
where "1.8" is the minimum version of Ruby required.
|
||||||
EOS
|
EOS
|
||||||
when "open-mpi", "mpich"
|
when "open-mpi", "mpich"
|
||||||
problem <<-EOS.undent
|
problem <<~EOS
|
||||||
There are multiple conflicting ways to install MPI. Use an MPIRequirement:
|
There are multiple conflicting ways to install MPI. Use an MPIRequirement:
|
||||||
depends_on :mpi => [<lang list>]
|
depends_on :mpi => [<lang list>]
|
||||||
Where <lang list> is a comma delimited list that can include:
|
Where <lang list> is a comma delimited list that can include:
|
||||||
@ -492,7 +492,7 @@ class FormulaAuditor
|
|||||||
EOS
|
EOS
|
||||||
when *BUILD_TIME_DEPS
|
when *BUILD_TIME_DEPS
|
||||||
next if dep.build? || dep.run?
|
next if dep.build? || dep.run?
|
||||||
problem <<-EOS.undent
|
problem <<~EOS
|
||||||
#{dep} dependency should be
|
#{dep} dependency should be
|
||||||
depends_on "#{dep}" => :build
|
depends_on "#{dep}" => :build
|
||||||
Or if it is indeed a runtime dependency
|
Or if it is indeed a runtime dependency
|
||||||
@ -541,7 +541,7 @@ class FormulaAuditor
|
|||||||
first_word = reason.split[0]
|
first_word = reason.split[0]
|
||||||
|
|
||||||
if reason =~ /\A[A-Z]/ && !reason.start_with?(*whitelist)
|
if reason =~ /\A[A-Z]/ && !reason.start_with?(*whitelist)
|
||||||
problem <<-EOS.undent
|
problem <<~EOS
|
||||||
'#{first_word}' from the keg_only reason should be '#{first_word.downcase}'.
|
'#{first_word}' from the keg_only reason should be '#{first_word.downcase}'.
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
@ -854,7 +854,7 @@ class FormulaAuditor
|
|||||||
return unless formula.tap&.official?
|
return unless formula.tap&.official?
|
||||||
return unless formula.tap.tap_migrations.key?(formula.name)
|
return unless formula.tap.tap_migrations.key?(formula.name)
|
||||||
|
|
||||||
problem <<-EOS.undent
|
problem <<~EOS
|
||||||
#{formula.name} seems to be listed in tap_migrations.json!
|
#{formula.name} seems to be listed in tap_migrations.json!
|
||||||
Please remove #{formula.name} from present tap & tap_migrations.json
|
Please remove #{formula.name} from present tap & tap_migrations.json
|
||||||
before submitting it to Homebrew/homebrew-#{formula.tap.repo}.
|
before submitting it to Homebrew/homebrew-#{formula.tap.repo}.
|
||||||
@ -865,7 +865,7 @@ class FormulaAuditor
|
|||||||
return unless formula.prefix.directory?
|
return unless formula.prefix.directory?
|
||||||
return unless Keg.new(formula.prefix).empty_installation?
|
return unless Keg.new(formula.prefix).empty_installation?
|
||||||
|
|
||||||
problem <<-EOS.undent
|
problem <<~EOS
|
||||||
The installation seems to be empty. Please ensure the prefix
|
The installation seems to be empty. Please ensure the prefix
|
||||||
is set correctly and expected files are installed.
|
is set correctly and expected files are installed.
|
||||||
The prefix configure/make argument may be case-sensitive.
|
The prefix configure/make argument may be case-sensitive.
|
||||||
|
|||||||
@ -324,7 +324,7 @@ module Homebrew
|
|||||||
"#{key}: old: #{old_value}, new: #{value}"
|
"#{key}: old: #{old_value}, new: #{value}"
|
||||||
end
|
end
|
||||||
|
|
||||||
odie <<-EOS.undent
|
odie <<~EOS
|
||||||
--keep-old was passed but there are changes in:
|
--keep-old was passed but there are changes in:
|
||||||
#{mismatches.join("\n")}
|
#{mismatches.join("\n")}
|
||||||
EOS
|
EOS
|
||||||
@ -428,7 +428,7 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
unless mismatches.empty?
|
unless mismatches.empty?
|
||||||
odie <<-EOS.undent
|
odie <<~EOS
|
||||||
--keep-old was passed but there are changes in:
|
--keep-old was passed but there are changes in:
|
||||||
#{mismatches.join("\n")}
|
#{mismatches.join("\n")}
|
||||||
EOS
|
EOS
|
||||||
|
|||||||
@ -91,7 +91,7 @@ module Homebrew
|
|||||||
pull_requests = fetch_pull_requests(formula)
|
pull_requests = fetch_pull_requests(formula)
|
||||||
return unless pull_requests
|
return unless pull_requests
|
||||||
return if pull_requests.empty?
|
return if pull_requests.empty?
|
||||||
duplicates_message = <<-EOS.undent
|
duplicates_message = <<~EOS
|
||||||
These open pull requests may be duplicates:
|
These open pull requests may be duplicates:
|
||||||
#{pull_requests.map { |pr| "#{pr["title"]} #{pr["html_url"]}" }.join("\n")}
|
#{pull_requests.map { |pr| "#{pr["title"]} #{pr["html_url"]}" }.join("\n")}
|
||||||
EOS
|
EOS
|
||||||
@ -101,7 +101,7 @@ module Homebrew
|
|||||||
elsif !ARGV.force? && ARGV.flag?("--quiet")
|
elsif !ARGV.force? && ARGV.flag?("--quiet")
|
||||||
odie error_message
|
odie error_message
|
||||||
elsif !ARGV.force?
|
elsif !ARGV.force?
|
||||||
odie <<-EOS.undent
|
odie <<~EOS
|
||||||
#{duplicates_message.chomp}
|
#{duplicates_message.chomp}
|
||||||
#{error_message}
|
#{error_message}
|
||||||
EOS
|
EOS
|
||||||
@ -247,13 +247,13 @@ module Homebrew
|
|||||||
|
|
||||||
if new_formula_version < old_formula_version
|
if new_formula_version < old_formula_version
|
||||||
formula.path.atomic_write(backup_file) unless ARGV.dry_run?
|
formula.path.atomic_write(backup_file) unless ARGV.dry_run?
|
||||||
odie <<-EOS.undent
|
odie <<~EOS
|
||||||
You probably need to bump this formula manually since changing the
|
You probably need to bump this formula manually since changing the
|
||||||
version from #{old_formula_version} to #{new_formula_version} would be a downgrade.
|
version from #{old_formula_version} to #{new_formula_version} would be a downgrade.
|
||||||
EOS
|
EOS
|
||||||
elsif new_formula_version == old_formula_version
|
elsif new_formula_version == old_formula_version
|
||||||
formula.path.atomic_write(backup_file) unless ARGV.dry_run?
|
formula.path.atomic_write(backup_file) unless ARGV.dry_run?
|
||||||
odie <<-EOS.undent
|
odie <<~EOS
|
||||||
You probably need to bump this formula manually since the new version
|
You probably need to bump this formula manually since the new version
|
||||||
and old version are both #{new_formula_version}.
|
and old version are both #{new_formula_version}.
|
||||||
EOS
|
EOS
|
||||||
@ -312,17 +312,15 @@ module Homebrew
|
|||||||
remote = Utils.popen_read("hub fork 2>&1")[/remote:? (\S+)/, 1] if remote.to_s.empty?
|
remote = Utils.popen_read("hub fork 2>&1")[/remote:? (\S+)/, 1] if remote.to_s.empty?
|
||||||
odie "cannot get remote from 'hub'!" if remote.to_s.empty?
|
odie "cannot get remote from 'hub'!" if remote.to_s.empty?
|
||||||
safe_system "git", "push", "--set-upstream", remote, "#{branch}:#{branch}"
|
safe_system "git", "push", "--set-upstream", remote, "#{branch}:#{branch}"
|
||||||
pr_message = <<-EOS.undent
|
pr_message = <<~EOS
|
||||||
#{formula.name} #{new_formula_version}#{devel_message}
|
#{formula.name} #{new_formula_version}#{devel_message}
|
||||||
|
|
||||||
Created with `brew bump-formula-pr`.
|
Created with `brew bump-formula-pr`.
|
||||||
EOS
|
EOS
|
||||||
user_message = ARGV.value("message")
|
user_message = ARGV.value("message")
|
||||||
if user_message
|
if user_message
|
||||||
pr_message += <<-EOS.undent
|
pr_message += <<~EOS
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
#{user_message}
|
#{user_message}
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|||||||
@ -71,7 +71,7 @@ module Homebrew
|
|||||||
|
|
||||||
if Formula.aliases.include? fc.name
|
if Formula.aliases.include? fc.name
|
||||||
realname = Formulary.canonical_name(fc.name)
|
realname = Formulary.canonical_name(fc.name)
|
||||||
raise <<-EOS.undent
|
raise <<~EOS
|
||||||
The formula #{realname} is already aliased to #{fc.name}
|
The formula #{realname} is already aliased to #{fc.name}
|
||||||
Please check that you are not creating a duplicate.
|
Please check that you are not creating a duplicate.
|
||||||
To force creation use --force.
|
To force creation use --force.
|
||||||
@ -165,7 +165,7 @@ class FormulaCreator
|
|||||||
path.write ERB.new(template, nil, ">").result(binding)
|
path.write ERB.new(template, nil, ">").result(binding)
|
||||||
end
|
end
|
||||||
|
|
||||||
def template; <<-EOS.undent
|
def template; <<~EOS
|
||||||
# Documentation: https://docs.brew.sh/Formula-Cookbook.html
|
# Documentation: https://docs.brew.sh/Formula-Cookbook.html
|
||||||
# http://www.rubydoc.info/github/Homebrew/brew/master/Formula
|
# http://www.rubydoc.info/github/Homebrew/brew/master/Formula
|
||||||
# PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST!
|
# PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST!
|
||||||
|
|||||||
@ -11,7 +11,7 @@ module Homebrew
|
|||||||
|
|
||||||
def edit
|
def edit
|
||||||
unless (HOMEBREW_REPOSITORY/".git").directory?
|
unless (HOMEBREW_REPOSITORY/".git").directory?
|
||||||
raise <<-EOS.undent
|
raise <<~EOS
|
||||||
Changes will be lost!
|
Changes will be lost!
|
||||||
The first time you `brew update', all local changes will be lost, you should
|
The first time you `brew update', all local changes will be lost, you should
|
||||||
thus `brew update' before you `brew edit'!
|
thus `brew update' before you `brew edit'!
|
||||||
|
|||||||
@ -20,7 +20,7 @@ module Homebrew
|
|||||||
package_url = "#{bintray_repo_url}/#{bintray_package}"
|
package_url = "#{bintray_repo_url}/#{bintray_package}"
|
||||||
|
|
||||||
unless system "curl", "--silent", "--fail", "--output", "/dev/null", package_url
|
unless system "curl", "--silent", "--fail", "--output", "/dev/null", package_url
|
||||||
package_blob = <<-EOS.undent
|
package_blob = <<~EOS
|
||||||
{"name": "#{bintray_package}",
|
{"name": "#{bintray_package}",
|
||||||
"public_download_numbers": true,
|
"public_download_numbers": true,
|
||||||
"public_stats": true}
|
"public_stats": true}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#: * `pull` [`--bottle`] [`--bump`] [`--clean`] [`--ignore-whitespace`] [`--resolve`] [`--branch-okay`] [`--no-pbcopy`] [`--no-publish`] [`--warn-on-publish-failure`] <patch-source> [<patch-source>]:
|
#: * `pull` [`--bottle`] [`--bump`] [`--clean`] [`--ignore-whitespace`] [`--resolve`] [`--branch-okay`] [`--no-pbcopy`] [`--no-publish`] [`--warn-on-publish-failure`] [`--bintray-org=`<bintray-org>] [`--test-bot-user=`<test-bot-user>] <patch-source> [<patch-source>]:
|
||||||
#:
|
#:
|
||||||
#: Gets a patch from a GitHub commit or pull request and applies it to Homebrew.
|
#: Gets a patch from a GitHub commit or pull request and applies it to Homebrew.
|
||||||
#: Optionally, installs the formulae changed by the patch.
|
#: Optionally, installs the formulae changed by the patch.
|
||||||
@ -41,6 +41,12 @@
|
|||||||
#:
|
#:
|
||||||
#: If `--warn-on-publish-failure` was passed, do not exit if there's a
|
#: If `--warn-on-publish-failure` was passed, do not exit if there's a
|
||||||
#: failure publishing bottles on Bintray.
|
#: failure publishing bottles on Bintray.
|
||||||
|
#:
|
||||||
|
#: If `--bintray-org=`<bintray-org> is passed, publish at the given Bintray
|
||||||
|
#: organisation.
|
||||||
|
#:
|
||||||
|
#: If `--test-bot-user=`<test-bot-user> is passed, pull the bottle block
|
||||||
|
#: commit from the specified user on GitHub.
|
||||||
|
|
||||||
require "net/http"
|
require "net/http"
|
||||||
require "net/https"
|
require "net/https"
|
||||||
@ -52,6 +58,18 @@ require "tap"
|
|||||||
require "version"
|
require "version"
|
||||||
require "pkg_version"
|
require "pkg_version"
|
||||||
|
|
||||||
|
module GitHub
|
||||||
|
module_function
|
||||||
|
|
||||||
|
# Return the corresponding test-bot user name for the given GitHub organization.
|
||||||
|
def test_bot_user(user)
|
||||||
|
test_bot = ARGV.value "test-bot-user"
|
||||||
|
return test_bot if test_bot
|
||||||
|
return "BrewTestBot" if user.casecmp("homebrew").zero?
|
||||||
|
"#{user.capitalize}TestBot"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
module_function
|
module_function
|
||||||
|
|
||||||
@ -225,7 +243,7 @@ module Homebrew
|
|||||||
url
|
url
|
||||||
else
|
else
|
||||||
bottle_branch = "pull-bottle-#{issue}"
|
bottle_branch = "pull-bottle-#{issue}"
|
||||||
"https://github.com/BrewTestBot/homebrew-#{tap.repo}/compare/homebrew:master...pr-#{issue}"
|
"https://github.com/#{GitHub.test_bot_user user}/homebrew-#{tap.repo}/compare/#{user}:master...pr-#{issue}"
|
||||||
end
|
end
|
||||||
|
|
||||||
curl "--silent", "--fail", "--output", "/dev/null", "--head", bottle_commit_url
|
curl "--silent", "--fail", "--output", "/dev/null", "--head", bottle_commit_url
|
||||||
@ -257,7 +275,7 @@ module Homebrew
|
|||||||
str.force_encoding("UTF-8") if str.respond_to?(:force_encoding)
|
str.force_encoding("UTF-8") if str.respond_to?(:force_encoding)
|
||||||
end
|
end
|
||||||
|
|
||||||
def publish_changed_formula_bottles(_tap, changed_formulae_names)
|
def publish_changed_formula_bottles(tap, changed_formulae_names)
|
||||||
if ENV["HOMEBREW_DISABLE_LOAD_FORMULA"]
|
if ENV["HOMEBREW_DISABLE_LOAD_FORMULA"]
|
||||||
raise "Need to load formulae to publish them!"
|
raise "Need to load formulae to publish them!"
|
||||||
end
|
end
|
||||||
@ -268,7 +286,8 @@ module Homebrew
|
|||||||
changed_formulae_names.each do |name|
|
changed_formulae_names.each do |name|
|
||||||
f = Formula[name]
|
f = Formula[name]
|
||||||
next if f.bottle_unneeded? || f.bottle_disabled?
|
next if f.bottle_unneeded? || f.bottle_disabled?
|
||||||
next unless publish_bottle_file_on_bintray(f, bintray_creds)
|
bintray_org = ARGV.value("bintray-org") || tap.user.downcase
|
||||||
|
next unless publish_bottle_file_on_bintray(f, bintray_org, bintray_creds)
|
||||||
published << f.full_name
|
published << f.full_name
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -420,7 +439,7 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Publishes the current bottle files for a given formula to Bintray
|
# Publishes the current bottle files for a given formula to Bintray
|
||||||
def publish_bottle_file_on_bintray(f, creds)
|
def publish_bottle_file_on_bintray(f, bintray_org, creds)
|
||||||
repo = Utils::Bottles::Bintray.repository(f.tap)
|
repo = Utils::Bottles::Bintray.repository(f.tap)
|
||||||
package = Utils::Bottles::Bintray.package(f.name)
|
package = Utils::Bottles::Bintray.package(f.name)
|
||||||
info = FormulaInfoFromJson.lookup(f.name)
|
info = FormulaInfoFromJson.lookup(f.name)
|
||||||
@ -437,7 +456,7 @@ module Homebrew
|
|||||||
"--user", "#{creds[:user]}:#{creds[:key]}", "--request", "POST",
|
"--user", "#{creds[:user]}:#{creds[:key]}", "--request", "POST",
|
||||||
"--header", "Content-Type: application/json",
|
"--header", "Content-Type: application/json",
|
||||||
"--data", '{"publish_wait_for_secs": 0}',
|
"--data", '{"publish_wait_for_secs": 0}',
|
||||||
"https://api.bintray.com/content/homebrew/#{repo}/#{package}/#{version}/publish"
|
"https://api.bintray.com/content/#{bintray_org}/#{repo}/#{package}/#{version}/publish"
|
||||||
true
|
true
|
||||||
rescue => e
|
rescue => e
|
||||||
raise unless ARGV.include?("--warn-on-publish-failure")
|
raise unless ARGV.include?("--warn-on-publish-failure")
|
||||||
|
|||||||
@ -24,7 +24,7 @@ module Homebrew
|
|||||||
|
|
||||||
(tap.path/"Formula").mkpath
|
(tap.path/"Formula").mkpath
|
||||||
|
|
||||||
readme = <<-EOS.undent
|
readme = <<~EOS
|
||||||
# #{titleized_user} #{titleized_repo}
|
# #{titleized_user} #{titleized_repo}
|
||||||
|
|
||||||
## How do I install these formulae?
|
## How do I install these formulae?
|
||||||
@ -43,7 +43,7 @@ module Homebrew
|
|||||||
EOS
|
EOS
|
||||||
write_path(tap, "README.md", readme)
|
write_path(tap, "README.md", readme)
|
||||||
|
|
||||||
travis = <<-EOS.undent
|
travis = <<~EOS
|
||||||
language: ruby
|
language: ruby
|
||||||
os: osx
|
os: osx
|
||||||
env: OSX=10.12
|
env: OSX=10.12
|
||||||
|
|||||||
@ -88,7 +88,7 @@ module Homebrew
|
|||||||
safe_system "brew", "update", "--verbose"
|
safe_system "brew", "update", "--verbose"
|
||||||
actual_end_commit = Utils.popen_read("git", "rev-parse", branch).chomp
|
actual_end_commit = Utils.popen_read("git", "rev-parse", branch).chomp
|
||||||
if start_commit != end_commit && start_commit == actual_end_commit
|
if start_commit != end_commit && start_commit == actual_end_commit
|
||||||
raise <<-EOS.undent
|
raise <<~EOS
|
||||||
brew update didn't update #{branch}!
|
brew update didn't update #{branch}!
|
||||||
Start commit: #{start_commit}
|
Start commit: #{start_commit}
|
||||||
Expected end commit: #{end_commit}
|
Expected end commit: #{end_commit}
|
||||||
|
|||||||
@ -92,7 +92,7 @@ module Homebrew
|
|||||||
def check_for_installed_developer_tools
|
def check_for_installed_developer_tools
|
||||||
return if DevelopmentTools.installed?
|
return if DevelopmentTools.installed?
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
No developer tools installed.
|
No developer tools installed.
|
||||||
#{DevelopmentTools.installation_instructions}
|
#{DevelopmentTools.installation_instructions}
|
||||||
EOS
|
EOS
|
||||||
@ -101,7 +101,7 @@ module Homebrew
|
|||||||
def check_build_from_source
|
def check_build_from_source
|
||||||
return unless ENV["HOMEBREW_BUILD_FROM_SOURCE"]
|
return unless ENV["HOMEBREW_BUILD_FROM_SOURCE"]
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
You have HOMEBREW_BUILD_FROM_SOURCE set. This environment variable is
|
You have HOMEBREW_BUILD_FROM_SOURCE set. This environment variable is
|
||||||
intended for use by Homebrew developers. If you are encountering errors,
|
intended for use by Homebrew developers. If you are encountering errors,
|
||||||
please try unsetting this. Please do not file issues if you encounter
|
please try unsetting this. Please do not file issues if you encounter
|
||||||
@ -114,7 +114,7 @@ module Homebrew
|
|||||||
bad_paths = PATH.new(ENV["HOMEBREW_PATH"]).select { |p| p.end_with?("/") }
|
bad_paths = PATH.new(ENV["HOMEBREW_PATH"]).select { |p| p.end_with?("/") }
|
||||||
return if bad_paths.empty?
|
return if bad_paths.empty?
|
||||||
|
|
||||||
inject_file_list bad_paths, <<-EOS.undent
|
inject_file_list bad_paths, <<~EOS
|
||||||
Some directories in your path end in a slash.
|
Some directories in your path end in a slash.
|
||||||
Directories in your path should not end in a slash. This can break other
|
Directories in your path should not end in a slash. This can break other
|
||||||
doctor checks. The following directories should be edited:
|
doctor checks. The following directories should be edited:
|
||||||
@ -136,7 +136,7 @@ module Homebrew
|
|||||||
# Only warn if Python lives with Anaconda, since is most problematic case.
|
# Only warn if Python lives with Anaconda, since is most problematic case.
|
||||||
return unless python_directory == anaconda_directory
|
return unless python_directory == anaconda_directory
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Anaconda is known to frequently break Homebrew builds, including Vim and
|
Anaconda is known to frequently break Homebrew builds, including Vim and
|
||||||
MacVim, due to bundling many duplicates of system and Homebrew-available
|
MacVim, due to bundling many duplicates of system and Homebrew-available
|
||||||
tools.
|
tools.
|
||||||
@ -182,7 +182,7 @@ module Homebrew
|
|||||||
"sentinel.dylib", # SentinelOne
|
"sentinel.dylib", # SentinelOne
|
||||||
]
|
]
|
||||||
|
|
||||||
__check_stray_files "/usr/local/lib", "*.dylib", white_list, <<-EOS.undent
|
__check_stray_files "/usr/local/lib", "*.dylib", white_list, <<~EOS
|
||||||
Unbrewed dylibs were found in /usr/local/lib.
|
Unbrewed dylibs were found in /usr/local/lib.
|
||||||
If you didn't put them there on purpose they could cause problems when
|
If you didn't put them there on purpose they could cause problems when
|
||||||
building Homebrew formulae, and may need to be deleted.
|
building Homebrew formulae, and may need to be deleted.
|
||||||
@ -209,7 +209,7 @@ module Homebrew
|
|||||||
"libtrustedcomponents.a", # Symantec Endpoint Protection
|
"libtrustedcomponents.a", # Symantec Endpoint Protection
|
||||||
]
|
]
|
||||||
|
|
||||||
__check_stray_files "/usr/local/lib", "*.a", white_list, <<-EOS.undent
|
__check_stray_files "/usr/local/lib", "*.a", white_list, <<~EOS
|
||||||
Unbrewed static libraries were found in /usr/local/lib.
|
Unbrewed static libraries were found in /usr/local/lib.
|
||||||
If you didn't put them there on purpose they could cause problems when
|
If you didn't put them there on purpose they could cause problems when
|
||||||
building Homebrew formulae, and may need to be deleted.
|
building Homebrew formulae, and may need to be deleted.
|
||||||
@ -229,7 +229,7 @@ module Homebrew
|
|||||||
"libublio.pc", # NTFS-3G
|
"libublio.pc", # NTFS-3G
|
||||||
]
|
]
|
||||||
|
|
||||||
__check_stray_files "/usr/local/lib/pkgconfig", "*.pc", white_list, <<-EOS.undent
|
__check_stray_files "/usr/local/lib/pkgconfig", "*.pc", white_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
|
If you didn't put them there on purpose they could cause problems when
|
||||||
building Homebrew formulae, and may need to be deleted.
|
building Homebrew formulae, and may need to be deleted.
|
||||||
@ -250,7 +250,7 @@ module Homebrew
|
|||||||
"libublio.la", # NTFS-3G
|
"libublio.la", # NTFS-3G
|
||||||
]
|
]
|
||||||
|
|
||||||
__check_stray_files "/usr/local/lib", "*.la", white_list, <<-EOS.undent
|
__check_stray_files "/usr/local/lib", "*.la", white_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
|
If you didn't put them there on purpose they could cause problems when
|
||||||
building Homebrew formulae, and may need to be deleted.
|
building Homebrew formulae, and may need to be deleted.
|
||||||
@ -269,7 +269,7 @@ module Homebrew
|
|||||||
"ntfs-3g/**/*.h", # NTFS-3G
|
"ntfs-3g/**/*.h", # NTFS-3G
|
||||||
]
|
]
|
||||||
|
|
||||||
__check_stray_files "/usr/local/include", "**/*.h", white_list, <<-EOS.undent
|
__check_stray_files "/usr/local/include", "**/*.h", white_list, <<~EOS
|
||||||
Unbrewed header files were found in /usr/local/include.
|
Unbrewed header files were found in /usr/local/include.
|
||||||
If you didn't put them there on purpose they could cause problems when
|
If you didn't put them there on purpose they could cause problems when
|
||||||
building Homebrew formulae, and may need to be deleted.
|
building Homebrew formulae, and may need to be deleted.
|
||||||
@ -291,7 +291,7 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
return if broken_symlinks.empty?
|
return if broken_symlinks.empty?
|
||||||
|
|
||||||
inject_file_list broken_symlinks, <<-EOS.undent
|
inject_file_list broken_symlinks, <<~EOS
|
||||||
Broken symlinks were found. Remove them with `brew prune`:
|
Broken symlinks were found. Remove them with `brew prune`:
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
@ -300,7 +300,7 @@ module Homebrew
|
|||||||
world_writable = HOMEBREW_TEMP.stat.mode & 0777 == 0777
|
world_writable = HOMEBREW_TEMP.stat.mode & 0777 == 0777
|
||||||
return if !world_writable || HOMEBREW_TEMP.sticky?
|
return if !world_writable || HOMEBREW_TEMP.sticky?
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
#{HOMEBREW_TEMP} is world-writable but does not have the sticky bit set.
|
#{HOMEBREW_TEMP} is world-writable but does not have the sticky bit set.
|
||||||
Please execute `sudo chmod +t #{HOMEBREW_TEMP}` in your Terminal.
|
Please execute `sudo chmod +t #{HOMEBREW_TEMP}` in your Terminal.
|
||||||
EOS
|
EOS
|
||||||
@ -309,7 +309,7 @@ module Homebrew
|
|||||||
def check_access_homebrew_repository
|
def check_access_homebrew_repository
|
||||||
return if HOMEBREW_REPOSITORY.writable_real?
|
return if HOMEBREW_REPOSITORY.writable_real?
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
#{HOMEBREW_REPOSITORY} is not writable.
|
#{HOMEBREW_REPOSITORY} is not writable.
|
||||||
|
|
||||||
You should change the ownership and permissions of #{HOMEBREW_REPOSITORY}
|
You should change the ownership and permissions of #{HOMEBREW_REPOSITORY}
|
||||||
@ -330,7 +330,7 @@ module Homebrew
|
|||||||
|
|
||||||
return if not_writable_dirs.empty?
|
return if not_writable_dirs.empty?
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
The following directories are not writable:
|
The following directories are not writable:
|
||||||
#{not_writable_dirs.join("\n")}
|
#{not_writable_dirs.join("\n")}
|
||||||
|
|
||||||
@ -348,7 +348,7 @@ module Homebrew
|
|||||||
return unless Language::Python.homebrew_site_packages.exist?
|
return unless Language::Python.homebrew_site_packages.exist?
|
||||||
return if Language::Python.homebrew_site_packages.writable_real?
|
return if Language::Python.homebrew_site_packages.writable_real?
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
#{Language::Python.homebrew_site_packages} isn't writable.
|
#{Language::Python.homebrew_site_packages} isn't writable.
|
||||||
This can happen if you "sudo pip install" software that isn't managed
|
This can happen if you "sudo pip install" software that isn't managed
|
||||||
by Homebrew. If you install a formula with Python modules, the install
|
by Homebrew. If you install a formula with Python modules, the install
|
||||||
@ -364,7 +364,7 @@ module Homebrew
|
|||||||
return unless HOMEBREW_LOCK_DIR.exist?
|
return unless HOMEBREW_LOCK_DIR.exist?
|
||||||
return if HOMEBREW_LOCK_DIR.writable_real?
|
return if HOMEBREW_LOCK_DIR.writable_real?
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
#{HOMEBREW_LOCK_DIR} isn't writable.
|
#{HOMEBREW_LOCK_DIR} isn't writable.
|
||||||
Homebrew writes lock files to this location.
|
Homebrew writes lock files to this location.
|
||||||
|
|
||||||
@ -378,7 +378,7 @@ module Homebrew
|
|||||||
return unless HOMEBREW_LOGS.exist?
|
return unless HOMEBREW_LOGS.exist?
|
||||||
return if HOMEBREW_LOGS.writable_real?
|
return if HOMEBREW_LOGS.writable_real?
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
#{HOMEBREW_LOGS} isn't writable.
|
#{HOMEBREW_LOGS} isn't writable.
|
||||||
Homebrew writes debugging logs to this location.
|
Homebrew writes debugging logs to this location.
|
||||||
|
|
||||||
@ -392,7 +392,7 @@ module Homebrew
|
|||||||
return unless HOMEBREW_CACHE.exist?
|
return unless HOMEBREW_CACHE.exist?
|
||||||
return if HOMEBREW_CACHE.writable_real?
|
return if HOMEBREW_CACHE.writable_real?
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
#{HOMEBREW_CACHE} isn't writable.
|
#{HOMEBREW_CACHE} isn't writable.
|
||||||
This can happen if you run `brew install` or `brew fetch` as another user.
|
This can happen if you run `brew install` or `brew fetch` as another user.
|
||||||
Homebrew caches downloaded files to this location.
|
Homebrew caches downloaded files to this location.
|
||||||
@ -407,7 +407,7 @@ module Homebrew
|
|||||||
return unless HOMEBREW_CELLAR.exist?
|
return unless HOMEBREW_CELLAR.exist?
|
||||||
return if HOMEBREW_CELLAR.writable_real?
|
return if HOMEBREW_CELLAR.writable_real?
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
#{HOMEBREW_CELLAR} isn't writable.
|
#{HOMEBREW_CELLAR} isn't writable.
|
||||||
|
|
||||||
You should change the ownership and permissions of #{HOMEBREW_CELLAR}
|
You should change the ownership and permissions of #{HOMEBREW_CELLAR}
|
||||||
@ -421,7 +421,7 @@ module Homebrew
|
|||||||
return unless (HOMEBREW_REPOSITORY/"Cellar").exist?
|
return unless (HOMEBREW_REPOSITORY/"Cellar").exist?
|
||||||
return unless (HOMEBREW_PREFIX/"Cellar").exist?
|
return unless (HOMEBREW_PREFIX/"Cellar").exist?
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
You have multiple Cellars.
|
You have multiple Cellars.
|
||||||
You should delete #{HOMEBREW_REPOSITORY}/Cellar:
|
You should delete #{HOMEBREW_REPOSITORY}/Cellar:
|
||||||
rm -rf #{HOMEBREW_REPOSITORY}/Cellar
|
rm -rf #{HOMEBREW_REPOSITORY}/Cellar
|
||||||
@ -445,13 +445,13 @@ module Homebrew
|
|||||||
.select { |bn| File.exist? "/usr/bin/#{bn}" }
|
.select { |bn| File.exist? "/usr/bin/#{bn}" }
|
||||||
|
|
||||||
unless conflicts.empty?
|
unless conflicts.empty?
|
||||||
message = inject_file_list conflicts, <<-EOS.undent
|
message = inject_file_list conflicts, <<~EOS
|
||||||
/usr/bin occurs before #{HOMEBREW_PREFIX}/bin
|
/usr/bin occurs before #{HOMEBREW_PREFIX}/bin
|
||||||
This means that system-provided programs will be used instead of those
|
This means that system-provided programs will be used instead of those
|
||||||
provided by Homebrew. The following tools exist at both paths:
|
provided by Homebrew. The following tools exist at both paths:
|
||||||
EOS
|
EOS
|
||||||
|
|
||||||
message += <<-EOS.undent
|
message += <<~EOS
|
||||||
|
|
||||||
Consider setting your PATH so that #{HOMEBREW_PREFIX}/bin
|
Consider setting your PATH so that #{HOMEBREW_PREFIX}/bin
|
||||||
occurs before /usr/bin. Here is a one-liner:
|
occurs before /usr/bin. Here is a one-liner:
|
||||||
@ -472,7 +472,7 @@ module Homebrew
|
|||||||
def check_user_path_2
|
def check_user_path_2
|
||||||
return if @seen_prefix_bin
|
return if @seen_prefix_bin
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Homebrew's bin was not found in your PATH.
|
Homebrew's bin was not found in your PATH.
|
||||||
Consider setting the PATH for example like so
|
Consider setting the PATH for example like so
|
||||||
#{Utils::Shell.prepend_path_in_profile("#{HOMEBREW_PREFIX}/bin")}
|
#{Utils::Shell.prepend_path_in_profile("#{HOMEBREW_PREFIX}/bin")}
|
||||||
@ -486,7 +486,7 @@ module Homebrew
|
|||||||
sbin = HOMEBREW_PREFIX/"sbin"
|
sbin = HOMEBREW_PREFIX/"sbin"
|
||||||
return unless sbin.directory? && !sbin.children.empty?
|
return unless sbin.directory? && !sbin.children.empty?
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~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.
|
formulae that put executables in #{HOMEBREW_PREFIX}/sbin.
|
||||||
Consider setting the PATH for example like so
|
Consider setting the PATH for example like so
|
||||||
@ -500,7 +500,7 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
return unless curlrc_found
|
return unless curlrc_found
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
You have a curlrc file
|
You have a curlrc file
|
||||||
If you have trouble downloading packages with Homebrew, then maybe this
|
If you have trouble downloading packages with Homebrew, then maybe this
|
||||||
is the problem? If the following command doesn't work, then try removing
|
is the problem? If the following command doesn't work, then try removing
|
||||||
@ -526,7 +526,7 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
return if gettext&.linked_keg&.directory? && homebrew_owned
|
return if gettext&.linked_keg&.directory? && homebrew_owned
|
||||||
|
|
||||||
inject_file_list @found, <<-EOS.undent
|
inject_file_list @found, <<~EOS
|
||||||
gettext files detected at a system prefix.
|
gettext files detected at a system prefix.
|
||||||
These files can cause compilation and link failures, especially if they
|
These files can cause compilation and link failures, especially if they
|
||||||
are compiled with improper architectures. Consider removing these files:
|
are compiled with improper architectures. Consider removing these files:
|
||||||
@ -544,13 +544,13 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
if libiconv&.linked_keg&.directory?
|
if libiconv&.linked_keg&.directory?
|
||||||
unless libiconv.keg_only?
|
unless libiconv.keg_only?
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
A libiconv formula is installed and linked.
|
A libiconv formula is installed and linked.
|
||||||
This will break stuff. For serious. Unlink it.
|
This will break stuff. For serious. Unlink it.
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
inject_file_list @found, <<-EOS.undent
|
inject_file_list @found, <<~EOS
|
||||||
libiconv files detected at a system prefix other than /usr.
|
libiconv files detected at a system prefix other than /usr.
|
||||||
Homebrew doesn't provide a libiconv formula, and expects to link against
|
Homebrew doesn't provide a libiconv formula, and expects to link against
|
||||||
the system version in /usr. libiconv in other prefixes can cause
|
the system version in /usr. libiconv in other prefixes can cause
|
||||||
@ -588,7 +588,7 @@ module Homebrew
|
|||||||
|
|
||||||
return if scripts.empty?
|
return if scripts.empty?
|
||||||
|
|
||||||
inject_file_list scripts, <<-EOS.undent
|
inject_file_list scripts, <<~EOS
|
||||||
"config" scripts exist outside your system or Homebrew directories.
|
"config" scripts exist outside your system or Homebrew directories.
|
||||||
`./configure` scripts often look for *-config scripts to determine if
|
`./configure` scripts often look for *-config scripts to determine if
|
||||||
software packages are installed, and what additional flags to use when
|
software packages are installed, and what additional flags to use when
|
||||||
@ -605,13 +605,13 @@ module Homebrew
|
|||||||
return if dyld_vars.empty?
|
return if dyld_vars.empty?
|
||||||
|
|
||||||
values = dyld_vars.map { |var| "#{var}: #{ENV.fetch(var)}" }
|
values = dyld_vars.map { |var| "#{var}: #{ENV.fetch(var)}" }
|
||||||
message = inject_file_list values, <<-EOS.undent
|
message = inject_file_list values, <<~EOS
|
||||||
Setting DYLD_* vars can break dynamic linking.
|
Setting DYLD_* vars can break dynamic linking.
|
||||||
Set variables:
|
Set variables:
|
||||||
EOS
|
EOS
|
||||||
|
|
||||||
if dyld_vars.include? "DYLD_INSERT_LIBRARIES"
|
if dyld_vars.include? "DYLD_INSERT_LIBRARIES"
|
||||||
message += <<-EOS.undent
|
message += <<~EOS
|
||||||
|
|
||||||
Setting DYLD_INSERT_LIBRARIES can cause Go builds to fail.
|
Setting DYLD_INSERT_LIBRARIES can cause Go builds to fail.
|
||||||
Having this set is common if you use this software:
|
Having this set is common if you use this software:
|
||||||
@ -624,7 +624,7 @@ module Homebrew
|
|||||||
|
|
||||||
def check_ssl_cert_file
|
def check_ssl_cert_file
|
||||||
return unless ENV.key?("SSL_CERT_FILE")
|
return unless ENV.key?("SSL_CERT_FILE")
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Setting SSL_CERT_FILE can break downloading files; if that happens
|
Setting SSL_CERT_FILE can break downloading files; if that happens
|
||||||
you should unset it before running Homebrew.
|
you should unset it before running Homebrew.
|
||||||
|
|
||||||
@ -638,7 +638,7 @@ module Homebrew
|
|||||||
return unless HOMEBREW_CELLAR.exist?
|
return unless HOMEBREW_CELLAR.exist?
|
||||||
return unless HOMEBREW_CELLAR.symlink?
|
return unless HOMEBREW_CELLAR.symlink?
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Symlinked Cellars can cause problems.
|
Symlinked Cellars can cause problems.
|
||||||
Your Homebrew Cellar is a symlink: #{HOMEBREW_CELLAR}
|
Your Homebrew Cellar is a symlink: #{HOMEBREW_CELLAR}
|
||||||
which resolves to: #{HOMEBREW_CELLAR.realpath}
|
which resolves to: #{HOMEBREW_CELLAR.realpath}
|
||||||
@ -675,7 +675,7 @@ module Homebrew
|
|||||||
|
|
||||||
return if where_cellar == where_tmp
|
return if where_cellar == where_tmp
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Your Cellar and TEMP directories are on different volumes.
|
Your Cellar and TEMP directories are on different volumes.
|
||||||
macOS won't move relative symlinks across volumes unless the target file already
|
macOS won't move relative symlinks across volumes unless the target file already
|
||||||
exists. Brews known to be affected by this are Git and Narwhal.
|
exists. Brews known to be affected by this are Git and Narwhal.
|
||||||
@ -692,7 +692,7 @@ module Homebrew
|
|||||||
|
|
||||||
git = Formula["git"]
|
git = Formula["git"]
|
||||||
git_upgrade_cmd = git.any_version_installed? ? "upgrade" : "install"
|
git_upgrade_cmd = git.any_version_installed? ? "upgrade" : "install"
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
An outdated version (#{Utils.git_version}) of Git was detected in your PATH.
|
An outdated version (#{Utils.git_version}) of Git was detected in your PATH.
|
||||||
Git 1.8.5 or newer is required to perform checkouts over HTTPS from GitHub and
|
Git 1.8.5 or newer is required to perform checkouts over HTTPS from GitHub and
|
||||||
to support the 'git -C <path>' option.
|
to support the 'git -C <path>' option.
|
||||||
@ -704,7 +704,7 @@ module Homebrew
|
|||||||
def check_for_git
|
def check_for_git
|
||||||
return if Utils.git_available?
|
return if Utils.git_available?
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Git could not be found in your PATH.
|
Git could not be found in your PATH.
|
||||||
Homebrew uses Git for several internal functions, and some formulae use Git
|
Homebrew uses Git for several internal functions, and some formulae use Git
|
||||||
checkouts instead of stable tarballs. You may want to install Git:
|
checkouts instead of stable tarballs. You may want to install Git:
|
||||||
@ -718,7 +718,7 @@ module Homebrew
|
|||||||
autocrlf = HOMEBREW_REPOSITORY.cd { `git config --get core.autocrlf`.chomp }
|
autocrlf = HOMEBREW_REPOSITORY.cd { `git config --get core.autocrlf`.chomp }
|
||||||
return unless autocrlf == "true"
|
return unless autocrlf == "true"
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Suspicious Git newline settings found.
|
Suspicious Git newline settings found.
|
||||||
|
|
||||||
The detected Git newline settings will cause checkout problems:
|
The detected Git newline settings will cause checkout problems:
|
||||||
@ -736,7 +736,7 @@ module Homebrew
|
|||||||
origin = HOMEBREW_REPOSITORY.git_origin
|
origin = HOMEBREW_REPOSITORY.git_origin
|
||||||
|
|
||||||
if origin.nil?
|
if origin.nil?
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Missing Homebrew/brew git origin remote.
|
Missing Homebrew/brew git origin remote.
|
||||||
|
|
||||||
Without a correctly configured origin, Homebrew won't update
|
Without a correctly configured origin, Homebrew won't update
|
||||||
@ -744,7 +744,7 @@ module Homebrew
|
|||||||
git -C "#{HOMEBREW_REPOSITORY}" remote add origin #{Formatter.url("https://github.com/Homebrew/brew.git")}
|
git -C "#{HOMEBREW_REPOSITORY}" remote add origin #{Formatter.url("https://github.com/Homebrew/brew.git")}
|
||||||
EOS
|
EOS
|
||||||
elsif origin !~ %r{Homebrew/brew(\.git|/)?$}
|
elsif origin !~ %r{Homebrew/brew(\.git|/)?$}
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Suspicious Homebrew/brew git origin remote found.
|
Suspicious Homebrew/brew git origin remote found.
|
||||||
|
|
||||||
With a non-standard origin, Homebrew won't pull updates from
|
With a non-standard origin, Homebrew won't pull updates from
|
||||||
@ -765,7 +765,7 @@ module Homebrew
|
|||||||
origin = coretap_path.git_origin
|
origin = coretap_path.git_origin
|
||||||
|
|
||||||
if origin.nil?
|
if origin.nil?
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Missing #{CoreTap.instance} git origin remote.
|
Missing #{CoreTap.instance} git origin remote.
|
||||||
|
|
||||||
Without a correctly configured origin, Homebrew won't update
|
Without a correctly configured origin, Homebrew won't update
|
||||||
@ -775,7 +775,7 @@ module Homebrew
|
|||||||
elsif origin !~ %r{Homebrew/homebrew-core(\.git|/)?$}
|
elsif origin !~ %r{Homebrew/homebrew-core(\.git|/)?$}
|
||||||
return if ENV["CI"] && origin.include?("Homebrew/homebrew-test-bot")
|
return if ENV["CI"] && origin.include?("Homebrew/homebrew-test-bot")
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Suspicious #{CoreTap.instance} git origin remote found.
|
Suspicious #{CoreTap.instance} git origin remote found.
|
||||||
|
|
||||||
With a non-standard origin, Homebrew won't pull updates from
|
With a non-standard origin, Homebrew won't pull updates from
|
||||||
@ -787,6 +787,18 @@ module Homebrew
|
|||||||
git -C "#{coretap_path}" remote set-url origin #{Formatter.url("https://github.com/Homebrew/homebrew-core.git")}
|
git -C "#{coretap_path}" remote set-url origin #{Formatter.url("https://github.com/Homebrew/homebrew-core.git")}
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
|
return if ENV["CI"] || ENV["JENKINS_HOME"]
|
||||||
|
|
||||||
|
branch = coretap_path.git_branch
|
||||||
|
return if branch.nil? || branch =~ /master/
|
||||||
|
|
||||||
|
<<~EOS
|
||||||
|
Homebrew/homebrew-core is not on the master branch
|
||||||
|
|
||||||
|
Check out the master branch by running:
|
||||||
|
git -C "$(brew --repo homebrew/core)" checkout master
|
||||||
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
def __check_linked_brew(f)
|
def __check_linked_brew(f)
|
||||||
@ -804,12 +816,12 @@ module Homebrew
|
|||||||
def check_for_linked_keg_only_brews
|
def check_for_linked_keg_only_brews
|
||||||
return unless HOMEBREW_CELLAR.exist?
|
return unless HOMEBREW_CELLAR.exist?
|
||||||
|
|
||||||
linked = Formula.installed.select do |f|
|
linked = Formula.installed.sort.select do |f|
|
||||||
f.keg_only? && __check_linked_brew(f)
|
f.keg_only? && __check_linked_brew(f)
|
||||||
end
|
end
|
||||||
return if linked.empty?
|
return if linked.empty?
|
||||||
|
|
||||||
inject_file_list linked.map(&:full_name), <<-EOS.undent
|
inject_file_list linked.map(&:full_name), <<~EOS
|
||||||
Some keg-only formula are linked into the Cellar.
|
Some keg-only formula are linked into the Cellar.
|
||||||
Linking a keg-only formula, such as gettext, into the cellar with
|
Linking a keg-only formula, such as gettext, into the cellar with
|
||||||
`brew link <formula>` will cause other formulae to detect them during
|
`brew link <formula>` will cause other formulae to detect them during
|
||||||
@ -835,7 +847,7 @@ module Homebrew
|
|||||||
.select { |framework| File.exist? framework }
|
.select { |framework| File.exist? framework }
|
||||||
return if frameworks_found.empty?
|
return if frameworks_found.empty?
|
||||||
|
|
||||||
inject_file_list frameworks_found, <<-EOS.undent
|
inject_file_list frameworks_found, <<~EOS
|
||||||
Some frameworks can be picked up by CMake's build system and likely
|
Some frameworks can be picked up by CMake's build system and likely
|
||||||
cause the build to fail. To compile CMake, you may wish to move these
|
cause the build to fail. To compile CMake, you may wish to move these
|
||||||
out of the way:
|
out of the way:
|
||||||
@ -846,7 +858,7 @@ module Homebrew
|
|||||||
tmpdir = ENV["TMPDIR"]
|
tmpdir = ENV["TMPDIR"]
|
||||||
return if tmpdir.nil? || File.directory?(tmpdir)
|
return if tmpdir.nil? || File.directory?(tmpdir)
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
TMPDIR #{tmpdir.inspect} doesn't exist.
|
TMPDIR #{tmpdir.inspect} doesn't exist.
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
@ -859,7 +871,7 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
return if missing.empty?
|
return if missing.empty?
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Some installed formula are missing dependencies.
|
Some installed formula are missing dependencies.
|
||||||
You should `brew install` the missing dependencies:
|
You should `brew install` the missing dependencies:
|
||||||
brew install #{missing.sort_by(&:full_name) * " "}
|
brew install #{missing.sort_by(&:full_name) * " "}
|
||||||
@ -874,7 +886,7 @@ module Homebrew
|
|||||||
return if `git status --untracked-files=all --porcelain -- Library/Homebrew/ 2>/dev/null`.chomp.empty?
|
return if `git status --untracked-files=all --porcelain -- Library/Homebrew/ 2>/dev/null`.chomp.empty?
|
||||||
end
|
end
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
You have uncommitted modifications to Homebrew
|
You have uncommitted modifications to Homebrew
|
||||||
If this is a surprise to you, then you should stash these modifications.
|
If this is a surprise to you, then you should stash these modifications.
|
||||||
Stashing returns Homebrew to a pristine state but can be undone
|
Stashing returns Homebrew to a pristine state but can be undone
|
||||||
@ -886,7 +898,7 @@ module Homebrew
|
|||||||
def check_for_enthought_python
|
def check_for_enthought_python
|
||||||
return unless which "enpkg"
|
return unless which "enpkg"
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Enthought Python was found in your PATH.
|
Enthought Python was found in your PATH.
|
||||||
This can cause build problems, as this software installs its own
|
This can cause build problems, as this software installs its own
|
||||||
copies of iconv and libxml2 into directories that are picked up by
|
copies of iconv and libxml2 into directories that are picked up by
|
||||||
@ -897,7 +909,7 @@ module Homebrew
|
|||||||
def check_for_library_python
|
def check_for_library_python
|
||||||
return unless File.exist?("/Library/Frameworks/Python.framework")
|
return unless File.exist?("/Library/Frameworks/Python.framework")
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Python is installed at /Library/Frameworks/Python.framework
|
Python is installed at /Library/Frameworks/Python.framework
|
||||||
|
|
||||||
Homebrew only supports building against the System-provided Python or a
|
Homebrew only supports building against the System-provided Python or a
|
||||||
@ -910,12 +922,12 @@ module Homebrew
|
|||||||
message = ""
|
message = ""
|
||||||
["", "3"].map do |suffix|
|
["", "3"].map do |suffix|
|
||||||
next unless paths.include?((HOMEBREW_PREFIX/"share/python#{suffix}").to_s)
|
next unless paths.include?((HOMEBREW_PREFIX/"share/python#{suffix}").to_s)
|
||||||
message += <<-EOS.undent
|
message += <<~EOS
|
||||||
#{HOMEBREW_PREFIX}/share/python#{suffix} is not needed in PATH.
|
#{HOMEBREW_PREFIX}/share/python#{suffix} is not needed in PATH.
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
unless message.empty?
|
unless message.empty?
|
||||||
message += <<-EOS.undent
|
message += <<~EOS
|
||||||
|
|
||||||
Formerly homebrew put Python scripts you installed via `pip` or `pip3`
|
Formerly homebrew put Python scripts you installed via `pip` or `pip3`
|
||||||
(or `easy_install`) into that directory above but now it can be removed
|
(or `easy_install`) into that directory above but now it can be removed
|
||||||
@ -937,7 +949,7 @@ module Homebrew
|
|||||||
return if Regexp.last_match(1).nil?
|
return if Regexp.last_match(1).nil?
|
||||||
return if Regexp.last_match(1) == "2"
|
return if Regexp.last_match(1) == "2"
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
python is symlinked to python#{Regexp.last_match(1)}
|
python is symlinked to python#{Regexp.last_match(1)}
|
||||||
This will confuse build scripts and in general lead to subtle breakage.
|
This will confuse build scripts and in general lead to subtle breakage.
|
||||||
EOS
|
EOS
|
||||||
@ -950,7 +962,7 @@ module Homebrew
|
|||||||
gnubin = %W[#{coreutils.opt_libexec}/gnubin #{coreutils.libexec}/gnubin]
|
gnubin = %W[#{coreutils.opt_libexec}/gnubin #{coreutils.libexec}/gnubin]
|
||||||
return if (paths & gnubin).empty?
|
return if (paths & gnubin).empty?
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~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
|
EOS
|
||||||
rescue FormulaUnavailableError
|
rescue FormulaUnavailableError
|
||||||
@ -965,7 +977,7 @@ module Homebrew
|
|||||||
default_names = Tab.for_name("findutils").with? "default-names"
|
default_names = Tab.for_name("findutils").with? "default-names"
|
||||||
return if !default_names && (paths & gnubin).empty?
|
return if !default_names && (paths & gnubin).empty?
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Putting non-prefixed findutils in your path can cause python builds to fail.
|
Putting non-prefixed findutils in your path can cause python builds to fail.
|
||||||
EOS
|
EOS
|
||||||
rescue FormulaUnavailableError
|
rescue FormulaUnavailableError
|
||||||
@ -975,7 +987,7 @@ module Homebrew
|
|||||||
def check_for_pydistutils_cfg_in_home
|
def check_for_pydistutils_cfg_in_home
|
||||||
return unless File.exist? "#{ENV["HOME"]}/.pydistutils.cfg"
|
return unless File.exist? "#{ENV["HOME"]}/.pydistutils.cfg"
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~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:
|
builds to fail. See:
|
||||||
#{Formatter.url("https://bugs.python.org/issue6138")}
|
#{Formatter.url("https://bugs.python.org/issue6138")}
|
||||||
@ -997,7 +1009,7 @@ module Homebrew
|
|||||||
end.map(&:basename)
|
end.map(&:basename)
|
||||||
return if unlinked.empty?
|
return if unlinked.empty?
|
||||||
|
|
||||||
inject_file_list unlinked, <<-EOS.undent
|
inject_file_list unlinked, <<~EOS
|
||||||
You have unlinked kegs in your Cellar
|
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 brews that depend on
|
||||||
those kegs to fail to run properly once built. Run `brew link` on these:
|
those kegs to fail to run properly once built. Run `brew link` on these:
|
||||||
@ -1007,7 +1019,7 @@ module Homebrew
|
|||||||
def check_for_old_env_vars
|
def check_for_old_env_vars
|
||||||
return unless ENV["HOMEBREW_KEEP_INFO"]
|
return unless ENV["HOMEBREW_KEEP_INFO"]
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
`HOMEBREW_KEEP_INFO` is no longer used
|
`HOMEBREW_KEEP_INFO` is no longer used
|
||||||
info files are no longer deleted by default; you may
|
info files are no longer deleted by default; you may
|
||||||
remove this environment variable.
|
remove this environment variable.
|
||||||
@ -1021,7 +1033,7 @@ module Homebrew
|
|||||||
return unless Language::Python.in_sys_path?("python", homebrew_site_packages)
|
return unless Language::Python.in_sys_path?("python", homebrew_site_packages)
|
||||||
|
|
||||||
user_site_packages = Language::Python.user_site_packages "python"
|
user_site_packages = Language::Python.user_site_packages "python"
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Your default Python does not recognize the Homebrew site-packages
|
Your default Python does not recognize the Homebrew site-packages
|
||||||
directory as a special site-packages directory, which means that .pth
|
directory as a special site-packages directory, which means that .pth
|
||||||
files will not be followed. This means you will not be able to import
|
files will not be followed. This means you will not be able to import
|
||||||
@ -1051,8 +1063,7 @@ module Homebrew
|
|||||||
|
|
||||||
message = "You have external commands with conflicting names.\n"
|
message = "You have external commands with conflicting names.\n"
|
||||||
cmd_map.each do |cmd_name, cmd_paths|
|
cmd_map.each do |cmd_name, cmd_paths|
|
||||||
message += inject_file_list cmd_paths, <<-EOS.undent
|
message += inject_file_list cmd_paths, <<~EOS
|
||||||
|
|
||||||
Found command `#{cmd_name}` in following places:
|
Found command `#{cmd_name}` in following places:
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
@ -1075,7 +1086,7 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
return if bad_tap_files.empty?
|
return if bad_tap_files.empty?
|
||||||
bad_tap_files.keys.map do |tap|
|
bad_tap_files.keys.map do |tap|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Found Ruby file outside #{tap} tap formula directory
|
Found Ruby file outside #{tap} tap formula directory
|
||||||
(#{tap.formula_dir}):
|
(#{tap.formula_dir}):
|
||||||
#{bad_tap_files[tap].join("\n ")}
|
#{bad_tap_files[tap].join("\n ")}
|
||||||
|
|||||||
@ -159,7 +159,7 @@ class VCSDownloadStrategy < AbstractDownloadStrategy
|
|||||||
return unless @ref_type == :tag
|
return unless @ref_type == :tag
|
||||||
return unless @revision && current_revision
|
return unless @revision && current_revision
|
||||||
return if current_revision == @revision
|
return if current_revision == @revision
|
||||||
raise <<-EOS.undent
|
raise <<~EOS
|
||||||
#{@ref} tag should be #{@revision}
|
#{@ref} tag should be #{@revision}
|
||||||
but is actually #{current_revision}
|
but is actually #{current_revision}
|
||||||
EOS
|
EOS
|
||||||
@ -553,9 +553,9 @@ class GitHubPrivateRepositoryDownloadStrategy < CurlDownloadStrategy
|
|||||||
rescue GitHub::HTTPNotFoundError
|
rescue GitHub::HTTPNotFoundError
|
||||||
# We only handle HTTPNotFoundError here,
|
# We only handle HTTPNotFoundError here,
|
||||||
# becase AuthenticationFailedError is handled within util/github.
|
# becase AuthenticationFailedError is handled within util/github.
|
||||||
message = <<-EOS.undent
|
message = <<~EOS
|
||||||
HOMEBREW_GITHUB_API_TOKEN can not access the repository: #{@owner}/#{@repo}
|
HOMEBREW_GITHUB_API_TOKEN can not access the repository: #{@owner}/#{@repo}
|
||||||
This token may not have permission to access the repository or the url of formula may be incorrect.
|
This token may not have permission to access the repository or the url of formula may be incorrect.
|
||||||
EOS
|
EOS
|
||||||
raise CurlDownloadStrategyError, message
|
raise CurlDownloadStrategyError, message
|
||||||
end
|
end
|
||||||
|
|||||||
@ -185,7 +185,7 @@ class TapFormulaAmbiguityError < RuntimeError
|
|||||||
"#{Tap.fetch(match[:user], match[:repo])}/#{path.basename(".rb")}"
|
"#{Tap.fetch(match[:user], match[:repo])}/#{path.basename(".rb")}"
|
||||||
end
|
end
|
||||||
|
|
||||||
super <<-EOS.undent
|
super <<~EOS
|
||||||
Formulae found in multiple taps: #{formulae.map { |f| "\n * #{f}" }.join}
|
Formulae found in multiple taps: #{formulae.map { |f| "\n * #{f}" }.join}
|
||||||
|
|
||||||
Please use the fully-qualified name e.g. #{formulae.first} to refer the formula.
|
Please use the fully-qualified name e.g. #{formulae.first} to refer the formula.
|
||||||
@ -205,7 +205,7 @@ class TapFormulaWithOldnameAmbiguityError < RuntimeError
|
|||||||
"#{Regexp.last_match(1)}/#{Regexp.last_match(2)}"
|
"#{Regexp.last_match(1)}/#{Regexp.last_match(2)}"
|
||||||
end
|
end
|
||||||
|
|
||||||
super <<-EOS.undent
|
super <<~EOS
|
||||||
Formulae with '#{name}' old name found in multiple taps: #{taps.map { |t| "\n * #{t}" }.join}
|
Formulae with '#{name}' old name found in multiple taps: #{taps.map { |t| "\n * #{t}" }.join}
|
||||||
|
|
||||||
Please use the fully-qualified name e.g. #{taps.first}/#{name} to refer the formula or use its new name.
|
Please use the fully-qualified name e.g. #{taps.first}/#{name} to refer the formula or use its new name.
|
||||||
@ -219,7 +219,7 @@ class TapUnavailableError < RuntimeError
|
|||||||
def initialize(name)
|
def initialize(name)
|
||||||
@name = name
|
@name = name
|
||||||
|
|
||||||
super <<-EOS.undent
|
super <<~EOS
|
||||||
No available tap #{name}.
|
No available tap #{name}.
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
@ -235,7 +235,7 @@ class TapRemoteMismatchError < RuntimeError
|
|||||||
@expected_remote = expected_remote
|
@expected_remote = expected_remote
|
||||||
@actual_remote = actual_remote
|
@actual_remote = actual_remote
|
||||||
|
|
||||||
super <<-EOS.undent
|
super <<~EOS
|
||||||
Tap #{name} remote mismatch.
|
Tap #{name} remote mismatch.
|
||||||
#{expected_remote} != #{actual_remote}
|
#{expected_remote} != #{actual_remote}
|
||||||
EOS
|
EOS
|
||||||
@ -248,7 +248,7 @@ class TapAlreadyTappedError < RuntimeError
|
|||||||
def initialize(name)
|
def initialize(name)
|
||||||
@name = name
|
@name = name
|
||||||
|
|
||||||
super <<-EOS.undent
|
super <<~EOS
|
||||||
Tap #{name} already tapped.
|
Tap #{name} already tapped.
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
@ -260,7 +260,7 @@ class TapAlreadyUnshallowError < RuntimeError
|
|||||||
def initialize(name)
|
def initialize(name)
|
||||||
@name = name
|
@name = name
|
||||||
|
|
||||||
super <<-EOS.undent
|
super <<~EOS
|
||||||
Tap #{name} already a full clone.
|
Tap #{name} already a full clone.
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
@ -279,7 +279,7 @@ end
|
|||||||
|
|
||||||
class OperationInProgressError < RuntimeError
|
class OperationInProgressError < RuntimeError
|
||||||
def initialize(name)
|
def initialize(name)
|
||||||
message = <<-EOS.undent
|
message = <<~EOS
|
||||||
Operation already in progress for #{name}
|
Operation already in progress for #{name}
|
||||||
Another active Homebrew process is already using #{name}.
|
Another active Homebrew process is already using #{name}.
|
||||||
Please wait for it to finish or terminate it to continue.
|
Please wait for it to finish or terminate it to continue.
|
||||||
@ -327,7 +327,7 @@ class FormulaConflictError < RuntimeError
|
|||||||
message = []
|
message = []
|
||||||
message << "Cannot install #{formula.full_name} because conflicting formulae are installed."
|
message << "Cannot install #{formula.full_name} because conflicting formulae are installed."
|
||||||
message.concat conflicts.map { |c| conflict_message(c) } << ""
|
message.concat conflicts.map { |c| conflict_message(c) } << ""
|
||||||
message << <<-EOS.undent
|
message << <<~EOS
|
||||||
Please `brew unlink #{conflicts.map(&:name) * " "}` before continuing.
|
Please `brew unlink #{conflicts.map(&:name) * " "}` before continuing.
|
||||||
|
|
||||||
Unlinking removes a formula's symlinks from #{HOMEBREW_PREFIX}. You can
|
Unlinking removes a formula's symlinks from #{HOMEBREW_PREFIX}. You can
|
||||||
@ -341,7 +341,7 @@ end
|
|||||||
|
|
||||||
class FormulaAmbiguousPythonError < RuntimeError
|
class FormulaAmbiguousPythonError < RuntimeError
|
||||||
def initialize(formula)
|
def initialize(formula)
|
||||||
super <<-EOS.undent
|
super <<~EOS
|
||||||
The version of python to use with the virtualenv in the `#{formula.full_name}` formula
|
The version of python to use with the virtualenv in the `#{formula.full_name}` formula
|
||||||
cannot be guessed automatically. If the simultaneous use of python and python3
|
cannot be guessed automatically. If the simultaneous use of python and python3
|
||||||
is intentional, please add `:using => "python"` or `:using => "python3"` to
|
is intentional, please add `:using => "python"` or `:using => "python3"` to
|
||||||
@ -398,18 +398,18 @@ class BuildError < RuntimeError
|
|||||||
if formula.tap.official?
|
if formula.tap.official?
|
||||||
puts Formatter.error(Formatter.url(OS::ISSUES_URL), label: "READ THIS")
|
puts Formatter.error(Formatter.url(OS::ISSUES_URL), label: "READ THIS")
|
||||||
elsif issues_url = formula.tap.issues_url
|
elsif issues_url = formula.tap.issues_url
|
||||||
puts <<-EOS.undent
|
puts <<~EOS
|
||||||
If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
|
If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
|
||||||
#{Formatter.url(issues_url)}
|
#{Formatter.url(issues_url)}
|
||||||
EOS
|
EOS
|
||||||
else
|
else
|
||||||
puts <<-EOS.undent
|
puts <<~EOS
|
||||||
If reporting this issue please do so to (not Homebrew/brew or Homebrew/core):
|
If reporting this issue please do so to (not Homebrew/brew or Homebrew/core):
|
||||||
#{formula.tap}
|
#{formula.tap}
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
puts <<-EOS.undent
|
puts <<~EOS
|
||||||
Do not report this issue to Homebrew/brew or Homebrew/core!
|
Do not report this issue to Homebrew/brew or Homebrew/core!
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
@ -445,7 +445,7 @@ class BuildToolsError < RuntimeError
|
|||||||
package_text = "a binary package"
|
package_text = "a binary package"
|
||||||
end
|
end
|
||||||
|
|
||||||
super <<-EOS.undent
|
super <<~EOS
|
||||||
The following #{formula_text}:
|
The following #{formula_text}:
|
||||||
#{formulae.join(", ")}
|
#{formulae.join(", ")}
|
||||||
cannot be installed as #{package_text} and must be built from source.
|
cannot be installed as #{package_text} and must be built from source.
|
||||||
@ -467,7 +467,7 @@ class BuildFlagsError < RuntimeError
|
|||||||
require_text = "requires"
|
require_text = "requires"
|
||||||
end
|
end
|
||||||
|
|
||||||
super <<-EOS.undent
|
super <<~EOS
|
||||||
The following #{flag_text}:
|
The following #{flag_text}:
|
||||||
#{flags.join(", ")}
|
#{flags.join(", ")}
|
||||||
#{require_text} building tools, but none are installed.
|
#{require_text} building tools, but none are installed.
|
||||||
@ -481,7 +481,7 @@ end
|
|||||||
# the compilers available on the user's system
|
# the compilers available on the user's system
|
||||||
class CompilerSelectionError < RuntimeError
|
class CompilerSelectionError < RuntimeError
|
||||||
def initialize(formula)
|
def initialize(formula)
|
||||||
super <<-EOS.undent
|
super <<~EOS
|
||||||
#{formula.full_name} cannot be built with any available compilers.
|
#{formula.full_name} cannot be built with any available compilers.
|
||||||
#{DevelopmentTools.custom_installation_instructions}
|
#{DevelopmentTools.custom_installation_instructions}
|
||||||
EOS
|
EOS
|
||||||
@ -491,7 +491,7 @@ end
|
|||||||
# Raised in Resource.fetch
|
# Raised in Resource.fetch
|
||||||
class DownloadError < RuntimeError
|
class DownloadError < RuntimeError
|
||||||
def initialize(resource, cause)
|
def initialize(resource, cause)
|
||||||
super <<-EOS.undent
|
super <<~EOS
|
||||||
Failed to download resource #{resource.download_name.inspect}
|
Failed to download resource #{resource.download_name.inspect}
|
||||||
#{cause.message}
|
#{cause.message}
|
||||||
EOS
|
EOS
|
||||||
@ -530,7 +530,7 @@ class ChecksumMismatchError < RuntimeError
|
|||||||
@expected = expected
|
@expected = expected
|
||||||
@hash_type = expected.hash_type.to_s.upcase
|
@hash_type = expected.hash_type.to_s.upcase
|
||||||
|
|
||||||
super <<-EOS.undent
|
super <<~EOS
|
||||||
#{@hash_type} mismatch
|
#{@hash_type} mismatch
|
||||||
Expected: #{expected}
|
Expected: #{expected}
|
||||||
Actual: #{actual}
|
Actual: #{actual}
|
||||||
@ -557,7 +557,7 @@ class MissingApplyError < RuntimeError; end
|
|||||||
|
|
||||||
class BottleFormulaUnavailableError < RuntimeError
|
class BottleFormulaUnavailableError < RuntimeError
|
||||||
def initialize(bottle_path, formula_path)
|
def initialize(bottle_path, formula_path)
|
||||||
super <<-EOS.undent
|
super <<~EOS
|
||||||
This bottle does not contain the formula file:
|
This bottle does not contain the formula file:
|
||||||
#{bottle_path}
|
#{bottle_path}
|
||||||
#{formula_path}
|
#{formula_path}
|
||||||
|
|||||||
@ -124,7 +124,7 @@ module HomebrewArgvExtension
|
|||||||
Keg.new(prefix)
|
Keg.new(prefix)
|
||||||
end
|
end
|
||||||
rescue FormulaUnavailableError
|
rescue FormulaUnavailableError
|
||||||
raise <<-EOS.undent
|
raise <<~EOS
|
||||||
Multiple kegs installed to #{rack}
|
Multiple kegs installed to #{rack}
|
||||||
However we don't know which one you refer to.
|
However we don't know which one you refer to.
|
||||||
Please delete (with rm -rf!) all but one and then try again.
|
Please delete (with rm -rf!) all but one and then try again.
|
||||||
|
|||||||
@ -233,7 +233,7 @@ module SharedEnvExtension
|
|||||||
if ARGV.include? "--default-fortran-flags"
|
if ARGV.include? "--default-fortran-flags"
|
||||||
flags = FC_FLAG_VARS.reject { |key| self[key] }
|
flags = FC_FLAG_VARS.reject { |key| self[key] }
|
||||||
elsif values_at(*FC_FLAG_VARS).compact.empty?
|
elsif values_at(*FC_FLAG_VARS).compact.empty?
|
||||||
opoo <<-EOS.undent
|
opoo <<~EOS
|
||||||
No Fortran optimization information was provided. You may want to consider
|
No Fortran optimization information was provided. You may want to consider
|
||||||
setting FCFLAGS and FFLAGS or pass the `--default-fortran-flags` option to
|
setting FCFLAGS and FFLAGS or pass the `--default-fortran-flags` option to
|
||||||
`brew install` if your compiler is compatible with GCC.
|
`brew install` if your compiler is compatible with GCC.
|
||||||
@ -286,15 +286,15 @@ module SharedEnvExtension
|
|||||||
begin
|
begin
|
||||||
gcc_formula = gcc_version_formula(name)
|
gcc_formula = gcc_version_formula(name)
|
||||||
rescue FormulaUnavailableError => e
|
rescue FormulaUnavailableError => e
|
||||||
raise <<-EOS.undent
|
raise <<~EOS
|
||||||
Homebrew GCC requested, but formula #{e.name} not found!
|
Homebrew GCC requested, but formula #{e.name} not found!
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
return if gcc_formula.opt_prefix.exist?
|
return if gcc_formula.opt_prefix.exist?
|
||||||
raise <<-EOS.undent
|
raise <<~EOS
|
||||||
The requested Homebrew GCC was not installed. You must:
|
The requested Homebrew GCC was not installed. You must:
|
||||||
brew install #{gcc_formula.full_name}
|
brew install #{gcc_formula.full_name}
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -36,6 +36,15 @@ module GitRepositoryExtension
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def git_branch
|
||||||
|
return unless git? && Utils.git_available?
|
||||||
|
cd do
|
||||||
|
Utils.popen_read(
|
||||||
|
"git", "rev-parse", "--abbrev-ref", "HEAD"
|
||||||
|
).chuzzle
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def git_last_commit_date
|
def git_last_commit_date
|
||||||
return unless git? && Utils.git_available?
|
return unless git? && Utils.git_available?
|
||||||
cd do
|
cd do
|
||||||
|
|||||||
1
Library/Homebrew/extend/os/caveats.rb
Normal file
1
Library/Homebrew/extend/os/caveats.rb
Normal file
@ -0,0 +1 @@
|
|||||||
|
require "extend/os/mac/caveats" if OS.mac?
|
||||||
@ -18,7 +18,7 @@ class OsxfuseRequirement < Requirement
|
|||||||
def message
|
def message
|
||||||
msg = "libfuse is required to install this formula.\n"
|
msg = "libfuse is required to install this formula.\n"
|
||||||
if libfuse_formula_exists?
|
if libfuse_formula_exists?
|
||||||
msg + <<-EOS.undent
|
msg + <<~EOS
|
||||||
Run "brew install libfuse" to install it.
|
Run "brew install libfuse" to install it.
|
||||||
EOS
|
EOS
|
||||||
else
|
else
|
||||||
|
|||||||
45
Library/Homebrew/extend/os/mac/caveats.rb
Normal file
45
Library/Homebrew/extend/os/mac/caveats.rb
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
class Caveats
|
||||||
|
def plist_caveats
|
||||||
|
s = []
|
||||||
|
if f.plist || (keg&.plist_installed?)
|
||||||
|
plist_domain = f.plist_path.basename(".plist")
|
||||||
|
|
||||||
|
# we readlink because this path probably doesn't exist since caveats
|
||||||
|
# occurs before the link step of installation
|
||||||
|
# Yosemite security measures mildly tighter rules:
|
||||||
|
# https://github.com/Homebrew/legacy-homebrew/issues/33815
|
||||||
|
if !plist_path.file? || !plist_path.symlink?
|
||||||
|
if f.plist_startup
|
||||||
|
s << "To have launchd start #{f.full_name} now and restart at startup:"
|
||||||
|
s << " sudo brew services start #{f.full_name}"
|
||||||
|
else
|
||||||
|
s << "To have launchd start #{f.full_name} now and restart at login:"
|
||||||
|
s << " brew services start #{f.full_name}"
|
||||||
|
end
|
||||||
|
# For startup plists, we cannot tell whether it's running on launchd,
|
||||||
|
# as it requires for `sudo launchctl list` to get real result.
|
||||||
|
elsif f.plist_startup
|
||||||
|
s << "To restart #{f.full_name} after an upgrade:"
|
||||||
|
s << " sudo brew services restart #{f.full_name}"
|
||||||
|
elsif Kernel.system "/bin/launchctl list #{plist_domain} &>/dev/null"
|
||||||
|
s << "To restart #{f.full_name} after an upgrade:"
|
||||||
|
s << " brew services restart #{f.full_name}"
|
||||||
|
else
|
||||||
|
s << "To start #{f.full_name}:"
|
||||||
|
s << " brew services start #{f.full_name}"
|
||||||
|
end
|
||||||
|
|
||||||
|
if f.plist_manual
|
||||||
|
s << "Or, if you don't want/need a background service you can just run:"
|
||||||
|
s << " #{f.plist_manual}"
|
||||||
|
end
|
||||||
|
|
||||||
|
# pbpaste is the system clipboard tool on macOS and fails with `tmux` by default
|
||||||
|
# check if this is being run under `tmux` to avoid failing
|
||||||
|
if ENV["TMUX"] && !quiet_system("/usr/bin/pbpaste")
|
||||||
|
s << "" << "WARNING: brew services will fail when run under tmux."
|
||||||
|
end
|
||||||
|
end
|
||||||
|
s.join("\n") + "\n" unless s.empty?
|
||||||
|
end
|
||||||
|
end
|
||||||
@ -24,18 +24,18 @@ class DevelopmentTools
|
|||||||
|
|
||||||
def installation_instructions
|
def installation_instructions
|
||||||
if MacOS.version >= "10.9"
|
if MacOS.version >= "10.9"
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Install the Command Line Tools:
|
Install the Command Line Tools:
|
||||||
xcode-select --install
|
xcode-select --install
|
||||||
EOS
|
EOS
|
||||||
elsif MacOS.version == "10.8" || MacOS.version == "10.7"
|
elsif MacOS.version == "10.8" || MacOS.version == "10.7"
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Install the Command Line Tools from
|
Install the Command Line Tools from
|
||||||
https://developer.apple.com/download/more/
|
https://developer.apple.com/download/more/
|
||||||
or via Xcode's preferences.
|
or via Xcode's preferences.
|
||||||
EOS
|
EOS
|
||||||
else
|
else
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Install Xcode from
|
Install Xcode from
|
||||||
https://developer.apple.com/download/more/
|
https://developer.apple.com/download/more/
|
||||||
EOS
|
EOS
|
||||||
@ -44,19 +44,19 @@ class DevelopmentTools
|
|||||||
|
|
||||||
def custom_installation_instructions
|
def custom_installation_instructions
|
||||||
if MacOS.version > :leopard
|
if MacOS.version > :leopard
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Install GNU's GCC
|
Install GNU's GCC
|
||||||
brew install gcc
|
brew install gcc
|
||||||
EOS
|
EOS
|
||||||
elsif MacOS.version > :tiger
|
elsif MacOS.version > :tiger
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Install GNU's GCC
|
Install GNU's GCC
|
||||||
brew install gcc@4.6
|
brew install gcc@4.6
|
||||||
EOS
|
EOS
|
||||||
else
|
else
|
||||||
# Tiger doesn't ship with apple-gcc42, and this is required to build
|
# Tiger doesn't ship with apple-gcc42, and this is required to build
|
||||||
# some software that doesn't build properly with FSF GCC.
|
# some software that doesn't build properly with FSF GCC.
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Install Apple's GCC
|
Install Apple's GCC
|
||||||
brew install apple-gcc42
|
brew install apple-gcc42
|
||||||
or GNU's GCC
|
or GNU's GCC
|
||||||
|
|||||||
@ -41,7 +41,7 @@ module Homebrew
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
You are using macOS #{MacOS.version}.
|
You are using macOS #{MacOS.version}.
|
||||||
#{who} do not provide support for this #{what}.
|
#{who} do not provide support for this #{what}.
|
||||||
You may encounter build failures or other breakages.
|
You may encounter build failures or other breakages.
|
||||||
@ -59,7 +59,7 @@ module Homebrew
|
|||||||
# Homebrew/brew is currently using.
|
# Homebrew/brew is currently using.
|
||||||
return if ENV["TRAVIS"]
|
return if ENV["TRAVIS"]
|
||||||
|
|
||||||
message = <<-EOS.undent
|
message = <<~EOS
|
||||||
Your Xcode (#{MacOS::Xcode.version}) is outdated.
|
Your Xcode (#{MacOS::Xcode.version}) is outdated.
|
||||||
Please update to Xcode #{MacOS::Xcode.latest_version} (or delete it).
|
Please update to Xcode #{MacOS::Xcode.latest_version} (or delete it).
|
||||||
#{MacOS::Xcode.update_instructions}
|
#{MacOS::Xcode.update_instructions}
|
||||||
@ -67,7 +67,7 @@ module Homebrew
|
|||||||
|
|
||||||
if OS::Mac.prerelease?
|
if OS::Mac.prerelease?
|
||||||
current_path = Utils.popen_read("/usr/bin/xcode-select", "-p")
|
current_path = Utils.popen_read("/usr/bin/xcode-select", "-p")
|
||||||
message += <<-EOS.undent
|
message += <<~EOS
|
||||||
If #{MacOS::Xcode.latest_version} is installed, you may need to:
|
If #{MacOS::Xcode.latest_version} is installed, you may need to:
|
||||||
sudo xcode-select --switch /Applications/Xcode.app
|
sudo xcode-select --switch /Applications/Xcode.app
|
||||||
Current developer directory is:
|
Current developer directory is:
|
||||||
@ -87,7 +87,7 @@ module Homebrew
|
|||||||
# Homebrew/brew is currently using.
|
# Homebrew/brew is currently using.
|
||||||
return if ENV["TRAVIS"]
|
return if ENV["TRAVIS"]
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
A newer Command Line Tools release is available.
|
A newer Command Line Tools release is available.
|
||||||
#{MacOS::CLT.update_instructions}
|
#{MacOS::CLT.update_instructions}
|
||||||
EOS
|
EOS
|
||||||
@ -99,7 +99,7 @@ module Homebrew
|
|||||||
return unless MacOS.version == :el_capitan
|
return unless MacOS.version == :el_capitan
|
||||||
return unless MacOS::Xcode.version >= "8"
|
return unless MacOS::Xcode.version >= "8"
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
You have Xcode 8 installed without the CLT;
|
You have Xcode 8 installed without the CLT;
|
||||||
this causes certain builds to fail on OS X El Capitan (10.11).
|
this causes certain builds to fail on OS X El Capitan (10.11).
|
||||||
Please install the CLT via:
|
Please install the CLT via:
|
||||||
@ -111,7 +111,7 @@ module Homebrew
|
|||||||
return unless MacOS::Xcode.installed?
|
return unless MacOS::Xcode.installed?
|
||||||
return unless MacOS::Xcode.below_minimum_version?
|
return unless MacOS::Xcode.below_minimum_version?
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Your Xcode (#{MacOS::Xcode.version}) is too outdated.
|
Your Xcode (#{MacOS::Xcode.version}) is too outdated.
|
||||||
Please update to Xcode #{MacOS::Xcode.latest_version} (or delete it).
|
Please update to Xcode #{MacOS::Xcode.latest_version} (or delete it).
|
||||||
#{MacOS::Xcode.update_instructions}
|
#{MacOS::Xcode.update_instructions}
|
||||||
@ -122,7 +122,7 @@ module Homebrew
|
|||||||
return unless MacOS::CLT.installed?
|
return unless MacOS::CLT.installed?
|
||||||
return unless MacOS::CLT.below_minimum_version?
|
return unless MacOS::CLT.below_minimum_version?
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Your Command Line Tools are too outdated.
|
Your Command Line Tools are too outdated.
|
||||||
#{MacOS::CLT.update_instructions}
|
#{MacOS::CLT.update_instructions}
|
||||||
EOS
|
EOS
|
||||||
@ -140,7 +140,7 @@ module Homebrew
|
|||||||
"Please install Xcode #{MacOS::Xcode.latest_version}."
|
"Please install Xcode #{MacOS::Xcode.latest_version}."
|
||||||
end
|
end
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
You seem to have osx-gcc-installer installed.
|
You seem to have osx-gcc-installer installed.
|
||||||
Homebrew doesn't support osx-gcc-installer. It causes many builds to fail and
|
Homebrew doesn't support osx-gcc-installer. It causes many builds to fail and
|
||||||
is an unlicensed distribution of really old Xcode files.
|
is an unlicensed distribution of really old Xcode files.
|
||||||
@ -154,7 +154,7 @@ module Homebrew
|
|||||||
uninstaller = Pathname.new("/Developer/Library/uninstall-developer-folder")
|
uninstaller = Pathname.new("/Developer/Library/uninstall-developer-folder")
|
||||||
return unless ((MacOS::Xcode.version || "0") >= "4.3") && uninstaller.exist?
|
return unless ((MacOS::Xcode.version || "0") >= "4.3") && uninstaller.exist?
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
You have leftover files from an older version of Xcode.
|
You have leftover files from an older version of Xcode.
|
||||||
You should delete them using:
|
You should delete them using:
|
||||||
#{uninstaller}
|
#{uninstaller}
|
||||||
@ -170,7 +170,7 @@ module Homebrew
|
|||||||
return if libs.empty?
|
return if libs.empty?
|
||||||
return if libs.include? "/usr/lib/libxcselect.dylib"
|
return if libs.include? "/usr/lib/libxcselect.dylib"
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
You have an outdated version of /usr/bin/install_name_tool installed.
|
You have an outdated version of /usr/bin/install_name_tool installed.
|
||||||
This will cause binary package installations to fail.
|
This will cause binary package installations to fail.
|
||||||
This can happen if you install osx-gcc-installer or RailsInstaller.
|
This can happen if you install osx-gcc-installer or RailsInstaller.
|
||||||
@ -183,7 +183,7 @@ module Homebrew
|
|||||||
ponk = MacOS.macports_or_fink
|
ponk = MacOS.macports_or_fink
|
||||||
return if ponk.empty?
|
return if ponk.empty?
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
You have MacPorts or Fink installed:
|
You have MacPorts or Fink installed:
|
||||||
#{ponk.join(", ")}
|
#{ponk.join(", ")}
|
||||||
|
|
||||||
@ -199,7 +199,7 @@ module Homebrew
|
|||||||
return if RUBY_VERSION == ruby_version
|
return if RUBY_VERSION == ruby_version
|
||||||
return if ARGV.homebrew_developer? && OS::Mac.prerelease?
|
return if ARGV.homebrew_developer? && OS::Mac.prerelease?
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Ruby version #{RUBY_VERSION} is unsupported on #{MacOS.version}. Homebrew
|
Ruby version #{RUBY_VERSION} is unsupported on #{MacOS.version}. Homebrew
|
||||||
is developed and tested on Ruby #{ruby_version}, and may not work correctly
|
is developed and tested on Ruby #{ruby_version}, and may not work correctly
|
||||||
on other Rubies. Patches are accepted as long as they don't cause breakage
|
on other Rubies. Patches are accepted as long as they don't cause breakage
|
||||||
@ -212,7 +212,7 @@ module Homebrew
|
|||||||
return if prefix.nil?
|
return if prefix.nil?
|
||||||
return unless prefix.to_s.include?(" ")
|
return unless prefix.to_s.include?(" ")
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Xcode is installed to a directory with a space in the name.
|
Xcode is installed to a directory with a space in the name.
|
||||||
This will cause some formulae to fail to build.
|
This will cause some formulae to fail to build.
|
||||||
EOS
|
EOS
|
||||||
@ -222,7 +222,7 @@ module Homebrew
|
|||||||
prefix = MacOS::Xcode.prefix
|
prefix = MacOS::Xcode.prefix
|
||||||
return if prefix.nil? || prefix.exist?
|
return if prefix.nil? || prefix.exist?
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
The directory Xcode is reportedly installed to doesn't exist:
|
The directory Xcode is reportedly installed to doesn't exist:
|
||||||
#{prefix}
|
#{prefix}
|
||||||
You may need to `xcode-select` the proper path if you have moved Xcode.
|
You may need to `xcode-select` the proper path if you have moved Xcode.
|
||||||
@ -236,7 +236,7 @@ module Homebrew
|
|||||||
|
|
||||||
path = MacOS::Xcode.bundle_path
|
path = MacOS::Xcode.bundle_path
|
||||||
path = "/Developer" if path.nil? || !path.directory?
|
path = "/Developer" if path.nil? || !path.directory?
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Your Xcode is configured with an invalid path.
|
Your Xcode is configured with an invalid path.
|
||||||
You should change it to the correct path:
|
You should change it to the correct path:
|
||||||
sudo xcode-select -switch #{path}
|
sudo xcode-select -switch #{path}
|
||||||
@ -247,7 +247,7 @@ module Homebrew
|
|||||||
return unless MacOS.version <= "10.8"
|
return unless MacOS.version <= "10.8"
|
||||||
return if Formula["curl"].installed?
|
return if Formula["curl"].installed?
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
The system curl on 10.8 and below is often incapable of supporting
|
The system curl on 10.8 and below is often incapable of supporting
|
||||||
modern secure connections & will fail on fetching formulae.
|
modern secure connections & will fail on fetching formulae.
|
||||||
|
|
||||||
@ -261,7 +261,7 @@ module Homebrew
|
|||||||
return unless MacOS.version >= :yosemite
|
return unless MacOS.version >= :yosemite
|
||||||
return if ENV["SSL_CERT_DIR"].nil?
|
return if ENV["SSL_CERT_DIR"].nil?
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
SSL_CERT_DIR support was removed from Apple's curl.
|
SSL_CERT_DIR support was removed from Apple's curl.
|
||||||
If fetching formulae fails you should:
|
If fetching formulae fails you should:
|
||||||
unset SSL_CERT_DIR
|
unset SSL_CERT_DIR
|
||||||
@ -274,7 +274,7 @@ module Homebrew
|
|||||||
# license or no "xc*" tool will work.
|
# license or no "xc*" tool will work.
|
||||||
return unless `/usr/bin/xcrun clang 2>&1` =~ /license/ && !$CHILD_STATUS.success?
|
return unless `/usr/bin/xcrun clang 2>&1` =~ /license/ && !$CHILD_STATUS.success?
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
You have not agreed to the Xcode license.
|
You have not agreed to the Xcode license.
|
||||||
Builds will fail! Agree to the license by opening Xcode.app or running:
|
Builds will fail! Agree to the license by opening Xcode.app or running:
|
||||||
sudo xcodebuild -license
|
sudo xcodebuild -license
|
||||||
@ -289,7 +289,7 @@ module Homebrew
|
|||||||
latest_version = Version.create(MacOS::XQuartz.latest_version)
|
latest_version = Version.create(MacOS::XQuartz.latest_version)
|
||||||
return if installed_version >= latest_version
|
return if installed_version >= latest_version
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Your XQuartz (#{installed_version}) is outdated.
|
Your XQuartz (#{installed_version}) is outdated.
|
||||||
Please install XQuartz #{latest_version} (or delete the current version).
|
Please install XQuartz #{latest_version} (or delete the current version).
|
||||||
XQuartz can be updated using Homebrew-Cask by running
|
XQuartz can be updated using Homebrew-Cask by running
|
||||||
@ -301,7 +301,7 @@ module Homebrew
|
|||||||
return unless MacOS::XQuartz.version
|
return unless MacOS::XQuartz.version
|
||||||
return unless MacOS::XQuartz.version.include? "beta"
|
return unless MacOS::XQuartz.version.include? "beta"
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
The following beta release of XQuartz is installed: #{MacOS::XQuartz.version}
|
The following beta release of XQuartz is installed: #{MacOS::XQuartz.version}
|
||||||
|
|
||||||
XQuartz beta releases include address sanitization, and do not work with
|
XQuartz beta releases include address sanitization, and do not work with
|
||||||
@ -337,7 +337,7 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
case_sensitive_vols.uniq!
|
case_sensitive_vols.uniq!
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
The filesystem on #{case_sensitive_vols.join(",")} appears to be case-sensitive.
|
The filesystem on #{case_sensitive_vols.join(",")} appears to be case-sensitive.
|
||||||
The default macOS filesystem is case-insensitive. Please report any apparent problems.
|
The default macOS filesystem is case-insensitive. Please report any apparent problems.
|
||||||
EOS
|
EOS
|
||||||
@ -346,7 +346,7 @@ module Homebrew
|
|||||||
def check_homebrew_prefix
|
def check_homebrew_prefix
|
||||||
return if HOMEBREW_PREFIX.to_s == "/usr/local"
|
return if HOMEBREW_PREFIX.to_s == "/usr/local"
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Your Homebrew's prefix is not /usr/local.
|
Your Homebrew's prefix is not /usr/local.
|
||||||
You can install Homebrew anywhere you want but some bottles (binary packages)
|
You can install Homebrew anywhere you want but some bottles (binary packages)
|
||||||
can only be used with a /usr/local prefix and some formulae (packages)
|
can only be used with a /usr/local prefix and some formulae (packages)
|
||||||
@ -360,7 +360,7 @@ module Homebrew
|
|||||||
|
|
||||||
mono_config = Pathname.new("/usr/bin/pkg-config")
|
mono_config = Pathname.new("/usr/bin/pkg-config")
|
||||||
if mono_config.exist? && mono_config.realpath.to_s.include?("Mono.framework")
|
if mono_config.exist? && mono_config.realpath.to_s.include?("Mono.framework")
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
You have a non-Homebrew 'pkg-config' in your PATH:
|
You have a non-Homebrew 'pkg-config' in your PATH:
|
||||||
/usr/bin/pkg-config => #{mono_config.realpath}
|
/usr/bin/pkg-config => #{mono_config.realpath}
|
||||||
|
|
||||||
@ -371,7 +371,7 @@ module Homebrew
|
|||||||
`sudo rm /usr/bin/pkg-config` and upgrade to the latest version of Mono.
|
`sudo rm /usr/bin/pkg-config` and upgrade to the latest version of Mono.
|
||||||
EOS
|
EOS
|
||||||
elsif binary.to_s != "#{HOMEBREW_PREFIX}/bin/pkg-config"
|
elsif binary.to_s != "#{HOMEBREW_PREFIX}/bin/pkg-config"
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
You have a non-Homebrew 'pkg-config' in your PATH:
|
You have a non-Homebrew 'pkg-config' in your PATH:
|
||||||
#{binary}
|
#{binary}
|
||||||
|
|
||||||
|
|||||||
@ -19,7 +19,7 @@ module FormulaCellarChecks
|
|||||||
|
|
||||||
return if files.empty?
|
return if files.empty?
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Header files that shadow system header files were installed to "#{formula.include}"
|
Header files that shadow system header files were installed to "#{formula.include}"
|
||||||
The offending files are:
|
The offending files are:
|
||||||
#{files * "\n "}
|
#{files * "\n "}
|
||||||
@ -35,7 +35,7 @@ module FormulaCellarChecks
|
|||||||
end
|
end
|
||||||
return if system_openssl.empty?
|
return if system_openssl.empty?
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
object files were linked against system openssl
|
object files were linked against system openssl
|
||||||
These object files were linked against the deprecated system OpenSSL or
|
These object files were linked against the deprecated system OpenSSL or
|
||||||
the system's private LibreSSL.
|
the system's private LibreSSL.
|
||||||
@ -52,7 +52,7 @@ module FormulaCellarChecks
|
|||||||
end
|
end
|
||||||
return if framework_links.empty?
|
return if framework_links.empty?
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
python modules have explicit framework links
|
python modules have explicit framework links
|
||||||
These python extension modules were linked directly to a Python
|
These python extension modules were linked directly to a Python
|
||||||
framework binary. They should be linked with -undefined dynamic_lookup
|
framework binary. They should be linked with -undefined dynamic_lookup
|
||||||
@ -67,13 +67,13 @@ module FormulaCellarChecks
|
|||||||
checker = LinkageChecker.new(keg, formula)
|
checker = LinkageChecker.new(keg, formula)
|
||||||
|
|
||||||
return unless checker.broken_dylibs?
|
return unless checker.broken_dylibs?
|
||||||
output = <<-EOS.undent
|
output = <<~EOS
|
||||||
#{formula} has broken dynamic library links:
|
#{formula} has broken dynamic library links:
|
||||||
#{checker.broken_dylibs.to_a * "\n "}
|
#{checker.broken_dylibs.to_a * "\n "}
|
||||||
EOS
|
EOS
|
||||||
tab = Tab.for_keg(keg)
|
tab = Tab.for_keg(keg)
|
||||||
if tab.poured_from_bottle
|
if tab.poured_from_bottle
|
||||||
output += <<-EOS.undent
|
output += <<~EOS
|
||||||
Rebuild this from source with:
|
Rebuild this from source with:
|
||||||
brew reinstall --build-from-source #{formula}
|
brew reinstall --build-from-source #{formula}
|
||||||
If that's successful, file an issue#{formula.tap ? " here:\n #{formula.tap.issues_url}" : "."}
|
If that's successful, file an issue#{formula.tap ? " here:\n #{formula.tap.issues_url}" : "."}
|
||||||
|
|||||||
@ -5,12 +5,12 @@ module Homebrew
|
|||||||
case name.downcase
|
case name.downcase
|
||||||
when "xcode"
|
when "xcode"
|
||||||
if MacOS.version >= :lion
|
if MacOS.version >= :lion
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Xcode can be installed from the App Store.
|
Xcode can be installed from the App Store.
|
||||||
EOS
|
EOS
|
||||||
else
|
else
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Xcode can be installed from #{Formatter.url("https://developer.apple.com/download/more/")}.
|
Xcode can be installed from #{Formatter.url("https://developer.apple.com/download/more/")}.
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|||||||
@ -26,7 +26,7 @@ class NonBinaryOsxfuseRequirement < Requirement
|
|||||||
satisfy(build_env: false) { HOMEBREW_PREFIX.to_s != "/usr/local" || !OsxfuseRequirement.binary_osxfuse_installed? }
|
satisfy(build_env: false) { HOMEBREW_PREFIX.to_s != "/usr/local" || !OsxfuseRequirement.binary_osxfuse_installed? }
|
||||||
|
|
||||||
def message
|
def message
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
osxfuse is already installed from the binary distribution and
|
osxfuse is already installed from the binary distribution and
|
||||||
conflicts with this formula.
|
conflicts with this formula.
|
||||||
EOS
|
EOS
|
||||||
|
|||||||
@ -403,7 +403,7 @@ class Pathname
|
|||||||
mkpath
|
mkpath
|
||||||
targets.each do |target|
|
targets.each do |target|
|
||||||
target = Pathname.new(target) # allow pathnames or strings
|
target = Pathname.new(target) # allow pathnames or strings
|
||||||
join(target.basename).write <<-EOS.undent
|
join(target.basename).write <<~EOS
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
exec "#{target}" "$@"
|
exec "#{target}" "$@"
|
||||||
EOS
|
EOS
|
||||||
@ -415,9 +415,9 @@ class Pathname
|
|||||||
env_export = ""
|
env_export = ""
|
||||||
env.each { |key, value| env_export += "#{key}=\"#{value}\" " }
|
env.each { |key, value| env_export += "#{key}=\"#{value}\" " }
|
||||||
dirname.mkpath
|
dirname.mkpath
|
||||||
write <<-EOS.undent
|
write <<~EOS
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#{env_export}exec "#{target}" "$@"
|
#{env_export}exec "#{target}" "$@"
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -435,7 +435,7 @@ class Pathname
|
|||||||
# Writes an exec script that invokes a java jar
|
# Writes an exec script that invokes a java jar
|
||||||
def write_jar_script(target_jar, script_name, java_opts = "")
|
def write_jar_script(target_jar, script_name, java_opts = "")
|
||||||
mkpath
|
mkpath
|
||||||
join(script_name).write <<-EOS.undent
|
join(script_name).write <<~EOS
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
exec java #{java_opts} -jar #{target_jar} "$@"
|
exec java #{java_opts} -jar #{target_jar} "$@"
|
||||||
EOS
|
EOS
|
||||||
|
|||||||
@ -2,23 +2,6 @@
|
|||||||
require_relative "../vendor/backports/string"
|
require_relative "../vendor/backports/string"
|
||||||
|
|
||||||
class String
|
class String
|
||||||
def undent
|
|
||||||
gsub(/^[ \t]{#{(slice(/^[ \t]+/) || '').length}}/, "")
|
|
||||||
end
|
|
||||||
alias unindent undent
|
|
||||||
|
|
||||||
# eg:
|
|
||||||
# if foo then <<-EOS.undent_________________________________________________________72
|
|
||||||
# Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
|
|
||||||
# eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
|
|
||||||
# minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip
|
|
||||||
# ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
|
|
||||||
# voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
|
|
||||||
# sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
|
|
||||||
# mollit anim id est laborum.
|
|
||||||
# EOS
|
|
||||||
alias undent_________________________________________________________72 undent
|
|
||||||
|
|
||||||
# String.chomp, but if result is empty: returns nil instead.
|
# String.chomp, but if result is empty: returns nil instead.
|
||||||
# Allows `chuzzle || foo` short-circuits.
|
# Allows `chuzzle || foo` short-circuits.
|
||||||
def chuzzle
|
def chuzzle
|
||||||
|
|||||||
@ -839,7 +839,7 @@ class Formula
|
|||||||
# This method can be overridden to provide a plist.
|
# This method can be overridden to provide a plist.
|
||||||
# For more examples read Apple's handy manpage:
|
# For more examples read Apple's handy manpage:
|
||||||
# https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man5/plist.5.html
|
# https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man5/plist.5.html
|
||||||
# <pre>def plist; <<-EOS.undent
|
# <pre>def plist; <<~EOS
|
||||||
# <?xml version="1.0" encoding="UTF-8"?>
|
# <?xml version="1.0" encoding="UTF-8"?>
|
||||||
# <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
# <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
# <plist version="1.0">
|
# <plist version="1.0">
|
||||||
@ -986,13 +986,13 @@ class Formula
|
|||||||
# to installation through a different package manager on a different OS.
|
# to installation through a different package manager on a different OS.
|
||||||
# @return [String]
|
# @return [String]
|
||||||
# <pre>def caveats
|
# <pre>def caveats
|
||||||
# <<-EOS.undent
|
# <<~EOS
|
||||||
# Are optional. Something the user should know?
|
# Are optional. Something the user should know?
|
||||||
# EOS
|
# EOS
|
||||||
# end</pre>
|
# end</pre>
|
||||||
#
|
#
|
||||||
# <pre>def caveats
|
# <pre>def caveats
|
||||||
# s = <<-EOS.undent
|
# s = <<~EOS
|
||||||
# Print some important notice to the user when `brew info <formula>` is
|
# Print some important notice to the user when `brew info <formula>` is
|
||||||
# called or when brewing a formula.
|
# called or when brewing a formula.
|
||||||
# This is optional. You can use all the vars like #{version} here.
|
# This is optional. You can use all the vars like #{version} here.
|
||||||
@ -1691,7 +1691,7 @@ class Formula
|
|||||||
# keep Homebrew's site-packages in sys.path when using system Python
|
# keep Homebrew's site-packages in sys.path when using system Python
|
||||||
user_site_packages = home/"Library/Python/2.7/lib/python/site-packages"
|
user_site_packages = home/"Library/Python/2.7/lib/python/site-packages"
|
||||||
user_site_packages.mkpath
|
user_site_packages.mkpath
|
||||||
(user_site_packages/"homebrew.pth").write <<-EOS.undent
|
(user_site_packages/"homebrew.pth").write <<~EOS
|
||||||
import site; site.addsitedir("#{HOMEBREW_PREFIX}/lib/python2.7/site-packages")
|
import site; site.addsitedir("#{HOMEBREW_PREFIX}/lib/python2.7/site-packages")
|
||||||
import sys, os; sys.path = (os.environ["PYTHONPATH"].split(os.pathsep) if "PYTHONPATH" in os.environ else []) + ["#{HOMEBREW_PREFIX}/lib/python2.7/site-packages"] + sys.path
|
import sys, os; sys.path = (os.environ["PYTHONPATH"].split(os.pathsep) if "PYTHONPATH" in os.environ else []) + ["#{HOMEBREW_PREFIX}/lib/python2.7/site-packages"] + sys.path
|
||||||
EOS
|
EOS
|
||||||
@ -2394,7 +2394,7 @@ class Formula
|
|||||||
# and building the software was ok.
|
# and building the software was ok.
|
||||||
# <pre>system bin/"foobar", "--version"</pre>
|
# <pre>system bin/"foobar", "--version"</pre>
|
||||||
#
|
#
|
||||||
# <pre>(testpath/"test.file").write <<-EOS.undent
|
# <pre>(testpath/"test.file").write <<~EOS
|
||||||
# writing some test file, if you need to
|
# writing some test file, if you need to
|
||||||
# EOS
|
# EOS
|
||||||
# assert_equal "OK", shell_output("test_command test.file").strip</pre>
|
# assert_equal "OK", shell_output("test_command test.file").strip</pre>
|
||||||
|
|||||||
@ -12,7 +12,7 @@ module FormulaCellarChecks
|
|||||||
prefix_bin = prefix_bin.realpath
|
prefix_bin = prefix_bin.realpath
|
||||||
return if ORIGINAL_PATHS.include? prefix_bin
|
return if ORIGINAL_PATHS.include? prefix_bin
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~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
|
You can amend this by altering your #{Utils::Shell.profile} file
|
||||||
EOS
|
EOS
|
||||||
@ -22,7 +22,7 @@ module FormulaCellarChecks
|
|||||||
# Check for man pages that aren't in share/man
|
# Check for man pages that aren't in share/man
|
||||||
return unless (formula.prefix/"man").directory?
|
return unless (formula.prefix/"man").directory?
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
A top-level "man" directory was found
|
A top-level "man" directory was found
|
||||||
Homebrew requires that man pages live under share.
|
Homebrew requires that man pages live under share.
|
||||||
This can often be fixed by passing "--mandir=\#{man}" to configure.
|
This can often be fixed by passing "--mandir=\#{man}" to configure.
|
||||||
@ -33,7 +33,7 @@ module FormulaCellarChecks
|
|||||||
# Check for info pages that aren't in share/info
|
# Check for info pages that aren't in share/info
|
||||||
return unless (formula.prefix/"info").directory?
|
return unless (formula.prefix/"info").directory?
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
A top-level "info" directory was found
|
A top-level "info" directory was found
|
||||||
Homebrew suggests that info pages live under share.
|
Homebrew suggests that info pages live under share.
|
||||||
This can often be fixed by passing "--infodir=\#{info}" to configure.
|
This can often be fixed by passing "--infodir=\#{info}" to configure.
|
||||||
@ -45,7 +45,7 @@ module FormulaCellarChecks
|
|||||||
jars = formula.lib.children.select { |g| g.extname == ".jar" }
|
jars = formula.lib.children.select { |g| g.extname == ".jar" }
|
||||||
return if jars.empty?
|
return if jars.empty?
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
JARs were installed to "#{formula.lib}"
|
JARs were installed to "#{formula.lib}"
|
||||||
Installing JARs to "lib" can cause conflicts between packages.
|
Installing JARs to "lib" can cause conflicts between packages.
|
||||||
For Java software, it is typically better for the formula to
|
For Java software, it is typically better for the formula to
|
||||||
@ -67,7 +67,7 @@ module FormulaCellarChecks
|
|||||||
end
|
end
|
||||||
return if non_libraries.empty?
|
return if non_libraries.empty?
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Non-libraries were installed to "#{formula.lib}"
|
Non-libraries were installed to "#{formula.lib}"
|
||||||
Installing non-libraries to "lib" is discouraged.
|
Installing non-libraries to "lib" is discouraged.
|
||||||
The offending files are:
|
The offending files are:
|
||||||
@ -81,7 +81,7 @@ module FormulaCellarChecks
|
|||||||
non_exes = bin.children.select { |g| g.directory? || !g.executable? }
|
non_exes = bin.children.select { |g| g.directory? || !g.executable? }
|
||||||
return if non_exes.empty?
|
return if non_exes.empty?
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Non-executables were installed to "#{bin}"
|
Non-executables were installed to "#{bin}"
|
||||||
The offending files are:
|
The offending files are:
|
||||||
#{non_exes * "\n "}
|
#{non_exes * "\n "}
|
||||||
@ -94,7 +94,7 @@ module FormulaCellarChecks
|
|||||||
generics = bin.children.select { |g| generic_names.include? g.basename.to_s }
|
generics = bin.children.select { |g| generic_names.include? g.basename.to_s }
|
||||||
return if generics.empty?
|
return if generics.empty?
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Generic binaries were installed to "#{bin}"
|
Generic binaries were installed to "#{bin}"
|
||||||
Binaries with generic names are likely to conflict with other software,
|
Binaries with generic names are likely to conflict with other software,
|
||||||
and suggest that this software should be installed to "libexec" and then
|
and suggest that this software should be installed to "libexec" and then
|
||||||
@ -109,7 +109,7 @@ module FormulaCellarChecks
|
|||||||
pth_found = Dir["#{lib}/python{2.7,3}*/site-packages/easy-install.pth"].map { |f| File.dirname(f) }
|
pth_found = Dir["#{lib}/python{2.7,3}*/site-packages/easy-install.pth"].map { |f| File.dirname(f) }
|
||||||
return if pth_found.empty?
|
return if pth_found.empty?
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
easy-install.pth files were found
|
easy-install.pth files were found
|
||||||
These .pth files are likely to cause link conflicts. Please invoke
|
These .pth files are likely to cause link conflicts. Please invoke
|
||||||
setup.py using Language::Python.setup_install_args.
|
setup.py using Language::Python.setup_install_args.
|
||||||
@ -128,7 +128,7 @@ module FormulaCellarChecks
|
|||||||
end
|
end
|
||||||
|
|
||||||
return unless bad_dir_name
|
return unless bad_dir_name
|
||||||
<<-EOS
|
<<~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:
|
They should be installed into:
|
||||||
#{share}/emacs/site-lisp/#{name}
|
#{share}/emacs/site-lisp/#{name}
|
||||||
@ -142,7 +142,7 @@ module FormulaCellarChecks
|
|||||||
|
|
||||||
elisps = (share/"emacs/site-lisp").children.select { |file| %w[.el .elc].include? file.extname }
|
elisps = (share/"emacs/site-lisp").children.select { |file| %w[.el .elc].include? file.extname }
|
||||||
return if elisps.empty?
|
return if elisps.empty?
|
||||||
<<-EOS.undent
|
<<~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.
|
This may cause conflicts with other packages.
|
||||||
They should instead be installed into:
|
They should instead be installed into:
|
||||||
|
|||||||
@ -93,7 +93,7 @@ class FormulaInstaller
|
|||||||
return false if formula.bottle_disabled?
|
return false if formula.bottle_disabled?
|
||||||
unless formula.pour_bottle?
|
unless formula.pour_bottle?
|
||||||
if install_bottle_options[:warn] && formula.pour_bottle_check_unsatisfied_reason
|
if install_bottle_options[:warn] && formula.pour_bottle_check_unsatisfied_reason
|
||||||
opoo <<-EOS.undent
|
opoo <<~EOS
|
||||||
Building #{formula.full_name} from source:
|
Building #{formula.full_name} from source:
|
||||||
#{formula.pour_bottle_check_unsatisfied_reason}
|
#{formula.pour_bottle_check_unsatisfied_reason}
|
||||||
EOS
|
EOS
|
||||||
@ -104,7 +104,7 @@ class FormulaInstaller
|
|||||||
bottle = formula.bottle_specification
|
bottle = formula.bottle_specification
|
||||||
unless bottle.compatible_cellar?
|
unless bottle.compatible_cellar?
|
||||||
if install_bottle_options[:warn]
|
if install_bottle_options[:warn]
|
||||||
opoo <<-EOS.undent
|
opoo <<~EOS
|
||||||
Building #{formula.full_name} from source:
|
Building #{formula.full_name} from source:
|
||||||
The bottle needs a #{bottle.cellar} Cellar (yours is #{HOMEBREW_CELLAR}).
|
The bottle needs a #{bottle.cellar} Cellar (yours is #{HOMEBREW_CELLAR}).
|
||||||
EOS
|
EOS
|
||||||
@ -165,14 +165,14 @@ class FormulaInstaller
|
|||||||
end
|
end
|
||||||
|
|
||||||
unless recursive_dependencies.empty?
|
unless recursive_dependencies.empty?
|
||||||
raise CannotInstallFormulaError, <<-EOS.undent
|
raise CannotInstallFormulaError, <<~EOS
|
||||||
#{formula.full_name} contains a recursive dependency on itself:
|
#{formula.full_name} contains a recursive dependency on itself:
|
||||||
#{recursive_dependencies.join("\n ")}
|
#{recursive_dependencies.join("\n ")}
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
if recursive_formulae.flat_map(&:recursive_dependencies).map(&:to_s).include?(formula.name)
|
if recursive_formulae.flat_map(&:recursive_dependencies).map(&:to_s).include?(formula.name)
|
||||||
raise CannotInstallFormulaError, <<-EOS.undent
|
raise CannotInstallFormulaError, <<~EOS
|
||||||
#{formula.full_name} contains a recursive dependency on itself!
|
#{formula.full_name} contains a recursive dependency on itself!
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
@ -188,7 +188,7 @@ class FormulaInstaller
|
|||||||
version_conflicts += version_hash[unversioned_name]
|
version_conflicts += version_hash[unversioned_name]
|
||||||
end
|
end
|
||||||
unless version_conflicts.empty?
|
unless version_conflicts.empty?
|
||||||
raise CannotInstallFormulaError, <<-EOS.undent
|
raise CannotInstallFormulaError, <<~EOS
|
||||||
#{formula.full_name} contains conflicting version recursive dependencies:
|
#{formula.full_name} contains conflicting version recursive dependencies:
|
||||||
#{version_conflicts.to_a.join ", "}
|
#{version_conflicts.to_a.join ", "}
|
||||||
View these with `brew deps --tree #{formula.full_name}`.
|
View these with `brew deps --tree #{formula.full_name}`.
|
||||||
@ -221,16 +221,16 @@ class FormulaInstaller
|
|||||||
# function but after instantiating this class so that it can avoid having to
|
# function but after instantiating this class so that it can avoid having to
|
||||||
# relink the active keg if possible (because it is slow).
|
# relink the active keg if possible (because it is slow).
|
||||||
if formula.linked_keg.directory?
|
if formula.linked_keg.directory?
|
||||||
message = <<-EOS.undent
|
message = <<~EOS
|
||||||
#{formula.name} #{formula.linked_version} is already installed
|
#{formula.name} #{formula.linked_version} is already installed
|
||||||
EOS
|
EOS
|
||||||
message += if formula.outdated? && !formula.head?
|
message += if formula.outdated? && !formula.head?
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
To upgrade to #{formula.pkg_version}, run `brew upgrade #{formula.name}`
|
To upgrade to #{formula.pkg_version}, run `brew upgrade #{formula.name}`
|
||||||
EOS
|
EOS
|
||||||
else
|
else
|
||||||
# some other version is already installed *and* linked
|
# some other version is already installed *and* linked
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
To install #{formula.pkg_version}, first run `brew unlink #{formula.name}`
|
To install #{formula.pkg_version}, first run `brew unlink #{formula.name}`
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
@ -355,7 +355,7 @@ class FormulaInstaller
|
|||||||
rescue FormulaUnavailableError => e
|
rescue FormulaUnavailableError => e
|
||||||
# If the formula name doesn't exist any more then complain but don't
|
# If the formula name doesn't exist any more then complain but don't
|
||||||
# stop installation from continuing.
|
# stop installation from continuing.
|
||||||
opoo <<-EOS.undent
|
opoo <<~EOS
|
||||||
#{formula}: #{e.message}
|
#{formula}: #{e.message}
|
||||||
'conflicts_with \"#{c.name}\"' should be removed from #{formula.path.basename}.
|
'conflicts_with \"#{c.name}\"' should be removed from #{formula.path.basename}.
|
||||||
EOS
|
EOS
|
||||||
|
|||||||
@ -33,33 +33,33 @@ class KegOnlyReason
|
|||||||
def to_s
|
def to_s
|
||||||
return @explanation unless @explanation.empty?
|
return @explanation unless @explanation.empty?
|
||||||
case @reason
|
case @reason
|
||||||
when :versioned_formula then <<-EOS.undent
|
when :versioned_formula then <<~EOS
|
||||||
this is an alternate version of another formula
|
this is an alternate version of another formula
|
||||||
EOS
|
EOS
|
||||||
when :provided_by_macos, :provided_by_osx then <<-EOS.undent
|
when :provided_by_macos, :provided_by_osx then <<~EOS
|
||||||
macOS already provides this software and installing another version in
|
macOS already provides this software and installing another version in
|
||||||
parallel can cause all kinds of trouble
|
parallel can cause all kinds of trouble
|
||||||
EOS
|
EOS
|
||||||
when :shadowed_by_macos, :shadowed_by_osx then <<-EOS.undent
|
when :shadowed_by_macos, :shadowed_by_osx then <<~EOS
|
||||||
macOS provides similar software and installing this software in
|
macOS provides similar software and installing this software in
|
||||||
parallel can cause all kinds of trouble
|
parallel can cause all kinds of trouble
|
||||||
EOS
|
EOS
|
||||||
when :provided_pre_mountain_lion then <<-EOS.undent
|
when :provided_pre_mountain_lion then <<~EOS
|
||||||
macOS already provides this software in versions before Mountain Lion
|
macOS already provides this software in versions before Mountain Lion
|
||||||
EOS
|
EOS
|
||||||
when :provided_pre_mavericks then <<-EOS.undent
|
when :provided_pre_mavericks then <<~EOS
|
||||||
macOS already provides this software in versions before Mavericks
|
macOS already provides this software in versions before Mavericks
|
||||||
EOS
|
EOS
|
||||||
when :provided_pre_el_capitan then <<-EOS.undent
|
when :provided_pre_el_capitan then <<~EOS
|
||||||
macOS already provides this software in versions before El Capitan
|
macOS already provides this software in versions before El Capitan
|
||||||
EOS
|
EOS
|
||||||
when :provided_pre_high_sierra then <<-EOS.undent
|
when :provided_pre_high_sierra then <<~EOS
|
||||||
macOS already provides this software in versions before High Sierra
|
macOS already provides this software in versions before High Sierra
|
||||||
EOS
|
EOS
|
||||||
when :provided_until_xcode43 then <<-EOS.undent
|
when :provided_until_xcode43 then <<~EOS
|
||||||
Xcode provides this software prior to version 4.3
|
Xcode provides this software prior to version 4.3
|
||||||
EOS
|
EOS
|
||||||
when :provided_until_xcode5 then <<-EOS.undent
|
when :provided_until_xcode5 then <<~EOS
|
||||||
Xcode provides this software prior to version 5
|
Xcode provides this software prior to version 5
|
||||||
EOS
|
EOS
|
||||||
else
|
else
|
||||||
|
|||||||
@ -128,7 +128,7 @@ module Formulary
|
|||||||
formula = begin
|
formula = begin
|
||||||
Formulary.from_contents name, @bottle_filename, contents, spec
|
Formulary.from_contents name, @bottle_filename, contents, spec
|
||||||
rescue FormulaUnreadableError => e
|
rescue FormulaUnreadableError => e
|
||||||
opoo <<-EOS.undent
|
opoo <<~EOS
|
||||||
Unreadable formula in #{@bottle_filename}:
|
Unreadable formula in #{@bottle_filename}:
|
||||||
#{e}
|
#{e}
|
||||||
EOS
|
EOS
|
||||||
@ -443,7 +443,7 @@ module Formulary
|
|||||||
if possible_pinned_tap_formulae.size == 1
|
if possible_pinned_tap_formulae.size == 1
|
||||||
selected_formula = factory(possible_pinned_tap_formulae.first, spec)
|
selected_formula = factory(possible_pinned_tap_formulae.first, spec)
|
||||||
if core_path(ref).file?
|
if core_path(ref).file?
|
||||||
opoo <<-EOS.undent
|
opoo <<~EOS
|
||||||
#{ref} is provided by core, but is now shadowed by #{selected_formula.full_name}.
|
#{ref} is provided by core, but is now shadowed by #{selected_formula.full_name}.
|
||||||
To refer to the core formula, use Homebrew/core/#{ref} instead.
|
To refer to the core formula, use Homebrew/core/#{ref} instead.
|
||||||
EOS
|
EOS
|
||||||
|
|||||||
@ -32,7 +32,7 @@ class Gpg
|
|||||||
def self.create_test_key(path)
|
def self.create_test_key(path)
|
||||||
odie "No GPG present to test against!" unless available?
|
odie "No GPG present to test against!" unless available?
|
||||||
|
|
||||||
(path/"batch.gpg").write <<-EOS.undent
|
(path/"batch.gpg").write <<~EOS
|
||||||
Key-Type: RSA
|
Key-Type: RSA
|
||||||
Key-Length: 2048
|
Key-Length: 2048
|
||||||
Subkey-Type: RSA
|
Subkey-Type: RSA
|
||||||
|
|||||||
@ -6,7 +6,7 @@ require "ostruct"
|
|||||||
class Keg
|
class Keg
|
||||||
class AlreadyLinkedError < RuntimeError
|
class AlreadyLinkedError < RuntimeError
|
||||||
def initialize(keg)
|
def initialize(keg)
|
||||||
super <<-EOS.undent
|
super <<~EOS
|
||||||
Cannot link #{keg.name}
|
Cannot link #{keg.name}
|
||||||
Another version is already linked: #{keg.linked_keg_record.resolved_path}
|
Another version is already linked: #{keg.linked_keg_record.resolved_path}
|
||||||
EOS
|
EOS
|
||||||
@ -32,9 +32,9 @@ class Keg
|
|||||||
rescue NotAKegError, Errno::ENOENT
|
rescue NotAKegError, Errno::ENOENT
|
||||||
"already exists. You may want to remove it:\n rm '#{dst}'\n"
|
"already exists. You may want to remove it:\n rm '#{dst}'\n"
|
||||||
else
|
else
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
is a symlink belonging to #{conflict.name}. You can unlink it:
|
is a symlink belonging to #{conflict.name}. You can unlink it:
|
||||||
brew unlink #{conflict.name}
|
brew unlink #{conflict.name}
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ class Keg
|
|||||||
s = []
|
s = []
|
||||||
s << "Could not symlink #{src}"
|
s << "Could not symlink #{src}"
|
||||||
s << "Target #{dst}" << suggestion
|
s << "Target #{dst}" << suggestion
|
||||||
s << <<-EOS.undent
|
s << <<~EOS
|
||||||
To force the link and overwrite all conflicting files:
|
To force the link and overwrite all conflicting files:
|
||||||
brew link --overwrite #{keg.name}
|
brew link --overwrite #{keg.name}
|
||||||
|
|
||||||
@ -54,7 +54,7 @@ class Keg
|
|||||||
end
|
end
|
||||||
|
|
||||||
class DirectoryNotWritableError < LinkError
|
class DirectoryNotWritableError < LinkError
|
||||||
def to_s; <<-EOS.undent
|
def to_s; <<~EOS
|
||||||
Could not symlink #{src}
|
Could not symlink #{src}
|
||||||
#{dst.dirname} is not writable.
|
#{dst.dirname} is not writable.
|
||||||
EOS
|
EOS
|
||||||
|
|||||||
@ -46,7 +46,7 @@ module Language
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.in_sys_path?(python, path)
|
def self.in_sys_path?(python, path)
|
||||||
script = <<-EOS.undent
|
script = <<~EOS
|
||||||
import os, sys
|
import os, sys
|
||||||
[os.path.realpath(p) for p in sys.path].index(os.path.realpath("#{path}"))
|
[os.path.realpath(p) for p in sys.path].index(os.path.realpath("#{path}"))
|
||||||
EOS
|
EOS
|
||||||
@ -54,7 +54,7 @@ module Language
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.setup_install_args(prefix)
|
def self.setup_install_args(prefix)
|
||||||
shim = <<-EOS.undent
|
shim = <<~EOS
|
||||||
import setuptools, tokenize
|
import setuptools, tokenize
|
||||||
__file__ = 'setup.py'
|
__file__ = 'setup.py'
|
||||||
exec(compile(getattr(tokenize, 'open', open)(__file__).read()
|
exec(compile(getattr(tokenize, 'open', open)(__file__).read()
|
||||||
|
|||||||
@ -6,7 +6,7 @@ require "tab"
|
|||||||
class Migrator
|
class Migrator
|
||||||
class MigrationNeededError < RuntimeError
|
class MigrationNeededError < RuntimeError
|
||||||
def initialize(formula)
|
def initialize(formula)
|
||||||
super <<-EOS.undent
|
super <<~EOS
|
||||||
#{formula.oldname} was renamed to #{formula.name} and needs to be migrated.
|
#{formula.oldname} was renamed to #{formula.name} and needs to be migrated.
|
||||||
Please run `brew migrate #{formula.oldname}`
|
Please run `brew migrate #{formula.oldname}`
|
||||||
EOS
|
EOS
|
||||||
@ -33,10 +33,9 @@ class Migrator
|
|||||||
"Please try to use fully-qualified #{tap}/#{formula.oldname} to refer the formula.\n"
|
"Please try to use fully-qualified #{tap}/#{formula.oldname} to refer the formula.\n"
|
||||||
end
|
end
|
||||||
|
|
||||||
super <<-EOS.undent
|
super <<~EOS
|
||||||
#{formula.name} from #{formula.tap} is given, but old name #{formula.oldname} was installed from #{tap ? tap : "path or url"}.
|
#{formula.name} from #{formula.tap} is given, but old name #{formula.oldname} was installed from #{tap ? tap : "path or url"}.
|
||||||
|
#{msg}To force migrate use `brew migrate --force #{formula.oldname}`.
|
||||||
#{msg}To force migrate use `brew migrate --force #{formula.oldname}`.
|
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -12,10 +12,10 @@ module Homebrew
|
|||||||
|
|
||||||
def blacklisted_reason(name)
|
def blacklisted_reason(name)
|
||||||
case name.downcase
|
case name.downcase
|
||||||
when "gem", /^rubygems?$/ then <<-EOS.undent
|
when "gem", /^rubygems?$/ then <<~EOS
|
||||||
Homebrew provides gem via: `brew install ruby`.
|
Homebrew provides gem via: `brew install ruby`.
|
||||||
EOS
|
EOS
|
||||||
when "tex", "tex-live", "texlive", "latex" then <<-EOS.undent
|
when "tex", "tex-live", "texlive", "latex" then <<~EOS
|
||||||
Installing TeX from source is weird and gross, requires a lot of patches,
|
Installing TeX from source is weird and gross, requires a lot of patches,
|
||||||
and only builds 32-bit (and thus can't use Homebrew dependencies)
|
and only builds 32-bit (and thus can't use Homebrew dependencies)
|
||||||
|
|
||||||
@ -24,42 +24,42 @@ module Homebrew
|
|||||||
You can install it with Homebrew-Cask:
|
You can install it with Homebrew-Cask:
|
||||||
brew cask install mactex
|
brew cask install mactex
|
||||||
EOS
|
EOS
|
||||||
when "pip" then <<-EOS.undent
|
when "pip" then <<~EOS
|
||||||
Homebrew provides pip via: `brew install python`. However you will then
|
Homebrew provides pip via: `brew install python`. However you will then
|
||||||
have two Pythons installed on your Mac, so alternatively you can install
|
have two Pythons installed on your Mac, so alternatively you can install
|
||||||
pip via the instructions at:
|
pip via the instructions at:
|
||||||
#{Formatter.url("https://pip.readthedocs.io/en/stable/installing/")}
|
#{Formatter.url("https://pip.readthedocs.io/en/stable/installing/")}
|
||||||
EOS
|
EOS
|
||||||
when "pil" then <<-EOS.undent
|
when "pil" then <<~EOS
|
||||||
Instead of PIL, consider `pip2 install pillow`.
|
Instead of PIL, consider `pip2 install pillow`.
|
||||||
EOS
|
EOS
|
||||||
when "macruby" then <<-EOS.undent
|
when "macruby" then <<~EOS
|
||||||
MacRuby is not packaged and is on an indefinite development hiatus.
|
MacRuby is not packaged and is on an indefinite development hiatus.
|
||||||
You can read more about it at:
|
You can read more about it at:
|
||||||
#{Formatter.url("https://github.com/MacRuby/MacRuby")}
|
#{Formatter.url("https://github.com/MacRuby/MacRuby")}
|
||||||
EOS
|
EOS
|
||||||
when /(lib)?lzma/
|
when /(lib)?lzma/
|
||||||
"lzma is now part of the xz formula."
|
"lzma is now part of the xz formula."
|
||||||
when "gtest", "googletest", "google-test" then <<-EOS.undent
|
when "gtest", "googletest", "google-test" then <<~EOS
|
||||||
Installing gtest system-wide is not recommended; it should be vendored
|
Installing gtest system-wide is not recommended; it should be vendored
|
||||||
in your projects that use it.
|
in your projects that use it.
|
||||||
EOS
|
EOS
|
||||||
when "gmock", "googlemock", "google-mock" then <<-EOS.undent
|
when "gmock", "googlemock", "google-mock" then <<~EOS
|
||||||
Installing gmock system-wide is not recommended; it should be vendored
|
Installing gmock system-wide is not recommended; it should be vendored
|
||||||
in your projects that use it.
|
in your projects that use it.
|
||||||
EOS
|
EOS
|
||||||
when "sshpass" then <<-EOS.undent
|
when "sshpass" then <<~EOS
|
||||||
We won't add sshpass because it makes it too easy for novice SSH users to
|
We won't add sshpass because it makes it too easy for novice SSH users to
|
||||||
ruin SSH's security.
|
ruin SSH's security.
|
||||||
EOS
|
EOS
|
||||||
when "gsutil" then <<-EOS.undent
|
when "gsutil" then <<~EOS
|
||||||
Install gsutil with `pip2 install gsutil`
|
Install gsutil with `pip2 install gsutil`
|
||||||
EOS
|
EOS
|
||||||
when "gfortran" then <<-EOS.undent
|
when "gfortran" then <<~EOS
|
||||||
GNU Fortran is now provided as part of GCC, and can be installed with:
|
GNU Fortran is now provided as part of GCC, and can be installed with:
|
||||||
brew install gcc
|
brew install gcc
|
||||||
EOS
|
EOS
|
||||||
when "play" then <<-EOS.undent
|
when "play" then <<~EOS
|
||||||
Play 2.3 replaces the play command with activator:
|
Play 2.3 replaces the play command with activator:
|
||||||
brew install typesafe-activator
|
brew install typesafe-activator
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ module Homebrew
|
|||||||
#{Formatter.url("https://www.playframework.com/documentation/2.3.x/Migration23")}
|
#{Formatter.url("https://www.playframework.com/documentation/2.3.x/Migration23")}
|
||||||
#{Formatter.url("https://www.playframework.com/documentation/2.3.x/Highlights23")}
|
#{Formatter.url("https://www.playframework.com/documentation/2.3.x/Highlights23")}
|
||||||
EOS
|
EOS
|
||||||
when "haskell-platform" then <<-EOS.undent
|
when "haskell-platform" then <<~EOS
|
||||||
We no longer package haskell-platform. Consider installing ghc
|
We no longer package haskell-platform. Consider installing ghc
|
||||||
and cabal-install instead:
|
and cabal-install instead:
|
||||||
brew install ghc cabal-install
|
brew install ghc cabal-install
|
||||||
@ -75,10 +75,10 @@ module Homebrew
|
|||||||
You can install with Homebrew-Cask:
|
You can install with Homebrew-Cask:
|
||||||
brew cask install haskell-platform
|
brew cask install haskell-platform
|
||||||
EOS
|
EOS
|
||||||
when "mysqldump-secure" then <<-EOS.undent
|
when "mysqldump-secure" then <<~EOS
|
||||||
The creator of mysqldump-secure tried to game our popularity metrics.
|
The creator of mysqldump-secure tried to game our popularity metrics.
|
||||||
EOS
|
EOS
|
||||||
when "ngrok" then <<-EOS.undent
|
when "ngrok" then <<~EOS
|
||||||
Upstream sunsetted 1.x in March 2016 and 2.x is not open-source.
|
Upstream sunsetted 1.x in March 2016 and 2.x is not open-source.
|
||||||
|
|
||||||
If you wish to use the 2.x release you can install with Homebrew-Cask:
|
If you wish to use the 2.x release you can install with Homebrew-Cask:
|
||||||
@ -98,12 +98,12 @@ module Homebrew
|
|||||||
new_tap_user, new_tap_repo, = new_tap.split("/")
|
new_tap_user, new_tap_repo, = new_tap.split("/")
|
||||||
new_tap_name = "#{new_tap_user}/#{new_tap_repo}"
|
new_tap_name = "#{new_tap_user}/#{new_tap_repo}"
|
||||||
|
|
||||||
message = <<-EOS.undent
|
message = <<~EOS
|
||||||
It was migrated from #{old_tap} to #{new_tap}.
|
It was migrated from #{old_tap} to #{new_tap}.
|
||||||
EOS
|
EOS
|
||||||
break if new_tap_name == CoreTap.instance.name
|
break if new_tap_name == CoreTap.instance.name
|
||||||
|
|
||||||
message += <<-EOS.undent
|
message += <<~EOS
|
||||||
You can access it again by running:
|
You can access it again by running:
|
||||||
brew tap #{new_tap_name}
|
brew tap #{new_tap_name}
|
||||||
EOS
|
EOS
|
||||||
@ -124,7 +124,7 @@ module Homebrew
|
|||||||
unless silent
|
unless silent
|
||||||
ohai "Searching for a previously deleted formula..."
|
ohai "Searching for a previously deleted formula..."
|
||||||
if (tap.path/".git/shallow").exist?
|
if (tap.path/".git/shallow").exist?
|
||||||
opoo <<-EOS.undent
|
opoo <<~EOS
|
||||||
#{tap} is shallow clone. To get complete history run:
|
#{tap} is shallow clone. To get complete history run:
|
||||||
git -C "$(brew --repo #{tap})" fetch --unshallow
|
git -C "$(brew --repo #{tap})" fetch --unshallow
|
||||||
|
|
||||||
@ -147,7 +147,7 @@ module Homebrew
|
|||||||
commit_message.sub!(/ \(#(\d+)\)$/, " (#{tap.issues_url}/\\1)")
|
commit_message.sub!(/ \(#(\d+)\)$/, " (#{tap.issues_url}/\\1)")
|
||||||
commit_message.gsub!(/(Closes|Fixes) #(\d+)/, "\\1 #{tap.issues_url}/\\2")
|
commit_message.gsub!(/(Closes|Fixes) #(\d+)/, "\\1 #{tap.issues_url}/\\2")
|
||||||
|
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
#{name} was deleted from #{tap.name} in commit #{short_hash}:
|
#{name} was deleted from #{tap.name} in commit #{short_hash}:
|
||||||
#{commit_message}
|
#{commit_message}
|
||||||
|
|
||||||
|
|||||||
@ -201,6 +201,7 @@ module OS
|
|||||||
"8.3.2" => { clang: "8.1", clang_build: 802 },
|
"8.3.2" => { clang: "8.1", clang_build: 802 },
|
||||||
"8.3.3" => { clang: "8.1", clang_build: 802 },
|
"8.3.3" => { clang: "8.1", clang_build: 802 },
|
||||||
"9.0" => { clang: "9.0", clang_build: 900 },
|
"9.0" => { clang: "9.0", clang_build: 900 },
|
||||||
|
"9.0.1" => { clang: "9.0", clang_build: 900 },
|
||||||
}.freeze
|
}.freeze
|
||||||
|
|
||||||
def compilers_standard?
|
def compilers_standard?
|
||||||
@ -208,7 +209,7 @@ module OS
|
|||||||
send(:"#{method}_version") == build
|
send(:"#{method}_version") == build
|
||||||
end
|
end
|
||||||
rescue IndexError
|
rescue IndexError
|
||||||
onoe <<-EOS.undent
|
onoe <<~EOS
|
||||||
Homebrew doesn't know what compiler versions ship with your version
|
Homebrew doesn't know what compiler versions ship with your version
|
||||||
of Xcode (#{Xcode.version}). Please `brew update` and if that doesn't
|
of Xcode (#{Xcode.version}). Please `brew update` and if that doesn't
|
||||||
help, file an issue with the output of `brew --config`:
|
help, file an issue with the output of `brew --config`:
|
||||||
|
|||||||
@ -5,7 +5,7 @@ class Keg
|
|||||||
puts "Changing dylib ID of #{file}\n from #{file.dylib_id}\n to #{id}" if ARGV.debug?
|
puts "Changing dylib ID of #{file}\n from #{file.dylib_id}\n to #{id}" if ARGV.debug?
|
||||||
MachO::Tools.change_dylib_id(file, id, strict: false)
|
MachO::Tools.change_dylib_id(file, id, strict: false)
|
||||||
rescue MachO::MachOError
|
rescue MachO::MachOError
|
||||||
onoe <<-EOS.undent
|
onoe <<~EOS
|
||||||
Failed changing dylib ID of #{file}
|
Failed changing dylib ID of #{file}
|
||||||
from #{file.dylib_id}
|
from #{file.dylib_id}
|
||||||
to #{id}
|
to #{id}
|
||||||
@ -19,7 +19,7 @@ class Keg
|
|||||||
puts "Changing install name in #{file}\n from #{old}\n to #{new}" if ARGV.debug?
|
puts "Changing install name in #{file}\n from #{old}\n to #{new}" if ARGV.debug?
|
||||||
MachO::Tools.change_install_name(file, old, new, strict: false)
|
MachO::Tools.change_install_name(file, old, new, strict: false)
|
||||||
rescue MachO::MachOError
|
rescue MachO::MachOError
|
||||||
onoe <<-EOS.undent
|
onoe <<~EOS
|
||||||
Failed changing install name in #{file}
|
Failed changing install name in #{file}
|
||||||
from #{old}
|
from #{old}
|
||||||
to #{new}
|
to #{new}
|
||||||
|
|||||||
@ -17,13 +17,13 @@ module OS
|
|||||||
when "10.9" then "6.2"
|
when "10.9" then "6.2"
|
||||||
when "10.10" then "7.2.1"
|
when "10.10" then "7.2.1"
|
||||||
when "10.11" then "8.2.1"
|
when "10.11" then "8.2.1"
|
||||||
when "10.12" then "8.3.3"
|
when "10.12" then "9.0.1"
|
||||||
when "10.13" then "9.0"
|
when "10.13" then "9.0.1"
|
||||||
else
|
else
|
||||||
raise "macOS '#{MacOS.version}' is invalid" unless OS::Mac.prerelease?
|
raise "macOS '#{MacOS.version}' is invalid" unless OS::Mac.prerelease?
|
||||||
|
|
||||||
# Default to newest known version of Xcode for unreleased macOS versions.
|
# Default to newest known version of Xcode for unreleased macOS versions.
|
||||||
"9.0"
|
"9.0.1"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -86,11 +86,11 @@ module OS
|
|||||||
|
|
||||||
def update_instructions
|
def update_instructions
|
||||||
if MacOS.version >= "10.9" && !OS::Mac.prerelease?
|
if MacOS.version >= "10.9" && !OS::Mac.prerelease?
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Xcode can be updated from the App Store.
|
Xcode can be updated from the App Store.
|
||||||
EOS
|
EOS
|
||||||
else
|
else
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Xcode can be updated from
|
Xcode can be updated from
|
||||||
https://developer.apple.com/download/more/
|
https://developer.apple.com/download/more/
|
||||||
EOS
|
EOS
|
||||||
@ -199,11 +199,11 @@ module OS
|
|||||||
|
|
||||||
def update_instructions
|
def update_instructions
|
||||||
if MacOS.version >= "10.9"
|
if MacOS.version >= "10.9"
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
Update them from Software Update in the App Store.
|
Update them from Software Update in the App Store.
|
||||||
EOS
|
EOS
|
||||||
elsif MacOS.version == "10.8" || MacOS.version == "10.7"
|
elsif MacOS.version == "10.8" || MacOS.version == "10.7"
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
The standalone package can be obtained from
|
The standalone package can be obtained from
|
||||||
https://developer.apple.com/download/more/
|
https://developer.apple.com/download/more/
|
||||||
or it can be installed via Xcode's preferences.
|
or it can be installed via Xcode's preferences.
|
||||||
@ -216,8 +216,8 @@ module OS
|
|||||||
# on the older supported platform for that Xcode release, i.e there's no
|
# on the older supported platform for that Xcode release, i.e there's no
|
||||||
# CLT package for 10.11 that contains the Clang version from Xcode 8.
|
# CLT package for 10.11 that contains the Clang version from Xcode 8.
|
||||||
case MacOS.version
|
case MacOS.version
|
||||||
when "10.13" then "900.0.37"
|
when "10.13" then "900.0.38"
|
||||||
when "10.12" then "802.0.42"
|
when "10.12" then "900.0.38"
|
||||||
when "10.11" then "800.0.42.1"
|
when "10.11" then "800.0.42.1"
|
||||||
when "10.10" then "700.1.81"
|
when "10.10" then "700.1.81"
|
||||||
when "10.9" then "600.0.57"
|
when "10.9" then "600.0.57"
|
||||||
|
|||||||
@ -139,7 +139,7 @@ class ExternalPatch
|
|||||||
if patch_files.empty?
|
if patch_files.empty?
|
||||||
children = patch_dir.children
|
children = patch_dir.children
|
||||||
if children.length != 1 || !children.first.file?
|
if children.length != 1 || !children.first.file?
|
||||||
raise MissingApplyError, <<-EOS.undent
|
raise MissingApplyError, <<~EOS
|
||||||
There should be exactly one patch file in the staging directory unless
|
There should be exactly one patch file in the staging directory unless
|
||||||
the "apply" method was used one or more times in the patch-do block.
|
the "apply" method was used one or more times in the patch-do block.
|
||||||
EOS
|
EOS
|
||||||
|
|||||||
@ -35,18 +35,16 @@ class Requirement
|
|||||||
_, _, class_name = self.class.to_s.rpartition "::"
|
_, _, class_name = self.class.to_s.rpartition "::"
|
||||||
s = "#{class_name} unsatisfied!\n"
|
s = "#{class_name} unsatisfied!\n"
|
||||||
if cask
|
if cask
|
||||||
s += <<-EOS.undent
|
s += <<~EOS
|
||||||
|
|
||||||
You can install with Homebrew-Cask:
|
You can install with Homebrew-Cask:
|
||||||
brew cask install #{cask}
|
brew cask install #{cask}
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
if download
|
if download
|
||||||
s += <<-EOS.undent
|
s += <<~EOS
|
||||||
|
|
||||||
You can download from:
|
You can download from:
|
||||||
#{download}
|
#{download}
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
s
|
s
|
||||||
|
|||||||
@ -2,7 +2,8 @@ require "requirement"
|
|||||||
require "requirements/fortran_requirement"
|
require "requirements/fortran_requirement"
|
||||||
require "requirements/gpg2_requirement"
|
require "requirements/gpg2_requirement"
|
||||||
require "requirements/language_module_requirement"
|
require "requirements/language_module_requirement"
|
||||||
require "requirements/minimum_macos_requirement"
|
require "requirements/linux_requirement"
|
||||||
|
require "requirements/macos_requirement"
|
||||||
require "requirements/maximum_macos_requirement"
|
require "requirements/maximum_macos_requirement"
|
||||||
require "requirements/mpi_requirement"
|
require "requirements/mpi_requirement"
|
||||||
require "requirements/osxfuse_requirement"
|
require "requirements/osxfuse_requirement"
|
||||||
@ -33,16 +34,16 @@ class XcodeRequirement < Requirement
|
|||||||
|
|
||||||
def message
|
def message
|
||||||
version = " #{@version}" if @version
|
version = " #{@version}" if @version
|
||||||
message = <<-EOS.undent
|
message = <<~EOS
|
||||||
A full installation of Xcode.app#{version} is required to compile this software.
|
A full installation of Xcode.app#{version} is required to compile this software.
|
||||||
Installing just the Command Line Tools is not sufficient.
|
Installing just the Command Line Tools is not sufficient.
|
||||||
EOS
|
EOS
|
||||||
if MacOS.version >= :lion
|
if MacOS.version >= :lion
|
||||||
message + <<-EOS.undent
|
message + <<~EOS
|
||||||
Xcode can be installed from the App Store.
|
Xcode can be installed from the App Store.
|
||||||
EOS
|
EOS
|
||||||
else
|
else
|
||||||
message + <<-EOS.undent
|
message + <<~EOS
|
||||||
Xcode can be installed from #{Formatter.url("https://developer.apple.com/download/more/")}.
|
Xcode can be installed from #{Formatter.url("https://developer.apple.com/download/more/")}.
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
@ -82,7 +83,7 @@ class TeXRequirement < Requirement
|
|||||||
satisfy { which("tex") || which("latex") }
|
satisfy { which("tex") || which("latex") }
|
||||||
|
|
||||||
def message
|
def message
|
||||||
s = <<-EOS.undent
|
s = <<~EOS
|
||||||
A LaTeX distribution is required for Homebrew to install this formula.
|
A LaTeX distribution is required for Homebrew to install this formula.
|
||||||
|
|
||||||
Make sure that "/usr/texbin", or the location you installed it to, is in
|
Make sure that "/usr/texbin", or the location you installed it to, is in
|
||||||
|
|||||||
@ -11,7 +11,7 @@ class JavaRequirement < Requirement
|
|||||||
end
|
end
|
||||||
|
|
||||||
def initialize(tags)
|
def initialize(tags)
|
||||||
@version = tags.shift if /(\d\.)+\d/ =~ tags.first
|
@version = tags.shift if /(\d+\.)+\d/ =~ tags.first
|
||||||
super
|
super
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -103,7 +103,7 @@ class JavaRequirement < Requirement
|
|||||||
end
|
end
|
||||||
|
|
||||||
def satisfies_version(java)
|
def satisfies_version(java)
|
||||||
java_version_s = Utils.popen_read("#{java} -version 2>&1")[/1.\d/]
|
java_version_s = Utils.popen_read("#{java} -version 2>&1")[/\d+.\d/]
|
||||||
return false unless java_version_s
|
return false unless java_version_s
|
||||||
java_version = Version.create(java_version_s)
|
java_version = Version.create(java_version_s)
|
||||||
needed_version = Version.create(version_without_plus)
|
needed_version = Version.create(version_without_plus)
|
||||||
|
|||||||
@ -13,16 +13,15 @@ class LanguageModuleRequirement < Requirement
|
|||||||
satisfy(build_env: false) { quiet_system(*the_test) }
|
satisfy(build_env: false) { quiet_system(*the_test) }
|
||||||
|
|
||||||
def message
|
def message
|
||||||
s = <<-EOS.undent
|
s = <<~EOS
|
||||||
Unsatisfied dependency: #{@module_name}
|
Unsatisfied dependency: #{@module_name}
|
||||||
Homebrew does not provide special #{@language.to_s.capitalize} dependencies; install with:
|
Homebrew does not provide special #{@language.to_s.capitalize} dependencies; install with:
|
||||||
`#{command_line} #{@module_name}`
|
`#{command_line} #{@module_name}`
|
||||||
EOS
|
EOS
|
||||||
|
|
||||||
unless [:python, :perl, :ruby].include? @language
|
unless [:python, :perl, :ruby].include? @language
|
||||||
s += <<-EOS.undent
|
s += <<~EOS
|
||||||
|
You may need to: `brew install #{@language}`
|
||||||
You may need to: `brew install #{@language}`
|
|
||||||
|
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|||||||
9
Library/Homebrew/requirements/linux_requirement.rb
Normal file
9
Library/Homebrew/requirements/linux_requirement.rb
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
class LinuxRequirement < Requirement
|
||||||
|
fatal true
|
||||||
|
|
||||||
|
satisfy(build_env: false) { OS.linux? }
|
||||||
|
|
||||||
|
def message
|
||||||
|
"Linux is required."
|
||||||
|
end
|
||||||
|
end
|
||||||
31
Library/Homebrew/requirements/macos_requirement.rb
Normal file
31
Library/Homebrew/requirements/macos_requirement.rb
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
require "requirement"
|
||||||
|
|
||||||
|
class MacOSRequirement < Requirement
|
||||||
|
fatal true
|
||||||
|
|
||||||
|
def initialize(tags = [])
|
||||||
|
@version = MacOS::Version.from_symbol(tags.first) unless tags.empty?
|
||||||
|
super
|
||||||
|
end
|
||||||
|
|
||||||
|
def minimum_version_specified?
|
||||||
|
OS.mac? && @version
|
||||||
|
end
|
||||||
|
|
||||||
|
satisfy(build_env: false) do
|
||||||
|
next MacOS.version >= @version if minimum_version_specified?
|
||||||
|
next true if OS.mac?
|
||||||
|
next true if @version
|
||||||
|
false
|
||||||
|
end
|
||||||
|
|
||||||
|
def message
|
||||||
|
return "macOS is required." unless minimum_version_specified?
|
||||||
|
"macOS #{@version.pretty_name} or newer is required."
|
||||||
|
end
|
||||||
|
|
||||||
|
def display_s
|
||||||
|
return "macOS is required" unless minimum_version_specified?
|
||||||
|
"macOS >= #{@version}"
|
||||||
|
end
|
||||||
|
end
|
||||||
@ -11,7 +11,7 @@ class MaximumMacOSRequirement < Requirement
|
|||||||
satisfy(build_env: false) { MacOS.version <= @version }
|
satisfy(build_env: false) { MacOS.version <= @version }
|
||||||
|
|
||||||
def message
|
def message
|
||||||
<<-EOS.undent
|
<<~EOS
|
||||||
This formula either does not compile or function as expected on macOS
|
This formula either does not compile or function as expected on macOS
|
||||||
versions newer than #{@version.pretty_name} due to an upstream incompatibility.
|
versions newer than #{@version.pretty_name} due to an upstream incompatibility.
|
||||||
EOS
|
EOS
|
||||||
|
|||||||
@ -1,20 +0,0 @@
|
|||||||
require "requirement"
|
|
||||||
|
|
||||||
class MinimumMacOSRequirement < Requirement
|
|
||||||
fatal true
|
|
||||||
|
|
||||||
def initialize(tags)
|
|
||||||
@version = MacOS::Version.from_symbol(tags.first)
|
|
||||||
super
|
|
||||||
end
|
|
||||||
|
|
||||||
satisfy(build_env: false) { MacOS.version >= @version }
|
|
||||||
|
|
||||||
def message
|
|
||||||
"macOS #{@version.pretty_name} or newer is required."
|
|
||||||
end
|
|
||||||
|
|
||||||
def display_s
|
|
||||||
"macOS >= #{@version}"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@ -6,7 +6,7 @@ class UnsignedKextRequirement < Requirement
|
|||||||
satisfy(build_env: false) { MacOS.version < :yosemite }
|
satisfy(build_env: false) { MacOS.version < :yosemite }
|
||||||
|
|
||||||
def message
|
def message
|
||||||
s = <<-EOS.undent
|
s = <<~EOS
|
||||||
Building this formula from source isn't possible due to OS X
|
Building this formula from source isn't possible due to OS X
|
||||||
Yosemite (10.10) and above's strict unsigned kext ban.
|
Yosemite (10.10) and above's strict unsigned kext ban.
|
||||||
EOS
|
EOS
|
||||||
|
|||||||
@ -6,7 +6,7 @@ module RuboCop
|
|||||||
module FormulaAudit
|
module FormulaAudit
|
||||||
# This cop audits versioned Formulae for `conflicts_with`
|
# This cop audits versioned Formulae for `conflicts_with`
|
||||||
class Conflicts < FormulaCop
|
class Conflicts < FormulaCop
|
||||||
MSG = <<-EOS.undent
|
MSG = <<~EOS.freeze
|
||||||
Versioned formulae should not use `conflicts_with`.
|
Versioned formulae should not use `conflicts_with`.
|
||||||
Use `keg_only :versioned_formula` instead.
|
Use `keg_only :versioned_formula` instead.
|
||||||
EOS
|
EOS
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user