diff options
| author | Gautham Goli | 2017-10-21 13:26:25 +0530 |
|---|---|---|
| committer | Gautham Goli | 2017-10-21 13:53:44 +0530 |
| commit | 7b2fab8ec5d8e93878d56d31879e8a05e4ab59bc (patch) | |
| tree | 43b6425f24829fadc8d1ea4bf938d6228cc6ef3b /Library/Homebrew/cmd | |
| parent | ee35d6586791be65b9cfbb976394c9191625aaee (diff) | |
| parent | a08f1c674803824e291c326adc2aca80068020e6 (diff) | |
| download | brew-7b2fab8ec5d8e93878d56d31879e8a05e4ab59bc.tar.bz2 | |
Merge branch 'master' into audit_line_rubocop_part_4_rebase_attempt_1
Diffstat (limited to 'Library/Homebrew/cmd')
26 files changed, 85 insertions, 91 deletions
diff --git a/Library/Homebrew/cmd/cleanup.rb b/Library/Homebrew/cmd/cleanup.rb index d8f669e85..290b748de 100644 --- a/Library/Homebrew/cmd/cleanup.rb +++ b/Library/Homebrew/cmd/cleanup.rb @@ -38,7 +38,7 @@ module Homebrew end def report_unremovable_kegs - ofail <<-EOS.undent + ofail <<~EOS Could not cleanup old kegs! Fix your permissions on: #{Cleanup.unremovable_kegs.join "\n "} EOS diff --git a/Library/Homebrew/cmd/commands.rb b/Library/Homebrew/cmd/commands.rb index addccd609..0dfc6c451 100644 --- a/Library/Homebrew/cmd/commands.rb +++ b/Library/Homebrew/cmd/commands.rb @@ -16,12 +16,12 @@ module Homebrew else # Find commands in Homebrew/cmd puts "Built-in commands" - puts Formatter.columns(internal_commands) + puts Formatter.columns(internal_commands.sort) # Find commands in Homebrew/dev-cmd puts puts "Built-in developer commands" - puts Formatter.columns(internal_developer_commands) + puts Formatter.columns(internal_developer_commands.sort) # Find commands in the path unless (exts = external_commands).empty? @@ -51,8 +51,8 @@ module Homebrew end def find_internal_commands(directory) - directory.children.each_with_object([]) do |f, cmds| - cmds << f.basename.to_s.sub(/\.(?:rb|sh)$/, "") if f.file? - end + Pathname.glob(directory/"*") + .select(&:file?) + .map { |f| f.basename.to_s.sub(/\.(?:rb|sh)$/, "") } end end diff --git a/Library/Homebrew/cmd/deps.rb b/Library/Homebrew/cmd/deps.rb index de7aa4a51..ae758e143 100644 --- a/Library/Homebrew/cmd/deps.rb +++ b/Library/Homebrew/cmd/deps.rb @@ -68,16 +68,16 @@ module Homebrew if mode.tree? if mode.installed? - puts_deps_tree Formula.installed, !ARGV.one? + puts_deps_tree Formula.installed.sort, !ARGV.one? else raise FormulaUnspecifiedError if ARGV.named.empty? puts_deps_tree ARGV.formulae, !ARGV.one? end elsif mode.all? - puts_deps Formula + puts_deps Formula.sort elsif ARGV.named.empty? raise FormulaUnspecifiedError unless mode.installed? - puts_deps Formula.installed + puts_deps Formula.installed.sort elsif mode.for_each? puts_deps ARGV.formulae else diff --git a/Library/Homebrew/cmd/diy.rb b/Library/Homebrew/cmd/diy.rb index a8f6440df..3980b3d9e 100644 --- a/Library/Homebrew/cmd/diy.rb +++ b/Library/Homebrew/cmd/diy.rb @@ -43,7 +43,7 @@ module Homebrew detected_name = basename[/(.*?)-?#{Regexp.escape(version)}/, 1] || basename 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 of #{canonical_name.inspect}. Consider using the canonical name instead: brew diy --name=#{canonical_name} diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb index cca2dca03..7b1778e63 100644 --- a/Library/Homebrew/cmd/doctor.rb +++ b/Library/Homebrew/cmd/doctor.rb @@ -43,7 +43,7 @@ module Homebrew out = checks.send(method) next if out.nil? || out.empty? 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 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} diff --git a/Library/Homebrew/cmd/gist-logs.rb b/Library/Homebrew/cmd/gist-logs.rb index 012121b08..45537602b 100644 --- a/Library/Homebrew/cmd/gist-logs.rb +++ b/Library/Homebrew/cmd/gist-logs.rb @@ -29,7 +29,7 @@ module Homebrew files["00.config.out"] = { content: s.string } files["00.doctor.out"] = { content: `brew doctor 2>&1` } unless f.core_formula? - tap = <<-EOS.undent + tap = <<~EOS Formula: #{f.name} Tap: #{f.tap} Path: #{f.path} @@ -47,7 +47,7 @@ module Homebrew if ARGV.include?("--new-issue") || ARGV.switch?("n") if GitHub.api_credentials_type == :none - puts <<-EOS.undent + puts <<~EOS You can create a new personal access token: #{GitHub::ALL_SCOPES_URL} and then set the new HOMEBREW_GITHUB_API_TOKEN as the authentication method. @@ -64,7 +64,7 @@ module Homebrew def brief_build_info(f) 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} EOS if ARGV.include?("--with-hostname") diff --git a/Library/Homebrew/cmd/help.rb b/Library/Homebrew/cmd/help.rb index a0c44854b..c85916f9b 100644 --- a/Library/Homebrew/cmd/help.rb +++ b/Library/Homebrew/cmd/help.rb @@ -1,4 +1,4 @@ -HOMEBREW_HELP = <<-EOS.unindent.freeze +HOMEBREW_HELP = <<~EOS.freeze Example usage: brew search [TEXT|/REGEX/] brew (info|home|options) [FORMULA...] diff --git a/Library/Homebrew/cmd/info.rb b/Library/Homebrew/cmd/info.rb index 5eb033706..83bb712ab 100644 --- a/Library/Homebrew/cmd/info.rb +++ b/Library/Homebrew/cmd/info.rb @@ -67,9 +67,9 @@ module Homebrew def print_json ff = if ARGV.include? "--all" - Formula + Formula.sort elsif ARGV.include? "--installed" - Formula.installed + Formula.installed.sort else ARGV.formulae end @@ -128,7 +128,7 @@ module Homebrew "#{c.name}#{reason}" end.sort! unless conflicts.empty? - puts <<-EOS.undent + puts <<~EOS Conflicts with: #{conflicts.join("\n ")} EOS diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index ca8f29477..575dbc4b3 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -110,17 +110,17 @@ module Homebrew ARGV.formulae.each do |f| # head-only without --HEAD is an error if !ARGV.build_head? && f.stable.nil? && f.devel.nil? - raise <<-EOS.undent - #{f.full_name} is a head-only formula - Install with `brew install --HEAD #{f.full_name}` + raise <<~EOS + #{f.full_name} is a head-only formula + Install with `brew install --HEAD #{f.full_name}` EOS end # devel-only without --devel is an error if !ARGV.build_devel? && f.stable.nil? && f.head.nil? - raise <<-EOS.undent - #{f.full_name} is a devel-only formula - Install with `brew install --devel #{f.full_name}` + raise <<~EOS + #{f.full_name} is a devel-only formula + Install with `brew install --devel #{f.full_name}` EOS end @@ -150,12 +150,12 @@ module Homebrew # sure --force flag is passed. if f.outdated? optlinked_version = Keg.for(f.opt_prefix).version - onoe <<-EOS.undent + onoe <<~EOS #{f.full_name} #{optlinked_version} is already installed To upgrade to #{f.version}, run `brew upgrade #{f.name}` EOS else - opoo <<-EOS.undent + opoo <<~EOS #{f.full_name} #{f.pkg_version} is already installed EOS end @@ -173,13 +173,13 @@ module Homebrew msg = "#{f.full_name} #{installed_version} is already installed" linked_not_equals_installed = f.linked_version != installed_version if f.linked? && linked_not_equals_installed - msg = <<-EOS.undent + msg = <<~EOS #{msg} The currently linked version is #{f.linked_version} You can use `brew switch #{f} #{installed_version}` to link this version. EOS elsif !f.linked? || f.keg_only? - msg = <<-EOS.undent + msg = <<~EOS #{msg}, it's just not linked. You can use `brew link #{f}` to link this version. EOS @@ -188,7 +188,7 @@ module Homebrew elsif !f.any_version_installed? && old_formula = f.old_installed_formulae.first msg = "#{old_formula.full_name} #{old_formula.installed_version} already installed" if !old_formula.linked? && !old_formula.keg_only? - msg = <<-EOS.undent + msg = <<~EOS #{msg}, it's just not linked. You can use `brew link #{old_formula.full_name}` to link this version. EOS @@ -197,7 +197,7 @@ module Homebrew elsif f.migration_needed? && !ARGV.force? # Check if the formula we try to install is the same as installed # but not migrated one. If --force passed then install anyway. - opoo <<-EOS.undent + opoo <<~EOS #{f.oldname} already installed, it's just not migrated You can migrate formula with `brew migrate #{f}` Or you can force install it with `brew install #{f} --force` @@ -283,7 +283,7 @@ module Homebrew def check_ppc case Hardware::CPU.type when :ppc - abort <<-EOS.undent + abort <<~EOS Sorry, Homebrew does not support your computer's CPU architecture. For PPC support, see: https://github.com/mistydemeo/tigerbrew EOS @@ -308,7 +308,7 @@ module Homebrew def check_cellar FileUtils.mkdir_p HOMEBREW_CELLAR unless File.exist? HOMEBREW_CELLAR rescue - raise <<-EOS.undent + raise <<~EOS Could not create #{HOMEBREW_CELLAR} Check you have permission to write to #{HOMEBREW_CELLAR.parent} EOS diff --git a/Library/Homebrew/cmd/leaves.rb b/Library/Homebrew/cmd/leaves.rb index 4038aee4c..574ceb64e 100644 --- a/Library/Homebrew/cmd/leaves.rb +++ b/Library/Homebrew/cmd/leaves.rb @@ -9,7 +9,7 @@ module Homebrew module_function def leaves - installed = Formula.installed + installed = Formula.installed.sort deps_of_installed = Set.new installed.each do |f| diff --git a/Library/Homebrew/cmd/link.rb b/Library/Homebrew/cmd/link.rb index 6c4b912e8..5afb19ed6 100644 --- a/Library/Homebrew/cmd/link.rb +++ b/Library/Homebrew/cmd/link.rb @@ -29,7 +29,7 @@ module Homebrew keg_only = keg_only?(keg.rack) if HOMEBREW_PREFIX.to_s == "/usr/local" && keg_only && keg.name.start_with?("openssl", "libressl") - opoo <<-EOS.undent + opoo <<~EOS Refusing to link: #{keg.name} 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}. diff --git a/Library/Homebrew/cmd/linkapps.rb b/Library/Homebrew/cmd/linkapps.rb index 8713b609e..e8d482529 100644 --- a/Library/Homebrew/cmd/linkapps.rb +++ b/Library/Homebrew/cmd/linkapps.rb @@ -19,7 +19,7 @@ module Homebrew module_function def linkapps - opoo <<-EOS.undent + opoo <<~EOS `brew linkapps` has been deprecated and will eventually be removed! Unfortunately `brew linkapps` cannot behave nicely with e.g. Spotlight using diff --git a/Library/Homebrew/cmd/list.rb b/Library/Homebrew/cmd/list.rb index 436fc1f97..f17667286 100644 --- a/Library/Homebrew/cmd/list.rb +++ b/Library/Homebrew/cmd/list.rb @@ -39,7 +39,7 @@ module Homebrew filtered_list elsif ARGV.named.empty? 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? puts Formatter.columns(full_names) else @@ -87,7 +87,7 @@ module Homebrew dirs.delete "etc" 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_PATHS.flat_map { |d| %W[! -path #{d}] } args.concat %w[)] diff --git a/Library/Homebrew/cmd/log.rb b/Library/Homebrew/cmd/log.rb index 9323c762d..898e921ba 100644 --- a/Library/Homebrew/cmd/log.rb +++ b/Library/Homebrew/cmd/log.rb @@ -31,7 +31,7 @@ module Homebrew end if File.exist? "#{repo}/.git/shallow" - opoo <<-EOS.undent + opoo <<~EOS #{name} is a shallow clone so only partial output will be shown. To get a full clone run: git -C "#{git_cd}" fetch --unshallow diff --git a/Library/Homebrew/cmd/missing.rb b/Library/Homebrew/cmd/missing.rb index 8a1dc506d..707ad6834 100644 --- a/Library/Homebrew/cmd/missing.rb +++ b/Library/Homebrew/cmd/missing.rb @@ -16,9 +16,9 @@ module Homebrew return unless HOMEBREW_CELLAR.exist? ff = if ARGV.named.empty? - Formula.installed + Formula.installed.sort else - ARGV.resolved_formulae + ARGV.resolved_formulae.sort end ff.each do |f| diff --git a/Library/Homebrew/cmd/options.rb b/Library/Homebrew/cmd/options.rb index 843d3a1ee..6bb6afafe 100644 --- a/Library/Homebrew/cmd/options.rb +++ b/Library/Homebrew/cmd/options.rb @@ -16,9 +16,9 @@ module Homebrew def options if ARGV.include? "--all" - puts_options Formula.to_a + puts_options Formula.to_a.sort elsif ARGV.include? "--installed" - puts_options Formula.installed + puts_options Formula.installed.sort else raise FormulaUnspecifiedError if ARGV.named.empty? puts_options ARGV.formulae diff --git a/Library/Homebrew/cmd/readall.rb b/Library/Homebrew/cmd/readall.rb index 3591e0c09..9fac52713 100644 --- a/Library/Homebrew/cmd/readall.rb +++ b/Library/Homebrew/cmd/readall.rb @@ -1,6 +1,7 @@ #: @hide_from_man_page #: * `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 #: when making significant changes to `formula.rb`, @@ -13,16 +14,8 @@ module Homebrew def readall if ARGV.include?("--syntax") - ruby_files = [] - scan_files = %W[ - #{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 + scan_files = "#{HOMEBREW_LIBRARY_PATH}/**/*.rb" + ruby_files = Dir.glob(scan_files).reject { |file| file =~ %r{/(vendor|cask)/} } Homebrew.failed = true unless Readall.valid_ruby_syntax?(ruby_files) end @@ -31,7 +24,7 @@ module Homebrew taps = if ARGV.named.empty? Tap else - [Tap.fetch(ARGV.named.first)] + ARGV.named.map { |t| Tap.fetch(t) } end taps.each do |tap| Homebrew.failed = true unless Readall.valid_tap?(tap, options) diff --git a/Library/Homebrew/cmd/search.rb b/Library/Homebrew/cmd/search.rb index c01a11c10..4ba5247f1 100644 --- a/Library/Homebrew/cmd/search.rb +++ b/Library/Homebrew/cmd/search.rb @@ -24,7 +24,7 @@ module Homebrew def search if ARGV.empty? - puts Formatter.columns(Formula.full_names) + puts Formatter.columns(Formula.full_names.sort) elsif ARGV.include? "--macports" exec_browser "https://www.macports.org/ports.php?by=name&substr=#{ARGV.next}" elsif ARGV.include? "--fink" @@ -52,15 +52,15 @@ module Homebrew results = search_taps(name) end - puts Formatter.columns(results) unless results.empty? + puts Formatter.columns(results.sort) unless results.empty? else query = ARGV.first regex = query_regexp(query) 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) - puts Formatter.columns(tap_results) unless tap_results.empty? + puts Formatter.columns(tap_results.sort) unless tap_results.empty? if $stdout.tty? count = local_results.length + tap_results.length @@ -87,7 +87,7 @@ module Homebrew arg.include?(char) && !arg.start_with?("/") end end - ohai <<-EOS.undent + ohai <<~EOS Did you mean to perform a regular expression search? Surround your query with /slashes/ to search locally by regex. EOS diff --git a/Library/Homebrew/cmd/sh.rb b/Library/Homebrew/cmd/sh.rb index 69f329cb3..3fe5f3005 100644 --- a/Library/Homebrew/cmd/sh.rb +++ b/Library/Homebrew/cmd/sh.rb @@ -27,14 +27,14 @@ module Homebrew end ENV["PS1"] = 'brew \[\033[1;32m\]\w\[\033[0m\]$ ' ENV["VERBOSE"] = "1" - puts <<-EOS.undent_________________________________________________________72 - Your shell has been configured to use Homebrew's build environment; - this should help you build stuff. Notably though, the system versions of - gem and pip will ignore our configuration and insist on using the - environment they were built under (mostly). Sadly, scons will also - ignore our configuration. - When done, type `exit'. - EOS + puts <<~EOS + Your shell has been configured to use Homebrew's build environment; + this should help you build stuff. Notably though, the system versions of + gem and pip will ignore our configuration and insist on using the + environment they were built under (mostly). Sadly, scons will also + ignore our configuration. + When done, type `exit'. + EOS $stdout.flush exec ENV["SHELL"] end diff --git a/Library/Homebrew/cmd/tap-info.rb b/Library/Homebrew/cmd/tap-info.rb index cb0e0b387..d01ce8a02 100644 --- a/Library/Homebrew/cmd/tap-info.rb +++ b/Library/Homebrew/cmd/tap-info.rb @@ -21,10 +21,11 @@ module Homebrew module_function def tap_info + # TODO: This still returns a non-alphabetised list on APFS. if ARGV.include? "--installed" taps = Tap else - taps = ARGV.named.map do |name| + taps = ARGV.named.sort.map do |name| Tap.fetch(name) end end diff --git a/Library/Homebrew/cmd/uninstall.rb b/Library/Homebrew/cmd/uninstall.rb index 4839ba1e0..f95b6c7bb 100644 --- a/Library/Homebrew/cmd/uninstall.rb +++ b/Library/Homebrew/cmd/uninstall.rb @@ -131,7 +131,7 @@ module Homebrew class DeveloperDependentsMessage < DependentsMessage def output - opoo <<-EOS.undent + opoo <<~EOS #{list reqs} #{are_required_by_deps}. You can silence this warning with: #{sample_command} @@ -141,7 +141,7 @@ module Homebrew class NondeveloperDependentsMessage < DependentsMessage def output - ofail <<-EOS.undent + ofail <<~EOS Refusing to uninstall #{list reqs} because #{they reqs} #{are_required_by_deps}. You can override this and force removal with: diff --git a/Library/Homebrew/cmd/unlinkapps.rb b/Library/Homebrew/cmd/unlinkapps.rb index 56dba3603..7f401aaeb 100644 --- a/Library/Homebrew/cmd/unlinkapps.rb +++ b/Library/Homebrew/cmd/unlinkapps.rb @@ -20,7 +20,7 @@ module Homebrew module_function def unlinkapps - opoo <<-EOS.undent + opoo <<~EOS `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. diff --git a/Library/Homebrew/cmd/update-report.rb b/Library/Homebrew/cmd/update-report.rb index 0974df0b4..98823a152 100644 --- a/Library/Homebrew/cmd/update-report.rb +++ b/Library/Homebrew/cmd/update-report.rb @@ -33,7 +33,7 @@ module Homebrew # Use an extra newline and bold to avoid this being missed. 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: #{Formatter.url("https://docs.brew.sh/Analytics.html")}#{Tty.reset} @@ -167,7 +167,7 @@ module Homebrew end if @migration_failed - opoo <<-EOS.undent + opoo <<~EOS Failed to migrate #{legacy_cache} to #{HOMEBREW_CACHE}. Please do so manually. EOS @@ -176,7 +176,7 @@ module Homebrew FileUtils.rm_rf legacy_cache if legacy_cache.exist? FileUtils.touch migration_attempted_file - opoo <<-EOS.undent + opoo <<~EOS Failed to delete #{legacy_cache}. Please do so manually. EOS @@ -191,7 +191,7 @@ module Homebrew ohai "Migrating HOMEBREW_REPOSITORY (please wait)..." unless HOMEBREW_PREFIX.writable_real? - ofail <<-EOS.undent + ofail <<~EOS #{HOMEBREW_PREFIX} is not writable. 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.rmdir_if_possible if new_homebrew_repository.exist? - ofail <<-EOS.undent + ofail <<~EOS #{new_homebrew_repository} already exists. Please remove it manually or uninstall and reinstall Homebrew into a new location as the migration cannot be done automatically. @@ -258,7 +258,7 @@ module Homebrew end unless unremovable_paths.empty? - ofail <<-EOS.undent + ofail <<~EOS Could not remove old HOMEBREW_REPOSITORY paths! Please do this manually with: sudo rm -rf #{unremovable_paths.join " "} @@ -274,7 +274,7 @@ module Homebrew begin FileUtils.ln_s(src.relative_path_from(dst.parent), dst) rescue Errno::EACCES, Errno::ENOENT - ofail <<-EOS.undent + ofail <<~EOS Could not create symlink at #{dst}! Please do this manually with: sudo ln -sf #{src} #{dst} @@ -285,13 +285,13 @@ module Homebrew link_completions_manpages_and_docs(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 return /usr/local to its default ownership with: sudo chown root:wheel #{HOMEBREW_PREFIX} EOS rescue => e - ofail <<-EOS.undent + ofail <<~EOS #{Tty.bold}Failed to migrate HOMEBREW_REPOSITORY to #{new_homebrew_repository}!#{Tty.reset} The error was: #{e} @@ -309,7 +309,7 @@ module Homebrew Utils::Link.link_manpages(repository, command) Utils::Link.link_docs(repository, command) rescue => e - ofail <<-EOS.undent + ofail <<~EOS Failed to link all completions, docs and manpages: #{e} EOS @@ -449,7 +449,7 @@ class Reporter next unless (HOMEBREW_PREFIX/"Caskroom"/new_name).exist? new_tap = Tap.fetch(new_tap_name) 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: brew cask uninstall --force #{name} EOS @@ -480,14 +480,14 @@ class Reporter system HOMEBREW_BREW_FILE, "prune" ohai "brew cask install #{new_name}" system HOMEBREW_BREW_FILE, "cask", "install", new_name - ohai <<-EOS.undent + ohai <<~EOS #{name} has been moved to Homebrew-Cask. The existing keg has been unlinked. Please uninstall the formula when convenient by running: brew uninstall --force #{name} EOS 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: brew uninstall --force #{name} brew cask install #{new_name} @@ -598,7 +598,7 @@ class ReporterHub return if formulae.empty? # Dump formula list. ohai title - puts Formatter.columns(formulae) + puts Formatter.columns(formulae.sort) end def installed?(formula) diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb index f1ce3c7da..de886ff3d 100644 --- a/Library/Homebrew/cmd/upgrade.rb +++ b/Library/Homebrew/cmd/upgrade.rb @@ -26,7 +26,7 @@ module Homebrew Homebrew.perform_preinstall_checks if ARGV.include?("--all") - opoo <<-EOS.undent + opoo <<~EOS We decided to not change the behaviour of `brew upgrade` so `brew upgrade --all` is equivalent to `brew upgrade` without any other arguments (so the `--all` is a no-op and can be removed). diff --git a/Library/Homebrew/cmd/uses.rb b/Library/Homebrew/cmd/uses.rb index 0b09e1bf1..1688899f9 100644 --- a/Library/Homebrew/cmd/uses.rb +++ b/Library/Homebrew/cmd/uses.rb @@ -125,7 +125,7 @@ module Homebrew end 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 end end diff --git a/Library/Homebrew/cmd/vendor-install.sh b/Library/Homebrew/cmd/vendor-install.sh index 6d16a297d..15caca8ef 100644 --- a/Library/Homebrew/cmd/vendor-install.sh +++ b/Library/Homebrew/cmd/vendor-install.sh @@ -21,8 +21,8 @@ then fi elif [[ -n "$HOMEBREW_LINUX" ]] then - ruby_URL="https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.x86_64_linux.bottle.tar.gz" - ruby_SHA="543c18bd33a300e6c16671437b1e0f17b03bb64e6a485fc15ff7de1eb1a0bc2a" + ruby_URL="https://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.x86_64_linux.bottle.1.tar.gz" + ruby_SHA="33643b1ca6f860d6df01686636326785763e5e81cf0cef37d8a7ab96a6ca1fa1" fi fetch() { @@ -81,9 +81,9 @@ fetch() { trap - SIGINT fi - if [[ -x "$(which shasum)" ]] + if [[ -x "/usr/bin/shasum" ]] 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)" ]] then sha="$(sha256sum "$CACHED_LOCATION" | cut -d' ' -f1)" |
