language stringclasses 1
value | owner stringlengths 2 15 | repo stringlengths 2 21 | sha stringlengths 45 45 | message stringlengths 7 36.3k | path stringlengths 1 199 | patch stringlengths 15 102k | is_multipart bool 2
classes |
|---|---|---|---|---|---|---|---|
Other | Homebrew | brew | 11c5f8f05ad01439aefcbf518816f6833a1a043d.json | Improve discovery of some environment variables
There's a few bits of functionality that Homebrew has changed over the
years, makes sense as a sensible default but some people find really
annoying:
- automatically running `brew update`
- automatically running `brew cleanup`
- automatically upgrading outdated dependents
- automatically reinstalling broken dependents
For each of these: let's improve the documentation of the commands
whose behaviour is changed and the environment variables themselves. | Library/Homebrew/cmd/upgrade.rb | @@ -23,6 +23,9 @@ def upgrade_args
installed with, plus any appended brew formula options. If <cask> or <formula> are specified,
upgrade only the given <cask> or <formula> kegs (unless they are pinned; see `pin`, `unpin`).
+ Unless `HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK` is set, `brew upgrade` or `brew reinstall` will be run for
+ outdated dependents and dependents with broken linkage, respectively.
+
Unless `HOMEBREW_NO_INSTALL_CLEANUP` is set, `brew cleanup` will then be run for the
upgraded formulae or, every 30 days, for all formulae.
EOS | true |
Other | Homebrew | brew | 11c5f8f05ad01439aefcbf518816f6833a1a043d.json | Improve discovery of some environment variables
There's a few bits of functionality that Homebrew has changed over the
years, makes sense as a sensible default but some people find really
annoying:
- automatically running `brew update`
- automatically running `brew cleanup`
- automatically upgrading outdated dependents
- automatically reinstalling broken dependents
For each of these: let's improve the documentation of the commands
whose behaviour is changed and the environment variables themselves. | Library/Homebrew/dev-cmd/pr-pull.rb | @@ -301,7 +301,7 @@ def formulae_need_bottles?(tap, original_commit, user, repo, pr, args:)
def changed_formulae(tap, original_commit)
if Homebrew::EnvConfig.disable_load_formula?
- opoo "Can't check if updated bottles are necessary as formula loading is disabled!"
+ opoo "Can't check if updated bottles are necessary as HOMEBREW_DISABLE_LOAD_FORMULA is set!"
return
end
| true |
Other | Homebrew | brew | 11c5f8f05ad01439aefcbf518816f6833a1a043d.json | Improve discovery of some environment variables
There's a few bits of functionality that Homebrew has changed over the
years, makes sense as a sensible default but some people find really
annoying:
- automatically running `brew update`
- automatically running `brew cleanup`
- automatically upgrading outdated dependents
- automatically reinstalling broken dependents
For each of these: let's improve the documentation of the commands
whose behaviour is changed and the environment variables themselves. | Library/Homebrew/download_strategy.rb | @@ -520,7 +520,7 @@ def _fetch(url:, resolved_url:, timeout:)
if Homebrew::EnvConfig.no_insecure_redirect? &&
url.start_with?("https://") && !resolved_url.start_with?("https://")
- $stderr.puts "HTTPS to HTTP redirect detected & HOMEBREW_NO_INSECURE_REDIRECT is set."
+ $stderr.puts "HTTPS to HTTP redirect detected and HOMEBREW_NO_INSECURE_REDIRECT is set."
raise CurlDownloadStrategyError, url
end
@@ -1029,6 +1029,7 @@ def initialize(url, name, version, **meta)
end
def github_last_commit
+ # TODO: move to Utils::GitHub
return if Homebrew::EnvConfig.no_github_api?
output, _, status = curl_output(
@@ -1045,6 +1046,7 @@ def github_last_commit
end
def multiple_short_commits_exist?(commit)
+ # TODO: move to Utils::GitHub
return if Homebrew::EnvConfig.no_github_api?
output, _, status = curl_output( | true |
Other | Homebrew | brew | 11c5f8f05ad01439aefcbf518816f6833a1a043d.json | Improve discovery of some environment variables
There's a few bits of functionality that Homebrew has changed over the
years, makes sense as a sensible default but some people find really
annoying:
- automatically running `brew update`
- automatically running `brew cleanup`
- automatically upgrading outdated dependents
- automatically reinstalling broken dependents
For each of these: let's improve the documentation of the commands
whose behaviour is changed and the environment variables themselves. | Library/Homebrew/env_config.rb | @@ -26,7 +26,9 @@ module EnvConfig
"`http://localhost:8080/example.com/foo.tar.gz`.",
},
HOMEBREW_AUTO_UPDATE_SECS: {
- description: "Automatically check for updates once per this seconds interval.",
+ description: "Run `brew update` once every `HOMEBREW_AUTO_UPDATE_SECS` seconds before some commands, " \
+ "e.g. `brew install`, `brew upgrade` and `brew tap`. Alternatively, " \
+ "disable auto-update entirely with HOMEBREW_NO_AUTO_UPDATE.",
default: 300,
},
HOMEBREW_BAT: {
@@ -221,17 +223,20 @@ module EnvConfig
boolean: true,
},
HOMEBREW_NO_AUTO_UPDATE: {
- description: "If set, do not automatically update before running some commands e.g. " \
- "`brew install`, `brew upgrade` and `brew tap`.",
+ description: "If set, do not automatically update before running some commands, e.g. " \
+ "`brew install`, `brew upgrade` and `brew tap`. Alternatively, " \
+ "run this less often by setting HOMEBREW_AUTO_UPDATE_SECS to a value higher than the default.",
boolean: true,
},
HOMEBREW_NO_BOOTSNAP: {
description: "If set, do not use Bootsnap to speed up repeated `brew` calls.",
boolean: true,
},
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: {
- description: "If set, do not check for broken dependents after installing, upgrading or reinstalling " \
- "formulae.",
+ description: "If set, do not check for broken linkage of dependents or outdated dependents after " \
+ "installing, upgrading or reinstalling formulae. This will result in fewer dependents " \
+ " (and their dependencies) being upgraded or reinstalled but may result in more breakage " \
+ "from running `brew install <formula>` or `brew upgrade <formula>`.",
boolean: true,
},
HOMEBREW_NO_CLEANUP_FORMULAE: {
@@ -266,11 +271,13 @@ module EnvConfig
HOMEBREW_NO_INSTALL_CLEANUP: {
description: "If set, `brew install`, `brew upgrade` and `brew reinstall` will never automatically " \
"cleanup installed/upgraded/reinstalled formulae or all formulae every " \
- "`HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS` days.",
+ "`HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS` days. Alternatively, HOMEBREW_NO_CLEANUP_FORMULAE " \
+ "allows specifying specific formulae to not clean up.",
boolean: true,
},
HOMEBREW_NO_INSTALL_UPGRADE: {
- description: "If set, `brew install` will not automatically upgrade installed but outdated formulae",
+ description: "If set, `brew install <formula>` will not upgrade `<formula>` if it is installed but " \
+ "outdated.",
boolean: true,
},
HOMEBREW_PRY: { | true |
Other | Homebrew | brew | 11c5f8f05ad01439aefcbf518816f6833a1a043d.json | Improve discovery of some environment variables
There's a few bits of functionality that Homebrew has changed over the
years, makes sense as a sensible default but some people find really
annoying:
- automatically running `brew update`
- automatically running `brew cleanup`
- automatically upgrading outdated dependents
- automatically reinstalling broken dependents
For each of these: let's improve the documentation of the commands
whose behaviour is changed and the environment variables themselves. | Library/Homebrew/formula_installer.rb | @@ -1302,7 +1302,8 @@ def forbidden_license_check
next unless SPDX.licenses_forbid_installation? dep_f.license, forbidden_licenses
raise CannotInstallFormulaError, <<~EOS
- The installation of #{formula.name} has a dependency on #{dep.name} where all its licenses are forbidden:
+ The installation of #{formula.name} has a dependency on #{dep.name} where all
+ its licenses are forbidden by HOMEBREW_FORBIDDEN_LICENSES:
#{SPDX.license_expression_to_string dep_f.license}.
EOS
end
@@ -1312,7 +1313,8 @@ def forbidden_license_check
return unless SPDX.licenses_forbid_installation? formula.license, forbidden_licenses
raise CannotInstallFormulaError, <<~EOS
- #{formula.name}'s licenses are all forbidden: #{SPDX.license_expression_to_string formula.license}.
+ #{formula.name}'s licenses are all forbidden by HOMEBREW_FORBIDDEN_LICENSES:
+ #{SPDX.license_expression_to_string formula.license}.
EOS
end
end | true |
Other | Homebrew | brew | 11c5f8f05ad01439aefcbf518816f6833a1a043d.json | Improve discovery of some environment variables
There's a few bits of functionality that Homebrew has changed over the
years, makes sense as a sensible default but some people find really
annoying:
- automatically running `brew update`
- automatically running `brew cleanup`
- automatically upgrading outdated dependents
- automatically reinstalling broken dependents
For each of these: let's improve the documentation of the commands
whose behaviour is changed and the environment variables themselves. | Library/Homebrew/install.rb | @@ -125,7 +125,10 @@ def install_formula?(
# dependencies. Therefore before performing other checks we need to be
# sure --force flag is passed.
if f.outdated?
- return true unless Homebrew::EnvConfig.no_install_upgrade?
+ unless Homebrew::EnvConfig.no_install_upgrade?
+ puts "#{f.name} #{f.linked_version} is already installed but outdated (so it will be upgraded)."
+ return true
+ end
optlinked_version = Keg.for(f.opt_prefix).version
onoe <<~EOS
@@ -213,7 +216,7 @@ def install_formula?(
message = "#{f.name} #{f.linked_version} is already installed"
if f.outdated? && !head
unless Homebrew::EnvConfig.no_install_upgrade?
- puts "#{message} but outdated"
+ puts "#{message} but outdated (so it will be upgraded)."
return true
end
| true |
Other | Homebrew | brew | 11c5f8f05ad01439aefcbf518816f6833a1a043d.json | Improve discovery of some environment variables
There's a few bits of functionality that Homebrew has changed over the
years, makes sense as a sensible default but some people find really
annoying:
- automatically running `brew update`
- automatically running `brew cleanup`
- automatically upgrading outdated dependents
- automatically reinstalling broken dependents
For each of these: let's improve the documentation of the commands
whose behaviour is changed and the environment variables themselves. | Library/Homebrew/manpages/brew.1.md.erb | @@ -57,6 +57,8 @@ For the full command list, see the [COMMANDS](#commands) section.
With `--verbose` or `--debug`, many commands print extra debugging information.
Note that these options should only appear after a command.
+Some command behaviour can be customised with environment variables; see the [ENVIRONMENT](#environment) section.
+
### `install` <formula>
Install <formula>. | true |
Other | Homebrew | brew | 11c5f8f05ad01439aefcbf518816f6833a1a043d.json | Improve discovery of some environment variables
There's a few bits of functionality that Homebrew has changed over the
years, makes sense as a sensible default but some people find really
annoying:
- automatically running `brew update`
- automatically running `brew cleanup`
- automatically upgrading outdated dependents
- automatically reinstalling broken dependents
For each of these: let's improve the documentation of the commands
whose behaviour is changed and the environment variables themselves. | Library/Homebrew/upgrade.rb | @@ -318,6 +318,7 @@ def check_installed_dependents(
# Assess the dependents tree again now we've upgraded.
oh1 "Checking for dependents of upgraded formulae..." unless dry_run
+
broken_dependents = check_broken_dependents(installed_formulae)
if broken_dependents.blank?
if dry_run
@@ -354,7 +355,7 @@ def check_installed_dependents(
else
count = reinstallable_broken_dependents.count
plural = "dependent".pluralize(reinstallable_broken_dependents.count)
- ohai "Reinstalling #{count} broken #{plural} from source:"
+ ohai "Reinstalling #{count} #{plural} with broken linkage from source:"
puts reinstallable_broken_dependents.map(&:full_specified_name)
.join(", ")
end | true |
Other | Homebrew | brew | 11c5f8f05ad01439aefcbf518816f6833a1a043d.json | Improve discovery of some environment variables
There's a few bits of functionality that Homebrew has changed over the
years, makes sense as a sensible default but some people find really
annoying:
- automatically running `brew update`
- automatically running `brew cleanup`
- automatically upgrading outdated dependents
- automatically reinstalling broken dependents
For each of these: let's improve the documentation of the commands
whose behaviour is changed and the environment variables themselves. | docs/Manpage.md | @@ -41,6 +41,8 @@ For the full command list, see the [COMMANDS](#commands) section.
With `--verbose` or `--debug`, many commands print extra debugging information.
Note that these options should only appear after a command.
+Some command behaviour can be customised with environment variables; see the [ENVIRONMENT](#environment) section.
+
### `install` *`formula`*
Install *`formula`*.
@@ -301,9 +303,15 @@ If a *`formula`* or *`cask`* is provided, show summary of information about it.
Install a *`formula`* or *`cask`*. Additional options specific to a *`formula`* may be
appended to the command.
+Unless `HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK` is set, `brew upgrade` or `brew reinstall` will be run for
+outdated dependents and dependents with broken linkage, respectively.
+
Unless `HOMEBREW_NO_INSTALL_CLEANUP` is set, `brew cleanup` will then be run for
the installed formulae or, every 30 days, for all formulae.
+Unless `HOMEBREW_NO_INSTALL_UPGRADE` is set, `brew install *`formula`*` will upgrade *`formula`* if it
+is already installed but outdated.
+
* `-d`, `--debug`:
If brewing fails, open an interactive debugging session with access to IRB or a shell inside the temporary build directory.
* `-f`, `--force`:
@@ -507,6 +515,9 @@ all items or checking if any current formulae/casks have Ruby issues.
Uninstall and then reinstall a *`formula`* or *`cask`* using the same options it was
originally installed with, plus any appended options specific to a *`formula`*.
+Unless `HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK` is set, `brew upgrade` or `brew reinstall` will be run for
+outdated dependents and dependents with broken linkage, respectively.
+
Unless `HOMEBREW_NO_INSTALL_CLEANUP` is set, `brew cleanup` will then be run for the
reinstalled formulae or, every 30 days, for all formulae.
@@ -683,6 +694,9 @@ Upgrade outdated casks and outdated, unpinned formulae using the same options th
installed with, plus any appended brew formula options. If *`cask`* or *`formula`* are specified,
upgrade only the given *`cask`* or *`formula`* kegs (unless they are pinned; see `pin`, `unpin`).
+Unless `HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK` is set, `brew upgrade` or `brew reinstall` will be run for
+outdated dependents and dependents with broken linkage, respectively.
+
Unless `HOMEBREW_NO_INSTALL_CLEANUP` is set, `brew cleanup` will then be run for the
upgraded formulae or, every 30 days, for all formulae.
@@ -1898,7 +1912,7 @@ example, run `export HOMEBREW_NO_INSECURE_REDIRECT=1` rather than just
<br>Prefix all download URLs, including those for bottles, with this value. For example, `HOMEBREW_ARTIFACT_DOMAIN=http://localhost:8080` will cause a formula with the URL `https://example.com/foo.tar.gz` to instead download from `http://localhost:8080/example.com/foo.tar.gz`.
- `HOMEBREW_AUTO_UPDATE_SECS`
- <br>Automatically check for updates once per this seconds interval.
+ <br>Run `brew update` once every `HOMEBREW_AUTO_UPDATE_SECS` seconds before some commands, e.g. `brew install`, `brew upgrade` and `brew tap`. Alternatively, disable auto-update entirely with HOMEBREW_NO_AUTO_UPDATE.
*Default:* `300`.
@@ -2057,13 +2071,13 @@ example, run `export HOMEBREW_NO_INSECURE_REDIRECT=1` rather than just
<br>If set, do not send analytics. For more information, see: <https://docs.brew.sh/Analytics>
- `HOMEBREW_NO_AUTO_UPDATE`
- <br>If set, do not automatically update before running some commands e.g. `brew install`, `brew upgrade` and `brew tap`.
+ <br>If set, do not automatically update before running some commands, e.g. `brew install`, `brew upgrade` and `brew tap`. Alternatively, run this less often by setting HOMEBREW_AUTO_UPDATE_SECS to a value higher than the default.
- `HOMEBREW_NO_BOOTSNAP`
<br>If set, do not use Bootsnap to speed up repeated `brew` calls.
- `HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK`
- <br>If set, do not check for broken dependents after installing, upgrading or reinstalling formulae.
+ <br>If set, do not check for broken linkage of dependents or outdated dependents after installing, upgrading or reinstalling formulae. This will result in fewer dependents (and their dependencies) being upgraded or reinstalled but may result in more breakage from running `brew install *`formula`*` or `brew upgrade *`formula`*`.
- `HOMEBREW_NO_CLEANUP_FORMULAE`
<br>A comma-separated list of formulae. Homebrew will refuse to clean up a formula if it appears on this list.
@@ -2090,10 +2104,10 @@ example, run `export HOMEBREW_NO_INSECURE_REDIRECT=1` rather than just
*Note:* While ensuring your downloads are fully secure, this is likely to cause from-source SourceForge, some GNU & GNOME-hosted formulae to fail to download.
- `HOMEBREW_NO_INSTALL_CLEANUP`
- <br>If set, `brew install`, `brew upgrade` and `brew reinstall` will never automatically cleanup installed/upgraded/reinstalled formulae or all formulae every `HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS` days.
+ <br>If set, `brew install`, `brew upgrade` and `brew reinstall` will never automatically cleanup installed/upgraded/reinstalled formulae or all formulae every `HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS` days. Alternatively, HOMEBREW_NO_CLEANUP_FORMULAE allows specifying specific formulae to not clean up.
- `HOMEBREW_NO_INSTALL_UPGRADE`
- <br>If set, `brew install` will not automatically upgrade installed but outdated formulae
+ <br>If set, `brew install *`formula`*` will not upgrade `*`formula`*` if it is installed but outdated.
- `HOMEBREW_PRY`
<br>If set, use Pry for the `brew irb` command. | true |
Other | Homebrew | brew | 11c5f8f05ad01439aefcbf518816f6833a1a043d.json | Improve discovery of some environment variables
There's a few bits of functionality that Homebrew has changed over the
years, makes sense as a sensible default but some people find really
annoying:
- automatically running `brew update`
- automatically running `brew cleanup`
- automatically upgrading outdated dependents
- automatically reinstalling broken dependents
For each of these: let's improve the documentation of the commands
whose behaviour is changed and the environment variables themselves. | manpages/brew.1 | @@ -61,6 +61,9 @@ For the full command list, see the \fICOMMANDS\fR section\.
.P
With \fB\-\-verbose\fR or \fB\-\-debug\fR, many commands print extra debugging information\. Note that these options should only appear after a command\.
.
+.P
+Some command behaviour can be customised with environment variables; see the \fIENVIRONMENT\fR section\.
+.
.SS "\fBinstall\fR \fIformula\fR"
Install \fIformula\fR\.
.
@@ -389,8 +392,14 @@ Treat all named arguments as casks\.
Install a \fIformula\fR or \fIcask\fR\. Additional options specific to a \fIformula\fR may be appended to the command\.
.
.P
+Unless \fBHOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK\fR is set, \fBbrew upgrade\fR or \fBbrew reinstall\fR will be run for outdated dependents and dependents with broken linkage, respectively\.
+.
+.P
Unless \fBHOMEBREW_NO_INSTALL_CLEANUP\fR is set, \fBbrew cleanup\fR will then be run for the installed formulae or, every 30 days, for all formulae\.
.
+.P
+Unless \fBHOMEBREW_NO_INSTALL_UPGRADE\fR is set, \fBbrew install <formula>\fR will upgrade \fIformula\fR if it is already installed but outdated\.
+.
.TP
\fB\-d\fR, \fB\-\-debug\fR
If brewing fails, open an interactive debugging session with access to IRB or a shell inside the temporary build directory\.
@@ -691,6 +700,9 @@ Syntax\-check all of Homebrew\'s Ruby files (if no \fB<tap>\fR is passed)\.
Uninstall and then reinstall a \fIformula\fR or \fIcask\fR using the same options it was originally installed with, plus any appended options specific to a \fIformula\fR\.
.
.P
+Unless \fBHOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK\fR is set, \fBbrew upgrade\fR or \fBbrew reinstall\fR will be run for outdated dependents and dependents with broken linkage, respectively\.
+.
+.P
Unless \fBHOMEBREW_NO_INSTALL_CLEANUP\fR is set, \fBbrew cleanup\fR will then be run for the reinstalled formulae or, every 30 days, for all formulae\.
.
.TP
@@ -933,6 +945,9 @@ Fetch and reset Homebrew and all tap repositories (or any specified \fIrepositor
Upgrade outdated casks and outdated, unpinned formulae using the same options they were originally installed with, plus any appended brew formula options\. If \fIcask\fR or \fIformula\fR are specified, upgrade only the given \fIcask\fR or \fIformula\fR kegs (unless they are pinned; see \fBpin\fR, \fBunpin\fR)\.
.
.P
+Unless \fBHOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK\fR is set, \fBbrew upgrade\fR or \fBbrew reinstall\fR will be run for outdated dependents and dependents with broken linkage, respectively\.
+.
+.P
Unless \fBHOMEBREW_NO_INSTALL_CLEANUP\fR is set, \fBbrew cleanup\fR will then be run for the upgraded formulae or, every 30 days, for all formulae\.
.
.TP
@@ -2684,7 +2699,7 @@ Prefix all download URLs, including those for bottles, with this value\. For exa
\fBHOMEBREW_AUTO_UPDATE_SECS\fR
.
.br
-Automatically check for updates once per this seconds interval\.
+Run \fBbrew update\fR once every \fBHOMEBREW_AUTO_UPDATE_SECS\fR seconds before some commands, e\.g\. \fBbrew install\fR, \fBbrew upgrade\fR and \fBbrew tap\fR\. Alternatively, disable auto\-update entirely with HOMEBREW_NO_AUTO_UPDATE\.
.
.IP
\fIDefault:\fR \fB300\fR\.
@@ -2981,7 +2996,7 @@ If set, do not send analytics\. For more information, see: \fIhttps://docs\.brew
\fBHOMEBREW_NO_AUTO_UPDATE\fR
.
.br
-If set, do not automatically update before running some commands e\.g\. \fBbrew install\fR, \fBbrew upgrade\fR and \fBbrew tap\fR\.
+If set, do not automatically update before running some commands, e\.g\. \fBbrew install\fR, \fBbrew upgrade\fR and \fBbrew tap\fR\. Alternatively, run this less often by setting HOMEBREW_AUTO_UPDATE_SECS to a value higher than the default\.
.
.TP
\fBHOMEBREW_NO_BOOTSNAP\fR
@@ -2993,7 +3008,7 @@ If set, do not use Bootsnap to speed up repeated \fBbrew\fR calls\.
\fBHOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK\fR
.
.br
-If set, do not check for broken dependents after installing, upgrading or reinstalling formulae\.
+If set, do not check for broken linkage of dependents or outdated dependents after installing, upgrading or reinstalling formulae\. This will result in fewer dependents (and their dependencies) being upgraded or reinstalled but may result in more breakage from running \fBbrew install <formula>\fR or \fBbrew upgrade <formula>\fR\.
.
.TP
\fBHOMEBREW_NO_CLEANUP_FORMULAE\fR
@@ -3044,13 +3059,13 @@ If set, forbid redirects from secure HTTPS to insecure HTTP\.
\fBHOMEBREW_NO_INSTALL_CLEANUP\fR
.
.br
-If set, \fBbrew install\fR, \fBbrew upgrade\fR and \fBbrew reinstall\fR will never automatically cleanup installed/upgraded/reinstalled formulae or all formulae every \fBHOMEBREW_CLEANUP_PERIODIC_FULL_DAYS\fR days\.
+If set, \fBbrew install\fR, \fBbrew upgrade\fR and \fBbrew reinstall\fR will never automatically cleanup installed/upgraded/reinstalled formulae or all formulae every \fBHOMEBREW_CLEANUP_PERIODIC_FULL_DAYS\fR days\. Alternatively, HOMEBREW_NO_CLEANUP_FORMULAE allows specifying specific formulae to not clean up\.
.
.TP
\fBHOMEBREW_NO_INSTALL_UPGRADE\fR
.
.br
-If set, \fBbrew install\fR will not automatically upgrade installed but outdated formulae
+If set, \fBbrew install <formula>\fR will not upgrade \fB<formula>\fR if it is installed but outdated\.
.
.TP
\fBHOMEBREW_PRY\fR | true |
Other | Homebrew | brew | 7ab42264885f122f408181494401a4877bfd79dc.json | Update RBI files for bootsnap. | Library/Homebrew/sorbet/rbi/gems/bootsnap@1.9.3.rbi | @@ -1,9 +1,9 @@
+# typed: true
+
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `bootsnap` gem.
# Please instead update this file by running `bin/tapioca gem bootsnap`.
-# typed: true
-
module Bootsnap
extend ::Bootsnap
@@ -62,7 +62,7 @@ class Bootsnap::LoadPathCache::Cache
def initialize(store, path_obj, development_mode: T.unsafe(nil)); end
def absolute_path?(path); end
- def find(feature); end
+ def find(feature, try_extensions: T.unsafe(nil)); end
def load_dir(dir); end
def push_paths(sender, *paths); end
def reinitialize(path_obj = T.unsafe(nil)); end
@@ -75,7 +75,7 @@ class Bootsnap::LoadPathCache::Cache
def maybe_append_extension(f); end
def now; end
def push_paths_locked(*paths); end
- def search_index(f); end
+ def search_index(f, try_extensions: T.unsafe(nil)); end
def stale?; end
def try_ext(f); end
def try_index(f); end | false |
Other | Homebrew | brew | 62a63063bb4cc191acd268ac96fec6b96e9d3888.json | Apply suggestions from code review
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Signed-off-by: XuehaiPan <XuehaiPan@pku.edu.cn> | Library/Homebrew/cmd/update-report.rb | @@ -40,14 +40,14 @@ def update_report_args
end
def update_report
- return update_report_impl if $stdout.tty?
+ return output_update_report if $stdout.tty?
redirect_stdout($stderr) do
- return update_report_impl
+ output_update_report
end
end
- def update_report_impl
+ def output_update_report
args = update_report_args.parse
# Run `brew update` (again) if we've got a linuxbrew-core CoreTap | true |
Other | Homebrew | brew | 62a63063bb4cc191acd268ac96fec6b96e9d3888.json | Apply suggestions from code review
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Signed-off-by: XuehaiPan <XuehaiPan@pku.edu.cn> | Library/Homebrew/style.rb | @@ -277,13 +277,11 @@ def shell_scripts
end
def shellcheck
- # Always use the latest brewed shellcheck
ensure_formula_installed!("shellcheck", latest: true,
reason: "shell style checks").opt_bin/"shellcheck"
end
def shfmt
- # Always use the latest brewed shfmt
ensure_formula_installed!("shfmt", latest: true,
reason: "formatting shell scripts")
HOMEBREW_LIBRARY/"Homebrew/utils/shfmt.sh" | true |
Other | Homebrew | brew | 62a63063bb4cc191acd268ac96fec6b96e9d3888.json | Apply suggestions from code review
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Signed-off-by: XuehaiPan <XuehaiPan@pku.edu.cn> | Library/Homebrew/utils.rb | @@ -438,7 +438,7 @@ def redirect_stdout(file)
# Ensure the given formula is installed
# This is useful for installing a utility formula (e.g. `shellcheck` for `brew style`)
- def ensure_formula_installed!(formula_or_name, latest: false, reason: "",
+ def ensure_formula_installed!(formula_or_name, reason: "", latest: false,
output_to_stderr: true, quiet: false)
if output_to_stderr || quiet
file = if quiet | true |
Other | Homebrew | brew | 9ef52080e37091467b477e3eb79dc9c9fb495591.json | utils: extract common word "for" in `reason` | Library/Homebrew/dev-cmd/bottle.rb | @@ -260,7 +260,7 @@ def setup_tar_and_args!(args)
return default_tar_args
end
- ensure_formula_installed!(gnu_tar, reason: "for bottling")
+ ensure_formula_installed!(gnu_tar, reason: "bottling")
["#{gnu_tar.opt_bin}/gtar", gnutar_args].freeze
end | true |
Other | Homebrew | brew | 9ef52080e37091467b477e3eb79dc9c9fb495591.json | utils: extract common word "for" in `reason` | Library/Homebrew/dev-cmd/bump.rb | @@ -59,7 +59,7 @@ def bump
unless Utils::Curl.curl_supports_tls13?
begin
unless Pathname.new(ENV["HOMEBREW_BREWED_CURL_PATH"]).exist?
- ensure_formula_installed!("curl", reason: "for Repology queries")
+ ensure_formula_installed!("curl", reason: "Repology queries")
end
rescue FormulaUnavailableError
opoo "A `curl` with TLS 1.3 support is required for Repology queries." | true |
Other | Homebrew | brew | 9ef52080e37091467b477e3eb79dc9c9fb495591.json | utils: extract common word "for" in `reason` | Library/Homebrew/dev-cmd/cat.rb | @@ -34,7 +34,7 @@ def cat
ENV["BAT_CONFIG_PATH"] = Homebrew::EnvConfig.bat_config_path
ensure_formula_installed!(
"bat",
- reason: "for displaying <formula>/<cask> source",
+ reason: "displaying <formula>/<cask> source",
# The user might want to capture the output of `brew cat ...`
# Redirect stdout to stderr
output_to_stderr: true, | true |
Other | Homebrew | brew | 9ef52080e37091467b477e3eb79dc9c9fb495591.json | utils: extract common word "for" in `reason` | Library/Homebrew/dev-cmd/tests.rb | @@ -50,7 +50,7 @@ def run_buildpulse
with_env(HOMEBREW_NO_AUTO_UPDATE: "1", HOMEBREW_NO_BOOTSNAP: "1") do
ensure_formula_installed!("buildpulse-test-reporter",
- reason: "for reporting test flakiness")
+ reason: "reporting test flakiness")
end
ENV["BUILDPULSE_ACCESS_KEY_ID"] = ENV["HOMEBREW_BUILDPULSE_ACCESS_KEY_ID"] | true |
Other | Homebrew | brew | 9ef52080e37091467b477e3eb79dc9c9fb495591.json | utils: extract common word "for" in `reason` | Library/Homebrew/github_packages.rb | @@ -48,7 +48,7 @@ def upload_bottles(bottles_hash, keep_old:, dry_run:, warn_on_error:)
raise UsageError, "HOMEBREW_GITHUB_PACKAGES_USER is unset." if user.blank?
raise UsageError, "HOMEBREW_GITHUB_PACKAGES_TOKEN is unset." if token.blank?
- skopeo = ensure_executable!("skopeo", reason: "for upload")
+ skopeo = ensure_executable!("skopeo", reason: "upload")
require "json_schemer"
| true |
Other | Homebrew | brew | 9ef52080e37091467b477e3eb79dc9c9fb495591.json | utils: extract common word "for" in `reason` | Library/Homebrew/style.rb | @@ -279,13 +279,13 @@ def shell_scripts
def shellcheck
# Always use the latest brewed shellcheck
ensure_formula_installed!("shellcheck", latest: true,
- reason: "for shell style checks").opt_bin/"shellcheck"
+ reason: "shell style checks").opt_bin/"shellcheck"
end
def shfmt
# Always use the latest brewed shfmt
ensure_formula_installed!("shfmt", latest: true,
- reason: "to format shell scripts")
+ reason: "formatting shell scripts")
HOMEBREW_LIBRARY/"Homebrew/utils/shfmt.sh"
end
| true |
Other | Homebrew | brew | 9ef52080e37091467b477e3eb79dc9c9fb495591.json | utils: extract common word "for" in `reason` | Library/Homebrew/utils.rb | @@ -461,7 +461,7 @@ def ensure_formula_installed!(formula_or_name, latest: false, reason: "",
Formula[formula_or_name]
end
- reason = " #{reason}" if reason.present? # add a whitespace
+ reason = " for #{reason}" if reason.present?
unless formula.any_version_installed?
ohai "Installing `#{formula.name}`#{reason}..." | true |
Other | Homebrew | brew | 466f29a16a173c2c381541884649f272fcf51357.json | cmd/update-report: redirect stdout to stderr when it is not a TTY | Library/Homebrew/cmd/update-report.rb | @@ -18,7 +18,7 @@ module Homebrew
def update_preinstall_header(args:)
@update_preinstall_header ||= begin
- ohai_stdout_or_stderr "Auto-updated Homebrew!" if args.preinstall?
+ ohai "Auto-updated Homebrew!" if args.preinstall?
true
end
end
@@ -40,12 +40,20 @@ def update_report_args
end
def update_report
+ return update_report_impl if $stdout.tty?
+
+ redirect_stdout($stderr) do
+ return update_report_impl
+ end
+ end
+
+ def update_report_impl
args = update_report_args.parse
# Run `brew update` (again) if we've got a linuxbrew-core CoreTap
if CoreTap.instance.installed? && CoreTap.instance.linuxbrew_core? &&
ENV["HOMEBREW_LINUXBREW_CORE_MIGRATION"].blank?
- ohai_stdout_or_stderr "Re-running `brew update` for linuxbrew-core migration"
+ ohai "Re-running `brew update` for linuxbrew-core migration"
if ENV["HOMEBREW_CORE_DEFAULT_GIT_REMOTE"] != ENV["HOMEBREW_CORE_GIT_REMOTE"]
opoo <<~EOS
@@ -85,8 +93,8 @@ def update_report
print "\a"
# Use an extra newline and bold to avoid this being missed.
- ohai_stdout_or_stderr "Homebrew has enabled anonymous aggregate formula and cask analytics."
- puts_stdout_or_stderr <<~EOS
+ ohai "Homebrew has enabled anonymous aggregate formula and cask analytics."
+ puts <<~EOS
#{Tty.bold}Read the analytics documentation (and how to opt-out) here:
#{Formatter.url("https://docs.brew.sh/Analytics")}#{Tty.reset}
No analytics have been recorded yet (nor will be during this `brew` run).
@@ -98,8 +106,8 @@ def update_report
end
if Settings.read("donationmessage") != "true" && !args.quiet?
- ohai_stdout_or_stderr "Homebrew is run entirely by unpaid volunteers. Please consider donating:"
- puts_stdout_or_stderr " #{Formatter.url("https://github.com/Homebrew/brew#donations")}\n"
+ ohai "Homebrew is run entirely by unpaid volunteers. Please consider donating:"
+ puts " #{Formatter.url("https://github.com/Homebrew/brew#donations")}\n"
# Consider the message possibly missed if not a TTY.
Settings.write "donationmessage", true if $stdout.tty?
@@ -116,8 +124,7 @@ def update_report
if initial_revision != current_revision
update_preinstall_header args: args
- puts_stdout_or_stderr \
- "Updated Homebrew from #{shorten_revision(initial_revision)} to #{shorten_revision(current_revision)}."
+ puts "Updated Homebrew from #{shorten_revision(initial_revision)} to #{shorten_revision(current_revision)}."
updated = true
old_tag = Settings.read "latesttag"
@@ -141,7 +148,7 @@ def update_report
if ENV["HOMEBREW_MIGRATE_LINUXBREW_FORMULAE"].present? && tap.core_tap? &&
Settings.read("linuxbrewmigrated") != "true"
- ohai_stdout_or_stderr "Migrating formulae from linuxbrew-core to homebrew-core"
+ ohai "Migrating formulae from linuxbrew-core to homebrew-core"
LINUXBREW_CORE_MIGRATION_LIST.each do |name|
begin
@@ -175,14 +182,13 @@ def update_report
unless updated_taps.empty?
update_preinstall_header args: args
- puts_stdout_or_stderr \
- "Updated #{updated_taps.count} #{"tap".pluralize(updated_taps.count)} (#{updated_taps.to_sentence})."
+ puts "Updated #{updated_taps.count} #{"tap".pluralize(updated_taps.count)} (#{updated_taps.to_sentence})."
updated = true
end
if updated
if hub.empty?
- puts_stdout_or_stderr "No changes to formulae." unless args.quiet?
+ puts "No changes to formulae." unless args.quiet?
else
hub.dump(updated_formula_report: !args.preinstall?) unless args.quiet?
hub.reporters.each(&:migrate_tap_migration)
@@ -209,18 +215,18 @@ def update_report
msg += "#{Tty.bold}#{outdated_casks}#{Tty.reset} outdated #{"cask".pluralize(outdated_casks)}"
end
if msg.present?
- puts_stdout_or_stderr
- puts_stdout_or_stderr <<~EOS
+ puts
+ puts <<~EOS
You have #{msg} installed.
You can upgrade #{update_pronoun} with #{Tty.bold}brew upgrade#{Tty.reset}
or list #{update_pronoun} with #{Tty.bold}brew outdated#{Tty.reset}.
EOS
end
end
end
- puts_stdout_or_stderr if args.preinstall?
+ puts if args.preinstall?
elsif !args.preinstall? && !ENV["HOMEBREW_UPDATE_FAILED"] && !ENV["HOMEBREW_MIGRATE_LINUXBREW_FORMULAE"]
- puts_stdout_or_stderr "Already up-to-date." unless args.quiet?
+ puts "Already up-to-date." unless args.quiet?
end
Commands.rebuild_commands_completion_list
@@ -242,17 +248,17 @@ def update_report
return if new_repository_version.blank?
- puts_stdout_or_stderr
- ohai_stdout_or_stderr "Homebrew was updated to version #{new_repository_version}"
+ puts
+ ohai "Homebrew was updated to version #{new_repository_version}"
if new_repository_version.split(".").last == "0"
Settings.write "latesttag", new_repository_version
- puts_stdout_or_stderr <<~EOS
+ puts <<~EOS
More detailed release notes are available on the Homebrew Blog:
#{Formatter.url("https://brew.sh/blog/#{new_repository_version}")}
EOS
elsif !args.quiet?
Settings.write "latesttag", new_repository_version
- puts_stdout_or_stderr <<~EOS
+ puts <<~EOS
The changelog can be found at:
#{Formatter.url("https://github.com/Homebrew/brew/releases/tag/#{new_repository_version}")}
EOS
@@ -442,13 +448,13 @@ def migrate_tap_migration
new_tap = Tap.fetch(new_tap_name)
new_tap.install unless new_tap.installed?
- ohai_stdout_or_stderr "#{name} has been moved to Homebrew.", <<~EOS
+ ohai "#{name} has been moved to Homebrew.", <<~EOS
To uninstall the cask, run:
brew uninstall --cask --force #{name}
EOS
next if (HOMEBREW_CELLAR/new_name.split("/").last).directory?
- ohai_stdout_or_stderr "Installing #{new_name}..."
+ ohai "Installing #{new_name}..."
system HOMEBREW_BREW_FILE, "install", new_full_name
begin
unless Formulary.factory(new_full_name).keg_only?
@@ -469,12 +475,12 @@ def migrate_tap_migration
# For formulae migrated to cask: Auto-install cask or provide install instructions.
if new_tap_name.start_with?("homebrew/cask")
if new_tap.installed? && (HOMEBREW_PREFIX/"Caskroom").directory?
- ohai_stdout_or_stderr "#{name} has been moved to Homebrew Cask."
- ohai_stdout_or_stderr "brew unlink #{name}"
+ ohai "#{name} has been moved to Homebrew Cask."
+ ohai "brew unlink #{name}"
system HOMEBREW_BREW_FILE, "unlink", name
- ohai_stdout_or_stderr "brew cleanup"
+ ohai "brew cleanup"
system HOMEBREW_BREW_FILE, "cleanup"
- ohai_stdout_or_stderr "brew install --cask #{new_name}"
+ ohai "brew install --cask #{new_name}"
system HOMEBREW_BREW_FILE, "install", "--cask", new_name
ohai <<~EOS
#{name} has been moved to Homebrew Cask.
@@ -483,7 +489,7 @@ def migrate_tap_migration
brew uninstall --force #{name}
EOS
else
- ohai_stdout_or_stderr "#{name} has been moved to Homebrew Cask.", <<~EOS
+ ohai "#{name} has been moved to Homebrew Cask.", <<~EOS
To uninstall the formula and install the cask, run:
brew uninstall --force #{name}
brew tap #{new_tap_name}
@@ -570,10 +576,7 @@ def dump(updated_formula_report: true)
dump_formula_report :M, "Updated Formulae"
else
updated = select_formula(:M).count
- if updated.positive?
- ohai_stdout_or_stderr "Updated Formulae",
- "Updated #{updated} #{"formula".pluralize(updated)}."
- end
+ ohai "Updated Formulae", "Updated #{updated} #{"formula".pluralize(updated)}." if updated.positive?
end
dump_formula_report :R, "Renamed Formulae"
dump_formula_report :D, "Deleted Formulae"
@@ -582,10 +585,7 @@ def dump(updated_formula_report: true)
dump_formula_report :MC, "Updated Casks"
else
updated = select_formula(:MC).count
- if updated.positive?
- ohai_stdout_or_stderr "Updated Casks",
- "Updated #{updated} #{"cask".pluralize(updated)}."
- end
+ ohai "Updated Casks", "Updated #{updated} #{"cask".pluralize(updated)}." if updated.positive?
end
dump_formula_report :DC, "Deleted Casks"
end | true |
Other | Homebrew | brew | 466f29a16a173c2c381541884649f272fcf51357.json | cmd/update-report: redirect stdout to stderr when it is not a TTY | Library/Homebrew/utils.rb | @@ -112,24 +112,6 @@ def ohai(title, *sput)
puts sput
end
- def ohai_stdout_or_stderr(message, *sput)
- if $stdout.tty?
- ohai(message, *sput)
- else
- $stderr.puts(ohai_title(message))
- $stderr.puts(sput)
- end
- end
-
- def puts_stdout_or_stderr(*message)
- message = "\n" if message.empty?
- if $stdout.tty?
- puts(message)
- else
- $stderr.puts(message)
- end
- end
-
def odebug(title, *sput, always_display: false)
debug = if respond_to?(:debug)
debug? | true |
Other | Homebrew | brew | c0826f1890eaf11ddc1d9e1dfd83a44fc218d91b.json | utils: add method `ensure_executable!` | Library/Homebrew/github_packages.rb | @@ -48,13 +48,7 @@ def upload_bottles(bottles_hash, keep_old:, dry_run:, warn_on_error:)
raise UsageError, "HOMEBREW_GITHUB_PACKAGES_USER is unset." if user.blank?
raise UsageError, "HOMEBREW_GITHUB_PACKAGES_TOKEN is unset." if token.blank?
- skopeo = [
- which("skopeo"),
- which("skopeo", ENV["HOMEBREW_PATH"]),
- HOMEBREW_PREFIX/"bin/skopeo",
- ].compact.first
- skopeo = ensure_formula_installed!("skopeo",
- reason: "for upload").opt_bin/"skopeo" unless skopeo.exist?
+ skopeo = ensure_executable!("skopeo", reason: "for upload")
require "json_schemer"
| true |
Other | Homebrew | brew | c0826f1890eaf11ddc1d9e1dfd83a44fc218d91b.json | utils: add method `ensure_executable!` | Library/Homebrew/utils.rb | @@ -494,6 +494,20 @@ def ensure_formula_installed!(formula_or_name, latest: false, reason: "",
formula
end
+ # Ensure the given executable is exist otherwise install the brewed version
+ def ensure_executable!(name, formula_name = nil, reason: "")
+ formula_name ||= name
+
+ executable = [
+ which(name),
+ which(name, ENV["HOMEBREW_PATH"]),
+ HOMEBREW_PREFIX/"bin/#{name}",
+ ].compact.first
+ return executable if executable.exist?
+
+ ensure_formula_installed!(formula_name, reason: reason).opt_bin/name
+ end
+
def paths
@paths ||= PATH.new(ENV["HOMEBREW_PATH"]).map do |p|
File.expand_path(p).chomp("/") | true |
Other | Homebrew | brew | 3376479e955283c6b0bff6e64faf0e500714d733.json | utils: add method `ensure_formula_installed!` | Library/Homebrew/dev-cmd/bottle.rb | @@ -108,10 +108,7 @@ def bottle
def ensure_relocation_formulae_installed!
Keg.relocation_formulae.each do |f|
- next if Formula[f].latest_version_installed?
-
- ohai "Installing #{f}..."
- safe_system HOMEBREW_BREW_FILE, "install", f
+ ensure_formula_installed!(f, latest: true)
end
end
@@ -263,10 +260,7 @@ def setup_tar_and_args!(args)
return default_tar_args
end
- unless gnu_tar.any_version_installed?
- ohai "Installing `gnu-tar` for bottling..."
- safe_system HOMEBREW_BREW_FILE, "install", "--formula", gnu_tar.full_name
- end
+ ensure_formula_installed!(gnu_tar, "for bottling")
["#{gnu_tar.opt_bin}/gtar", gnutar_args].freeze
end | true |
Other | Homebrew | brew | 3376479e955283c6b0bff6e64faf0e500714d733.json | utils: add method `ensure_formula_installed!` | Library/Homebrew/dev-cmd/bump.rb | @@ -59,8 +59,7 @@ def bump
unless Utils::Curl.curl_supports_tls13?
begin
unless Pathname.new(ENV["HOMEBREW_BREWED_CURL_PATH"]).exist?
- ohai "Installing `curl` for Repology queries..."
- safe_system HOMEBREW_BREW_FILE, "install", "--formula", Formula["curl"].full_name
+ ensure_formula_installed!("curl", "for Repology queries")
end
rescue FormulaUnavailableError
opoo "A `curl` with TLS 1.3 support is required for Repology queries." | true |
Other | Homebrew | brew | 3376479e955283c6b0bff6e64faf0e500714d733.json | utils: add method `ensure_formula_installed!` | Library/Homebrew/dev-cmd/cat.rb | @@ -31,18 +31,14 @@ def cat
cd HOMEBREW_REPOSITORY
pager = if Homebrew::EnvConfig.bat?
- require "formula"
-
- unless Formula["bat"].any_version_installed?
+ ENV["BAT_CONFIG_PATH"] = Homebrew::EnvConfig.bat_config_path
+ ensure_formula_installed!(
+ "bat",
+ "for displaying <formula>/<cask> source",
# The user might want to capture the output of `brew cat ...`
# Redirect stdout to stderr
- redirect_stdout($stderr) do
- ohai "Installing `bat` for displaying <formula>/<cask> source..."
- safe_system HOMEBREW_BREW_FILE, "install", "bat"
- end
- end
- ENV["BAT_CONFIG_PATH"] = Homebrew::EnvConfig.bat_config_path
- Formula["bat"].opt_bin/"bat"
+ output_to_stderr: true,
+ ).opt_bin/"bat"
else
"cat"
end | true |
Other | Homebrew | brew | 3376479e955283c6b0bff6e64faf0e500714d733.json | utils: add method `ensure_formula_installed!` | Library/Homebrew/dev-cmd/tests.rb | @@ -48,11 +48,9 @@ def use_buildpulse?
def run_buildpulse
require "formula"
- unless Formula["buildpulse-test-reporter"].any_version_installed?
- ohai "Installing `buildpulse-test-reporter` for reporting test flakiness..."
- with_env(HOMEBREW_NO_AUTO_UPDATE: "1", HOMEBREW_NO_BOOTSNAP: "1") do
- safe_system HOMEBREW_BREW_FILE, "install", "buildpulse-test-reporter"
- end
+ with_env(HOMEBREW_NO_AUTO_UPDATE: "1", HOMEBREW_NO_BOOTSNAP: "1") do
+ ensure_formula_installed!("buildpulse-test-reporter",
+ "for reporting test flakiness")
end
ENV["BUILDPULSE_ACCESS_KEY_ID"] = ENV["HOMEBREW_BUILDPULSE_ACCESS_KEY_ID"] | true |
Other | Homebrew | brew | 3376479e955283c6b0bff6e64faf0e500714d733.json | utils: add method `ensure_formula_installed!` | Library/Homebrew/github_packages.rb | @@ -53,11 +53,7 @@ def upload_bottles(bottles_hash, keep_old:, dry_run:, warn_on_error:)
which("skopeo", ENV["HOMEBREW_PATH"]),
HOMEBREW_PREFIX/"bin/skopeo",
].compact.first
- unless skopeo.exist?
- ohai "Installing `skopeo` for upload..."
- safe_system HOMEBREW_BREW_FILE, "install", "--formula", "skopeo"
- skopeo = Formula["skopeo"].opt_bin/"skopeo"
- end
+ skopeo = ensure_formula_installed!("skopeo", "for upload").opt_bin/"skopeo" unless skopeo.exist?
require "json_schemer"
| true |
Other | Homebrew | brew | 3376479e955283c6b0bff6e64faf0e500714d733.json | utils: add method `ensure_formula_installed!` | Library/Homebrew/style.rb | @@ -278,31 +278,12 @@ def shell_scripts
def shellcheck
# Always use the latest brewed shellcheck
- unless Formula["shellcheck"].latest_version_installed?
- if Formula["shellcheck"].any_version_installed?
- ohai "Upgrading `shellcheck` for shell style checks..."
- safe_system HOMEBREW_BREW_FILE, "upgrade", "shellcheck"
- else
- ohai "Installing `shellcheck` for shell style checks..."
- safe_system HOMEBREW_BREW_FILE, "install", "shellcheck"
- end
- end
-
- Formula["shellcheck"].opt_bin/"shellcheck"
+ ensure_formula_installed!("shellcheck", "for shell style checks", latest: true).opt_bin/"shellcheck"
end
def shfmt
# Always use the latest brewed shfmt
- unless Formula["shfmt"].latest_version_installed?
- if Formula["shfmt"].any_version_installed?
- ohai "Upgrading `shfmt` to format shell scripts..."
- safe_system HOMEBREW_BREW_FILE, "upgrade", "shfmt"
- else
- ohai "Installing `shfmt` to format shell scripts..."
- safe_system HOMEBREW_BREW_FILE, "install", "shfmt"
- end
- end
-
+ ensure_formula_installed!("shfmt", "to format shell scripts", latest: true)
HOMEBREW_LIBRARY/"Homebrew/utils/shfmt.sh"
end
| true |
Other | Homebrew | brew | 3376479e955283c6b0bff6e64faf0e500714d733.json | utils: add method `ensure_formula_installed!` | Library/Homebrew/utils.rb | @@ -454,6 +454,47 @@ def redirect_stdout(file)
out.close
end
+ # Ensure the given formula is installed
+ # This is useful for installing a utility formula (e.g. `shellcheck` for `brew style`)
+ def ensure_formula_installed!(formula_or_name, reason = "", latest: false, linked: false,
+ output_to_stderr: false, quiet: false)
+ if output_to_stderr || quiet
+ file = if quiet
+ File::NULL
+ else
+ $stderr
+ end
+ # Call this method itself with redirected stdout
+ redirect_stdout(file) do
+ return ensure_formula_installed!(formula_or_name, reason, latest: latest, linked: linked)
+ end
+ end
+
+ require "formula"
+
+ formula = if formula_or_name.is_a?(Formula)
+ formula_or_name
+ else
+ Formula[formula_or_name]
+ end
+
+ reason = " #{reason}" if reason.present? # add a whitespace
+
+ unless formula.any_version_installed?
+ ohai "Installing `#{formula.name}`#{reason}..."
+ safe_system HOMEBREW_BREW_FILE, "install", "--formula", formula.full_name
+ end
+
+ if latest && !formula.latest_version_installed?
+ ohai "Upgrading `#{formula.name}`#{reason}..."
+ safe_system HOMEBREW_BREW_FILE, "upgrade", "--formula", formula.full_name
+ end
+
+ safe_system HOMEBREW_BREW_FILE, "link", formula.full_name if linked && !formula.linked?
+
+ formula
+ end
+
def paths
@paths ||= PATH.new(ENV["HOMEBREW_PATH"]).map do |p|
File.expand_path(p).chomp("/") | true |
Other | Homebrew | brew | 3376479e955283c6b0bff6e64faf0e500714d733.json | utils: add method `ensure_formula_installed!` | Library/Homebrew/utils/git.rb | @@ -100,7 +100,7 @@ def ensure_installed!
# and will also likely fail due to `OS::Linux` and `OS::Mac` being undefined.
raise "Refusing to install Git on a generic OS." if ENV["HOMEBREW_TEST_GENERIC_OS"]
- safe_system HOMEBREW_BREW_FILE, "install", "git"
+ ensure_formula_installed!("git")
clear_available_cache
rescue
raise "Git is unavailable" | true |
Other | Homebrew | brew | c6719e58542df880648bec4de8e7114f33776eca.json | dev-cmd/cat: require "formula" only when necessary | Library/Homebrew/dev-cmd/cat.rb | @@ -2,7 +2,6 @@
# frozen_string_literal: true
require "cli/parser"
-require "formula"
module Homebrew
extend T::Sig
@@ -32,6 +31,8 @@ def cat
cd HOMEBREW_REPOSITORY
pager = if Homebrew::EnvConfig.bat?
+ require "formula"
+
unless Formula["bat"].any_version_installed?
# The user might want to capture the output of `brew cat ...`
# Redirect stdout to stderr | false |
Other | Homebrew | brew | 5657e109afb8a0c2a9cfaadf6b7aa2a872c5f7f0.json | Apply suggestions from code review | Library/Homebrew/dev-cmd/tap-new.rb | @@ -44,17 +44,7 @@ def tap_new
titleized_repo = tap.repo.dup
titleized_user[0] = titleized_user[0].upcase
titleized_repo[0] = titleized_repo[0].upcase
-
- pr_pull_env = {}
- pr_pull_env["HOMEBREW_GITHUB_API_TOKEN"] = "${{ github.token }}"
- pr_pull_env["PULL_REQUEST"] = "${{ github.event.pull_request.number }}"
-
- if args.github_packages?
- pr_pull_env["HOMEBREW_GITHUB_PACKAGES_USER"] = "${{ github.actor }}"
- pr_pull_env["HOMEBREW_GITHUB_PACKAGES_TOKEN"] = "${{ github.token }}"
-
- root_url = GitHubPackages.root_url(tap.user, "homebrew-#{tap.repo}")
- end
+ root_url = GitHubPackages.root_url(tap.user, "homebrew-#{tap.repo}") if args.github_packages?
(tap.path/"Formula").mkpath
@@ -139,7 +129,10 @@ def tap_new
- name: Pull bottles
env:
- #{pr_pull_env.map { |k, v| "#{k}: #{v}" }.join "\n#{" " * 10}"}
+ HOMEBREW_GITHUB_API_TOKEN: ${{ github.token }}
+ HOMEBREW_GITHUB_PACKAGES_TOKEN: ${{ github.token }}
+ HOMEBREW_GITHUB_PACKAGES_USER: ${{ github.actor }}
+ PULL_REQUEST: ${{ github.event.pull_request.number }}
run: brew pr-pull --debug --tap=$GITHUB_REPOSITORY $PULL_REQUEST
- name: Push commits | false |
Other | Homebrew | brew | 97bc320836deb1195a1bf8f646a26c8c72ff845e.json | std_go_args: accept ldflags as string or Array(string) | Library/Homebrew/formula.rb | @@ -1528,10 +1528,13 @@ def std_cmake_args(install_prefix: prefix, install_libdir: "lib", find_framework
end
# Standard parameters for Go builds.
- sig { params(output: T.any(String, Pathname), ldflags: T.nilable(String)).returns(T::Array[String]) }
+ sig {
+ params(output: T.any(String, Pathname),
+ ldflags: T.nilable(T.any(String, T::Array[String]))).returns(T::Array[String])
+ }
def std_go_args(output: bin/name, ldflags: nil)
args = ["-trimpath", "-o=#{output}"]
- args += ["-ldflags=#{ldflags}"] if ldflags
+ args += ["-ldflags=#{Array(ldflags).join(" ")}"] if ldflags
args
end
| false |
Other | Homebrew | brew | 3f357861aa2dde712b02f2e2a05e30aefc0c4842.json | formula: allow optional output path in std_go_args | Library/Homebrew/formula.rb | @@ -1528,9 +1528,9 @@ def std_cmake_args(install_prefix: prefix, install_libdir: "lib", find_framework
end
# Standard parameters for Go builds.
- sig { params(ldflags: T.nilable(String)).returns(T::Array[String]) }
- def std_go_args(ldflags: nil)
- args = ["-trimpath", "-o=#{bin/name}"]
+ sig { params(output: T.any(String, Pathname), ldflags: T.nilable(String)).returns(T::Array[String]) }
+ def std_go_args(output: bin/name, ldflags: nil)
+ args = ["-trimpath", "-o=#{output}"]
args += ["-ldflags=#{ldflags}"] if ldflags
args
end | false |
Other | Homebrew | brew | f8ded0a435700d1969a779d7b75047fbd2176d7a.json | PageMatch: Enforce requirements in #find_versions
This aligns `PageMatch` with how cask strategies handle requirements
in their `#find_versions` methods. This moves related logic from
`Livecheck#latest_version` into the `PageMatch` strategy, which feels
a bit more appropriate. | Library/Homebrew/livecheck/livecheck.rb | @@ -626,13 +626,10 @@ def latest_version(
end
if livecheck_strategy.present?
- if livecheck_strategy == :page_match && (livecheck_regex.blank? && livecheck_strategy_block.blank?)
- odebug "#{strategy_name} strategy requires a regex or block"
- next
- elsif livecheck_url.blank?
+ if livecheck_url.blank?
odebug "#{strategy_name} strategy requires a URL"
next
- elsif strategies.exclude?(strategy)
+ elsif livecheck_strategy != :page_match && strategies.exclude?(strategy)
odebug "#{strategy_name} strategy does not apply to this URL"
next
end | true |
Other | Homebrew | brew | f8ded0a435700d1969a779d7b75047fbd2176d7a.json | PageMatch: Enforce requirements in #find_versions
This aligns `PageMatch` with how cask strategies handle requirements
in their `#find_versions` methods. This moves related logic from
`Livecheck#latest_version` into the `PageMatch` strategy, which feels
a bit more appropriate. | Library/Homebrew/livecheck/strategy/page_match.rb | @@ -90,6 +90,10 @@ def self.versions_from_content(content, regex, &block)
).returns(T::Hash[Symbol, T.untyped])
}
def self.find_versions(url:, regex: nil, provided_content: nil, **_unused, &block)
+ if regex.blank? && block.blank?
+ raise ArgumentError, "#{T.must(name).demodulize} requires a regex or `strategy` block"
+ end
+
match_data = { matches: {}, regex: regex, url: url }
return match_data if url.blank? || (regex.blank? && block.blank?)
| true |
Other | Homebrew | brew | e73524b09325c4aa2e45a945bb2a62fafdfda62f.json | livecheck: Fix debug strategy info printing
The `ExtractPlist` strategy doesn't return certain values (e.g.,
`:url`), so it's necessary to also ensure these values are present
before printing related debug info. Without these changes, we end up
printing info for a blank value (e.g., "URL (strategy):"). | Library/Homebrew/livecheck/livecheck.rb | @@ -658,9 +658,13 @@ def latest_version(
end
if debug
- puts "URL (strategy): #{strategy_data[:url]}" if strategy_data[:url] != url
- puts "URL (final): #{strategy_data[:final_url]}" if strategy_data[:final_url]
- puts "Regex (strategy): #{strategy_data[:regex].inspect}" if strategy_data[:regex] != livecheck_regex
+ if strategy_data[:url].present? && strategy_data[:url] != url
+ puts "URL (strategy): #{strategy_data[:url]}"
+ end
+ puts "URL (final): #{strategy_data[:final_url]}" if strategy_data[:final_url].present?
+ if strategy_data[:regex].present? && strategy_data[:regex] != livecheck_regex
+ puts "Regex (strategy): #{strategy_data[:regex].inspect}"
+ end
puts "Cached?: Yes" if strategy_data[:cached] == true
end
| false |
Other | Homebrew | brew | 8f96ba3c1ebe789cbffab207e058ec21001cb4ca.json | extract: remove bottle blocks | Library/Homebrew/dev-cmd/extract.rb | @@ -64,6 +64,8 @@ module Homebrew
module_function
+ BOTTLE_BLOCK_REGEX = / bottle do.+?end\n\n/m.freeze
+
sig { returns(CLI::Parser) }
def extract_args
Homebrew::CLI::Parser.new do
@@ -184,7 +186,7 @@ def extract
result.sub!("class #{class_name} < Formula", "class #{versioned_name} < Formula")
# Remove bottle blocks, they won't work.
- result.sub!(/ bottle do.+?end\n\n/m, "") if destination_tap != source_tap
+ result.sub!(BOTTLE_BLOCK_REGEX, "")
path = destination_tap.path/"Formula/#{name}@#{version.to_s.downcase}.rb"
if path.exist?
@@ -210,6 +212,7 @@ def formula_at_revision(repo, name, file, rev)
contents = Utils::Git.last_revision_of_file(repo, file, before_commit: rev)
contents.gsub!("@url=", "url ")
contents.gsub!("require 'brewkit'", "require 'formula'")
+ contents.sub!(BOTTLE_BLOCK_REGEX, "")
with_monkey_patch { Formulary.from_contents(name, file, contents, ignore_errors: true) }
end
end | false |
Other | Homebrew | brew | c4f57af057e1faa6d03c29c758bdb168f2870918.json | docs/Acceptable-Formulae: specifiy the list of supported platforms | docs/Acceptable-Formulae.md | @@ -5,6 +5,12 @@ Some formulae should not go in
additional [Interesting Taps and Forks](Interesting-Taps-and-Forks.md) and anyone can start their
own!
+### Supported platforms in `homebrew/core`
+
+The formula needs to build and pass tests on the latest 3 supported macOS versions ([x86_64 and Apple Silicon/ARM](Installation.md#macos-requirements)) and on x86_64 Linux.
+Please have a look at the continuous integration jobs on a pull request in `homebrew/core` to see the full list of OSs.
+If upstream does not support one of these platforms, an exception can be made and the formula can be disabled for that platform.
+
### Dupes in `homebrew/core`
We now accept stuff that comes with macOS as long as it uses `keg_only :provided_by_macos` to be keg-only by default.
| false |
Other | Homebrew | brew | 68f1685b97a574559157eed389c5c7393babafaa.json | Update RBI files for rubocop. | Library/Homebrew/sorbet/rbi/gems/rubocop@1.23.0.rbi | @@ -1,9 +1,9 @@
+# typed: true
+
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `rubocop` gem.
# Please instead update this file by running `bin/tapioca gem rubocop`.
-# typed: true
-
module RuboCop; end
class RuboCop::CLI
@@ -1502,19 +1502,19 @@ module RuboCop::Cop::Gemspec; end
class RuboCop::Cop::Gemspec::DateAssignment < ::RuboCop::Cop::Base
include ::RuboCop::Cop::RangeHelp
+ include ::RuboCop::Cop::GemspecHelp
extend ::RuboCop::Cop::AutoCorrector
- def gem_specification(param0 = T.unsafe(nil)); end
def on_block(block_node); end
end
RuboCop::Cop::Gemspec::DateAssignment::MSG = T.let(T.unsafe(nil), String)
class RuboCop::Cop::Gemspec::DuplicatedAssignment < ::RuboCop::Cop::Base
include ::RuboCop::Cop::RangeHelp
+ include ::RuboCop::Cop::GemspecHelp
def assignment_method_declarations(param0); end
- def gem_specification(param0); end
def on_new_investigation; end
private
@@ -1542,24 +1542,48 @@ end
RuboCop::Cop::Gemspec::OrderedDependencies::MSG = T.let(T.unsafe(nil), String)
+class RuboCop::Cop::Gemspec::RequireMFA < ::RuboCop::Cop::Base
+ include ::RuboCop::Cop::GemspecHelp
+ extend ::RuboCop::Cop::AutoCorrector
+
+ def metadata(param0 = T.unsafe(nil)); end
+ def on_block(node); end
+ def rubygems_mfa_required(param0); end
+ def true_string?(param0 = T.unsafe(nil)); end
+
+ private
+
+ def autocorrect(corrector, node, block_var, metadata); end
+ def change_value(corrector, value); end
+ def correct_metadata(corrector, metadata); end
+ def correct_missing_metadata(corrector, node, block_var); end
+ def mfa_value(metadata_value); end
+end
+
+RuboCop::Cop::Gemspec::RequireMFA::MSG = T.let(T.unsafe(nil), String)
+
class RuboCop::Cop::Gemspec::RequiredRubyVersion < ::RuboCop::Cop::Base
include ::RuboCop::Cop::RangeHelp
def defined_ruby_version(param0 = T.unsafe(nil)); end
def on_new_investigation; end
- def required_ruby_version(param0); end
+ def on_send(node); end
+ def required_ruby_version?(param0); end
private
+ def dynamic_version?(node); end
def extract_ruby_version(required_ruby_version); end
def not_equal_message(required_ruby_version, target_ruby_version); end
end
RuboCop::Cop::Gemspec::RequiredRubyVersion::MISSING_MSG = T.let(T.unsafe(nil), String)
RuboCop::Cop::Gemspec::RequiredRubyVersion::NOT_EQUAL_MSG = T.let(T.unsafe(nil), String)
+RuboCop::Cop::Gemspec::RequiredRubyVersion::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
class RuboCop::Cop::Gemspec::RubyVersionGlobalsUsage < ::RuboCop::Cop::Base
- def gem_specification?(param0); end
+ include ::RuboCop::Cop::GemspecHelp
+
def on_const(node); end
def ruby_version?(param0 = T.unsafe(nil)); end
@@ -1570,6 +1594,13 @@ end
RuboCop::Cop::Gemspec::RubyVersionGlobalsUsage::MSG = T.let(T.unsafe(nil), String)
+module RuboCop::Cop::GemspecHelp
+ extend ::RuboCop::AST::NodePattern::Macros
+
+ def gem_specification(param0); end
+ def gem_specification?(param0 = T.unsafe(nil)); end
+end
+
class RuboCop::Cop::Generator
def initialize(name, output: T.unsafe(nil)); end
@@ -2165,6 +2196,7 @@ class RuboCop::Cop::Layout::DotPosition < ::RuboCop::Cop::Base
def ampersand_dot?(node); end
def autocorrect(corrector, dot, node); end
def correct_dot_position_style?(dot_line, selector_line); end
+ def end_range(node); end
def heredoc?(node); end
def last_heredoc_line(node); end
def line_between?(first_line, second_line); end
@@ -2499,7 +2531,7 @@ class RuboCop::Cop::Layout::EmptyLinesAroundExceptionHandlingKeywords < ::RuboCo
private
- def check_body(node); end
+ def check_body(body, line_of_def_or_kwbegin); end
def keyword_locations(node); end
def keyword_locations_in_ensure(node); end
def keyword_locations_in_rescue(node); end
@@ -3675,6 +3707,7 @@ class RuboCop::Cop::Layout::SpaceInLambdaLiteral < ::RuboCop::Cop::Base
private
def arrow_lambda_with_args?(node); end
+ def lambda_arguments(node); end
def range_of_offense(node); end
def space_after_arrow(lambda_node); end
def space_after_arrow?(lambda_node); end
@@ -3804,7 +3837,6 @@ class RuboCop::Cop::Layout::SpaceInsideParens < ::RuboCop::Cop::Base
def process_with_compact_style(tokens); end
def process_with_space_style(tokens); end
def right_parens?(token1, token2); end
- def same_line?(token1, token2); end
end
RuboCop::Cop::Layout::SpaceInsideParens::MSG = T.let(T.unsafe(nil), String)
@@ -5865,6 +5897,20 @@ end
RuboCop::Cop::Lint::UselessMethodDefinition::MSG = T.let(T.unsafe(nil), String)
+class RuboCop::Cop::Lint::UselessRuby2Keywords < ::RuboCop::Cop::Base
+ def method_definition(param0 = T.unsafe(nil), param1); end
+ def on_send(node); end
+
+ private
+
+ def allowed_arguments(arguments); end
+ def inspect_def(node, def_node); end
+ def inspect_sym(node, sym_node); end
+end
+
+RuboCop::Cop::Lint::UselessRuby2Keywords::MSG = T.let(T.unsafe(nil), String)
+RuboCop::Cop::Lint::UselessRuby2Keywords::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
+
class RuboCop::Cop::Lint::UselessSetterCall < ::RuboCop::Cop::Base
extend ::RuboCop::Cop::AutoCorrector
@@ -6447,15 +6493,19 @@ class RuboCop::Cop::Naming::FileName < ::RuboCop::Cop::Base
include ::RuboCop::Cop::RangeHelp
def on_new_investigation; end
+ def struct_definition(param0 = T.unsafe(nil)); end
private
def allowed_acronyms; end
def bad_filename_allowed?; end
def check_definition_path_hierarchy?; end
+ def defined_struct(node); end
+ def definition_path_hierarchy_roots; end
def expect_matching_definition?; end
def filename_good?(basename); end
def find_class_or_module(node, namespace); end
+ def find_definition(node); end
def for_bad_filename(file_path); end
def ignore_executable_scripts?; end
def match?(expected); end
@@ -7850,16 +7900,17 @@ class RuboCop::Cop::Style::CommentedKeyword < ::RuboCop::Cop::Base
private
- def line(comment); end
def offensive?(comment); end
def register_offense(comment, matched_keyword); end
+ def source_line(comment); end
end
RuboCop::Cop::Style::CommentedKeyword::ALLOWED_COMMENTS = T.let(T.unsafe(nil), Array)
RuboCop::Cop::Style::CommentedKeyword::ALLOWED_COMMENT_REGEXES = T.let(T.unsafe(nil), Array)
RuboCop::Cop::Style::CommentedKeyword::KEYWORDS = T.let(T.unsafe(nil), Array)
RuboCop::Cop::Style::CommentedKeyword::KEYWORD_REGEXES = T.let(T.unsafe(nil), Array)
RuboCop::Cop::Style::CommentedKeyword::MSG = T.let(T.unsafe(nil), String)
+RuboCop::Cop::Style::CommentedKeyword::REGEXP = T.let(T.unsafe(nil), Regexp)
class RuboCop::Cop::Style::ConditionalAssignment < ::RuboCop::Cop::Base
include ::RuboCop::Cop::Style::ConditionalAssignmentHelper
@@ -9881,6 +9932,17 @@ end
RuboCop::Cop::Style::OneLineConditional::MSG = T.let(T.unsafe(nil), String)
+class RuboCop::Cop::Style::OpenStructUse < ::RuboCop::Cop::Base
+ def on_const(node); end
+ def uses_open_struct?(param0 = T.unsafe(nil)); end
+
+ private
+
+ def custom_class_or_module_definition?(node); end
+end
+
+RuboCop::Cop::Style::OpenStructUse::MSG = T.let(T.unsafe(nil), String)
+
class RuboCop::Cop::Style::OptionHash < ::RuboCop::Cop::Base
def on_args(node); end
def option_hash(param0 = T.unsafe(nil)); end
@@ -10018,6 +10080,7 @@ end
class RuboCop::Cop::Style::ParenthesesAroundCondition < ::RuboCop::Cop::Base
include ::RuboCop::Cop::SafeAssignment
include ::RuboCop::Cop::Parentheses
+ include ::RuboCop::Cop::RangeHelp
extend ::RuboCop::Cop::AutoCorrector
def control_op_condition(param0 = T.unsafe(nil)); end
@@ -10032,6 +10095,7 @@ class RuboCop::Cop::Style::ParenthesesAroundCondition < ::RuboCop::Cop::Base
def modifier_op?(node); end
def parens_allowed?(node); end
def process_control_op(node); end
+ def semicolon_separated_expressions?(first_exp, rest_exps); end
end
class RuboCop::Cop::Style::PercentLiteralDelimiters < ::RuboCop::Cop::Base
@@ -10137,6 +10201,7 @@ class RuboCop::Cop::Style::QuotedSymbols < ::RuboCop::Cop::Base
def autocorrect(corrector, node); end
def correct_quotes(str); end
def hash_colon_key?(node); end
+ def invalid_double_quotes?(source); end
def quoted?(sym_node); end
def style; end
def wrong_quotes?(node); end
@@ -10822,13 +10887,16 @@ class RuboCop::Cop::Style::SelectByRegexp < ::RuboCop::Cop::Base
extend ::RuboCop::Cop::AutoCorrector
def calls_lvar?(param0 = T.unsafe(nil), param1); end
+ def creates_hash?(param0 = T.unsafe(nil)); end
def on_send(node); end
def regexp_match?(param0 = T.unsafe(nil)); end
private
def extract_send_node(block_node); end
- def find_regexp(node); end
+ def find_regexp(node, block); end
+ def match_predicate_without_receiver?(node); end
+ def receiver_allowed?(node); end
def register_offense(node, block_node, regexp); end
end
@@ -11861,6 +11929,7 @@ module RuboCop::Cop::Util
def first_part_of_call_chain(node); end
def indent(node, offset: T.unsafe(nil)); end
def interpret_string_escapes(string); end
+ def line(node_or_range); end
def line_range(node); end
def needs_escaping?(string); end
def on_node(syms, sexp, excludes = T.unsafe(nil), &block); end
@@ -11882,6 +11951,7 @@ module RuboCop::Cop::Util
def first_part_of_call_chain(node); end
def indent(node, offset: T.unsafe(nil)); end
def interpret_string_escapes(string); end
+ def line(node_or_range); end
def line_range(node); end
def needs_escaping?(string); end
def on_node(syms, sexp, excludes = T.unsafe(nil), &block); end
@@ -12609,6 +12679,37 @@ end
RuboCop::Formatter::HTMLFormatter::ERBContext::LOGO_IMAGE_PATH = T.let(T.unsafe(nil), String)
RuboCop::Formatter::HTMLFormatter::ERBContext::SEVERITY_COLORS = T.let(T.unsafe(nil), Hash)
+
+class RuboCop::Formatter::HTMLFormatter::FileOffenses < ::Struct
+ def offenses; end
+ def offenses=(_); end
+ def path; end
+ def path=(_); end
+
+ class << self
+ def [](*_arg0); end
+ def inspect; end
+ def members; end
+ def new(*_arg0); end
+ end
+end
+
+class RuboCop::Formatter::HTMLFormatter::Summary < ::Struct
+ def inspected_files; end
+ def inspected_files=(_); end
+ def offense_count; end
+ def offense_count=(_); end
+ def target_files; end
+ def target_files=(_); end
+
+ class << self
+ def [](*_arg0); end
+ def inspect; end
+ def members; end
+ def new(*_arg0); end
+ end
+end
+
RuboCop::Formatter::HTMLFormatter::TEMPLATE_PATH = T.let(T.unsafe(nil), String)
class RuboCop::Formatter::JSONFormatter < ::RuboCop::Formatter::BaseFormatter
@@ -13247,10 +13348,8 @@ end
class String
include ::Comparable
- include ::Colorize::InstanceMethods
include ::JSON::Ext::Generator::GeneratorMethods::String
include ::MessagePack::CoreExt
- extend ::Colorize::ClassMethods
extend ::JSON::Ext::Generator::GeneratorMethods::String::Extend
end
| true |
Other | Homebrew | brew | 68f1685b97a574559157eed389c5c7393babafaa.json | Update RBI files for rubocop. | Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi | @@ -5105,7 +5105,10 @@ module RuboCop::AST::NodePattern::Sets
SET_BUILD_RECOMMENDED_TEST_OPTIONAL = ::T.let(nil, ::T.untyped)
SET_DEPENDS_ON_USES_FROM_MACOS = ::T.let(nil, ::T.untyped)
SET_INCLUDE_WITH_WITHOUT = ::T.let(nil, ::T.untyped)
+ SET_NEW_ = ::T.let(nil, ::T.untyped)
SET_SYSTEM_SHELL_OUTPUT_PIPE_OUTPUT = ::T.let(nil, ::T.untyped)
+ SET_TO_H_TO_HASH = ::T.let(nil, ::T.untyped)
+ SET_TO_I_TO_F_TO_C_TO_R = ::T.let(nil, ::T.untyped)
SET_WITH_WITHOUT = ::T.let(nil, ::T.untyped)
end
@@ -5350,6 +5353,13 @@ end
module RuboCop::RSpec::ExpectOffense
end
+class RuboCop::RSpec::ParallelFormatter
+ def dump_pending(*arg); end
+end
+
+class RuboCop::RSpec::ParallelFormatter
+end
+
class RubyLex
include ::RubyToken
def Fail(err=T.unsafe(nil), *rest); end | true |
Other | Homebrew | brew | fa3bf7804fa96340b6e004e7a5b54ef95f898a83.json | Update RBI files for rbi. | Library/Homebrew/sorbet/rbi/gems/rbi@0.0.7.rbi | @@ -1,9 +1,9 @@
+# typed: true
+
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `rbi` gem.
# Please instead update this file by running `bin/tapioca gem rbi`.
-# typed: true
-
module RBI; end
class RBI::ASTVisitor
@@ -108,6 +108,14 @@ class RBI::AttrWriter < ::RBI::Attr
def to_s; end
end
+class RBI::BlankLine < ::RBI::Comment
+ sig { params(loc: T.nilable(RBI::Loc)).void }
+ def initialize(loc: T.unsafe(nil)); end
+
+ sig { override.params(v: RBI::Printer).void }
+ def accept_printer(v); end
+end
+
class RBI::BlockParam < ::RBI::Param
sig { params(name: String, loc: T.nilable(RBI::Loc), comments: T::Array[RBI::Comment], block: T.nilable(T.proc.params(node: RBI::BlockParam).void)).void }
def initialize(name, loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
@@ -223,14 +231,6 @@ class RBI::ConstBuilder < ::RBI::ASTVisitor
end
end
-class RBI::EmptyComment < ::RBI::Comment
- sig { params(loc: T.nilable(RBI::Loc)).void }
- def initialize(loc: T.unsafe(nil)); end
-
- sig { override.params(v: RBI::Printer).void }
- def accept_printer(v); end
-end
-
class RBI::Error < ::StandardError; end
class RBI::Extend < ::RBI::Mixin
@@ -264,17 +264,36 @@ class RBI::File
def comments=(_arg0); end
+ sig { returns(T::Boolean) }
+ def empty?; end
+
sig { params(out: T.any(IO, StringIO), indent: Integer, print_locs: T::Boolean).void }
def print(out: T.unsafe(nil), indent: T.unsafe(nil), print_locs: T.unsafe(nil)); end
sig { returns(RBI::Tree) }
def root; end
+ def root=(_arg0); end
+
+ sig { void }
+ def set_empty_body_content; end
+
+ sig { params(command: String, reason: T.nilable(String), display_heading: T::Boolean).void }
+ def set_file_header(command, reason: T.unsafe(nil), display_heading: T.unsafe(nil)); end
+
sig { returns(T.nilable(String)) }
def strictness; end
+ def strictness=(_arg0); end
+
sig { params(indent: Integer, print_locs: T::Boolean).returns(String) }
def string(indent: T.unsafe(nil), print_locs: T.unsafe(nil)); end
+
+ sig { void }
+ def transform_rbi!; end
+
+ sig { returns(String) }
+ def transformed_string; end
end
class RBI::Group < ::RBI::Tree
@@ -447,6 +466,14 @@ class RBI::Loc
end
end
+class RBI::MergeTree < ::RBI::Tree
+ sig { params(loc: T.nilable(RBI::Loc), comments: T::Array[RBI::Comment], conflicts: T::Array[RBI::Rewriters::Merge::Conflict], block: T.nilable(T.proc.params(node: RBI::Tree).void)).void }
+ def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), conflicts: T.unsafe(nil), &block); end
+
+ sig { returns(T::Array[RBI::Rewriters::Merge::Conflict]) }
+ def conflicts; end
+end
+
class RBI::Method < ::RBI::NodeWithComments
include ::RBI::Indexable
@@ -600,6 +627,9 @@ class RBI::Node
sig { params(out: T.any(IO, StringIO), indent: Integer, print_locs: T::Boolean).void }
def print(out: T.unsafe(nil), indent: T.unsafe(nil), print_locs: T.unsafe(nil)); end
+ sig { params(v: RBI::Printer).void }
+ def print_blank_line_before(v); end
+
sig { params(node: RBI::Node).void }
def replace(node); end
@@ -613,6 +643,9 @@ class RBI::NodeWithComments < ::RBI::Node
sig { params(loc: T.nilable(RBI::Loc), comments: T::Array[RBI::Comment]).void }
def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil)); end
+ sig { returns(T::Array[String]) }
+ def annotations; end
+
sig { returns(T::Array[RBI::Comment]) }
def comments; end
@@ -800,6 +833,35 @@ class RBI::Rewriters::AddSigTemplates < ::RBI::Visitor
def add_todo_comment(node); end
end
+class RBI::Rewriters::Annotate < ::RBI::Visitor
+ sig { params(annotation: String, annotate_scopes: T::Boolean, annotate_properties: T::Boolean).void }
+ def initialize(annotation, annotate_scopes: T.unsafe(nil), annotate_properties: T.unsafe(nil)); end
+
+ sig { override.params(node: T.nilable(RBI::Node)).void }
+ def visit(node); end
+
+ private
+
+ sig { params(node: RBI::NodeWithComments).void }
+ def annotate_node(node); end
+
+ sig { params(node: RBI::Node).returns(T::Boolean) }
+ def root?(node); end
+end
+
+class RBI::Rewriters::Deannotate < ::RBI::Visitor
+ sig { params(annotation: String).void }
+ def initialize(annotation); end
+
+ sig { override.params(node: T.nilable(RBI::Node)).void }
+ def visit(node); end
+
+ private
+
+ sig { params(node: RBI::NodeWithComments).void }
+ def deannotate_node(node); end
+end
+
class RBI::Rewriters::GroupNodes < ::RBI::Visitor
sig { override.params(node: T.nilable(RBI::Node)).void }
def visit(node); end
@@ -809,14 +871,14 @@ class RBI::Rewriters::Merge
sig { params(left_name: String, right_name: String, keep: RBI::Rewriters::Merge::Keep).void }
def initialize(left_name: T.unsafe(nil), right_name: T.unsafe(nil), keep: T.unsafe(nil)); end
- sig { params(tree: RBI::Tree).returns(T::Array[RBI::Rewriters::Merge::Conflict]) }
+ sig { params(tree: RBI::Tree).void }
def merge(tree); end
- sig { returns(RBI::Tree) }
+ sig { returns(RBI::MergeTree) }
def tree; end
class << self
- sig { params(left: RBI::Tree, right: RBI::Tree, left_name: String, right_name: String, keep: RBI::Rewriters::Merge::Keep).returns(RBI::Tree) }
+ sig { params(left: RBI::Tree, right: RBI::Tree, left_name: String, right_name: String, keep: RBI::Rewriters::Merge::Keep).returns(RBI::MergeTree) }
def merge_trees(left, right, left_name: T.unsafe(nil), right_name: T.unsafe(nil), keep: T.unsafe(nil)); end
end
end
@@ -1200,6 +1262,9 @@ class RBI::Tree < ::RBI::NodeWithComments
sig { params(with_todo_comment: T::Boolean).void }
def add_sig_templates!(with_todo_comment: T.unsafe(nil)); end
+ sig { params(annotation: String, annotate_scopes: T::Boolean, annotate_properties: T::Boolean).void }
+ def annotate!(annotation, annotate_scopes: T.unsafe(nil), annotate_properties: T.unsafe(nil)); end
+
sig { params(name: String, superclass_name: T.nilable(String), block: T.nilable(T.proc.params(scope: RBI::Scope).void)).void }
def create_class(name, superclass_name: T.unsafe(nil), &block); end
@@ -1227,6 +1292,9 @@ class RBI::Tree < ::RBI::NodeWithComments
sig { params(name: String, value: String).void }
def create_type_member(name, value: T.unsafe(nil)); end
+ sig { params(annotation: String).void }
+ def deannotate!(annotation); end
+
sig { returns(T::Boolean) }
def empty?; end
@@ -1236,8 +1304,8 @@ class RBI::Tree < ::RBI::NodeWithComments
sig { returns(RBI::Index) }
def index; end
- sig { params(other: RBI::Tree).returns(RBI::Tree) }
- def merge(other); end
+ sig { params(other: RBI::Tree, left_name: String, right_name: String, keep: RBI::Rewriters::Merge::Keep).returns(RBI::MergeTree) }
+ def merge(other, left_name: T.unsafe(nil), right_name: T.unsafe(nil), keep: T.unsafe(nil)); end
sig { void }
def nest_non_public_methods!; end | false |
Other | Homebrew | brew | d087e783d8b0db3efc5dffaf324d18d3bf004eb7.json | Update RBI files for mime-types. | Library/Homebrew/sorbet/rbi/gems/mime-types@3.4.1.rbi | @@ -1,9 +1,9 @@
+# typed: true
+
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `mime-types` gem.
# Please instead update this file by running `bin/tapioca gem mime-types`.
-# typed: true
-
module MIME; end
class MIME::Type
@@ -38,6 +38,9 @@ class MIME::Type
def preferred_extension; end
def preferred_extension=(value); end
def priority_compare(other); end
+ def provisional; end
+ def provisional=(_arg0); end
+ def provisional?; end
def raw_media_type; end
def raw_sub_type; end
def registered; end
@@ -97,6 +100,9 @@ class MIME::Type::Columnar < ::MIME::Type
def obsolete?(*args); end
def preferred_extension(*args); end
def preferred_extension=(*args); end
+ def provisional(*args); end
+ def provisional=(*args); end
+ def provisional?(*args); end
def registered(*args); end
def registered=(*args); end
def registered?(*args); end
@@ -270,6 +276,7 @@ class MIME::Types::Loader
private
+ def old_yaml?; end
def read_file(filename); end
end
end | false |
Other | Homebrew | brew | 84a979d76ba2fddf841afcbc4266bc18885ae291.json | Update RBI files for mime-types-data. | Library/Homebrew/sorbet/rbi/gems/mime-types-data@3.2021.1115.rbi | @@ -1,9 +1,9 @@
+# typed: true
+
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `mime-types-data` gem.
# Please instead update this file by running `bin/tapioca gem mime-types-data`.
-# typed: true
-
module MIME; end
class MIME::Types | false |
Other | Homebrew | brew | c1531cd7b349dadd58e5ebb463ba2224570bb17b.json | Add line breaks & indentation | docs/Analytics.md | @@ -3,15 +3,18 @@
Homebrew gathers anonymous aggregate user behaviour analytics using Google Analytics. You will be notified the first time you run `brew update` or install Homebrew. Analytics are not enabled until after this notice is shown, to ensure that you can [opt out](Analytics.md#opting-out) without ever sending analytics data.
## Why?
+
Homebrew is provided free of charge and run entirely by volunteers in their spare time. As a result, we do not have the resources to do detailed user studies of Homebrew users to decide on how best to design future features and prioritise current work. Anonymous aggregate user analytics allow us to prioritise fixes and features based on how, where and when people use Homebrew. For example:
- If a formula is widely used and is failing often it will enable us to prioritise fixing that formula over others.
- Collecting the OS version allows us to decide what versions of macOS to prioritise and support and identify build failures that occur only on single versions.
## How Long?
+
Homebrew's anonymous user and event data have a 14 month retention period. This is the [lowest possible value for Google Analytics](https://support.google.com/analytics/answer/7667196).
## What?
+
Homebrew's analytics record some shared information for every event:
- The Homebrew user agent, e.g. `Homebrew/2.5.0 (Macintosh; Intel Mac OS X 10.15.6) curl/7.64.1`.
@@ -39,15 +42,19 @@ It is impossible for the Homebrew developers to match any particular event to an
As far as we can tell it would be impossible for Google to match the randomly generated Homebrew-only analytics user ID to any other Google Analytics user ID. If Google turned evil the only thing they could do would be to lie about anonymising IP addresses and attempt to match users based on IP addresses.
## When/Where?
+
Homebrew's analytics are sent throughout Homebrew's execution to Google Analytics over HTTPS.
## Who?
+
Summaries of installation and error analytics are publicly available [here](https://brew.sh/analytics/). A JSON API is also available. The majority of Homebrew maintainers are not granted more detailed analytics data beyond these public resources.
## How?
+
The code is viewable in [`analytics.rb`](https://github.com/Homebrew/brew/blob/HEAD/Library/Homebrew/utils/analytics.rb) and [`analytics.sh`](https://github.com/Homebrew/brew/blob/HEAD/Library/Homebrew/utils/analytics.sh). They are done in a separate background process and fail fast to avoid delaying any execution. They will fail immediately and silently if you have no network connection.
## Opting out
+
Homebrew analytics helps us maintainers and leaving it on is appreciated. However, if you want to opt out of Homebrew's analytics, you can set this variable in your environment:
```sh | true |
Other | Homebrew | brew | c1531cd7b349dadd58e5ebb463ba2224570bb17b.json | Add line breaks & indentation | docs/Bottles.md | @@ -3,19 +3,23 @@
Bottles are produced by installing a formula with `brew install --build-bottle <formula>` and then bottling it with `brew bottle <formula>`. This outputs the bottle DSL which should be inserted into the formula file.
## Usage
+
If a bottle is available and usable it will be downloaded and poured automatically when you `brew install <formula>`. If you wish to disable this you can do so by specifying `--build-from-source`.
Bottles will not be used if the user requests it (see above), if the formula requests it (with `pour_bottle?`), if any options are specified during installation (bottles are all compiled with default options), if the bottle is not up to date (e.g. lacking a checksum) or if the bottle's `cellar` is not `:any` nor equal to the current `HOMEBREW_CELLAR`.
## Creation
+
Bottles are created using the [Brew Test Bot](Brew-Test-Bot.md), usually when people submit pull requests to Homebrew. The `bottle do` block is updated by maintainers when they merge a pull request. For the Homebrew organisations' taps they are uploaded to and downloaded from [GitHub Packages](https://github.com/orgs/Homebrew/packages).
By default, bottles will be built for the oldest CPU supported by the OS/architecture you're building for (Core 2 for 64-bit OSs). This ensures that bottles are compatible with all computers you might distribute them to. If you *really* want your bottles to be optimised for something else, you can pass the `--bottle-arch=` option to build for another architecture; for example, `brew install foo --build-bottle --bottle-arch=penryn`. Just remember that if you build for a newer architecture some of your users might get binaries they can't run and that would be sad!
## Format
+
Bottles are simple gzipped tarballs of compiled binaries. Any metadata is stored in a formula's bottle DSL and in the bottle filename (i.e. macOS version, revision).
## Bottle DSL (Domain Specific Language)
+
Bottles have a DSL to be used in formulae which is contained in the `bottle do ... end` block.
A simple (and typical) example:
@@ -43,25 +47,35 @@ end
```
### Root URL (`root_url`)
+
Optionally contains the URL root used to calculate bottle URLs.
+
By default this is omitted and the Homebrew default bottle URL root is used. This may be useful for taps which wish to provide bottles for their formulae or to cater for a non-default `HOMEBREW_CELLAR`.
### Cellar (`cellar`)
+
Optionally contains the value of `HOMEBREW_CELLAR` in which the bottles were built.
+
Most compiled software contains references to its compiled location so cannot be simply relocated anywhere on disk. If this value is `:any` or `:any_skip_relocation` this means that the bottle can be safely installed in any Cellar as it did not contain any references to its installation Cellar. This can be omitted if a bottle is compiled (as all default Homebrew ones are) for the default `HOMEBREW_CELLAR`.
### Rebuild version (`rebuild`)
+
Optionally contains the rebuild version of the bottle.
+
Sometimes bottles may need be updated without bumping the version of the formula, e.g. a new patch was applied. In that case the rebuild will have a value of 1 or more.
### Checksum (`sha256`)
+
Contains the SHA-256 hash of a bottle for a particular version of macOS.
## Formula DSL
+
An additional method is available in the formula DSL.
### Pour bottle (`pour_bottle?`)
+
Optionally returns a boolean to decide whether a bottle should be used for this formula.
+
For example a bottle may break if another formula has been compiled with non-default options, so this method could check for that case and return `false`.
A full example: | true |
Other | Homebrew | brew | c1531cd7b349dadd58e5ebb463ba2224570bb17b.json | Add line breaks & indentation | docs/Interesting-Taps-and-Forks.md | @@ -1,31 +1,32 @@
# Interesting Taps & Forks
A [tap](Taps.md) is Homebrew-speak for a Git repository containing extra formulae.
+
Homebrew has the capability to add (and remove) multiple taps to your local installation with the `brew tap` and `brew untap` commands. Type `man brew` in your terminal. The main repository at <https://github.com/Homebrew/homebrew-core>, often called `homebrew/core`, is always built-in.
Your taps are Git repositories located at `$(brew --repository)/Library/Taps`.
## Unsupported interesting taps
-* [homebrew-ffmpeg/ffmpeg](https://github.com/homebrew-ffmpeg/homebrew-ffmpeg): A tap for FFmpeg with additional options, including nonfree additions.
+* [homebrew-ffmpeg/ffmpeg](https://github.com/homebrew-ffmpeg/homebrew-ffmpeg): A tap for FFmpeg with additional options, including nonfree additions.
-* [denji/nginx](https://github.com/denji/homebrew-nginx): A tap for NGINX modules, intended for its `nginx-full` formula which includes more module options.
+* [denji/nginx](https://github.com/denji/homebrew-nginx): A tap for NGINX modules, intended for its `nginx-full` formula which includes more module options.
-* [InstantClientTap/instantclient](https://github.com/InstantClientTap/homebrew-instantclient): A tap for Oracle Instant Client. The packages need to be downloaded manually.
+* [InstantClientTap/instantclient](https://github.com/InstantClientTap/homebrew-instantclient): A tap for Oracle Instant Client. The packages need to be downloaded manually.
-* [osx-cross/avr](https://github.com/osx-cross/homebrew-avr): GNU AVR toolchain (Libc, compilers and other tools for Atmel MCUs, useful for Arduino hackers and AVR programmers).
+* [osx-cross/avr](https://github.com/osx-cross/homebrew-avr): GNU AVR toolchain (Libc, compilers and other tools for Atmel MCUs, useful for Arduino hackers and AVR programmers).
-* [petere/postgresql](https://github.com/petere/homebrew-postgresql): Allows installing multiple PostgreSQL versions in parallel.
+* [petere/postgresql](https://github.com/petere/homebrew-postgresql): Allows installing multiple PostgreSQL versions in parallel.
-* [osrf/simulation](https://github.com/osrf/homebrew-simulation): Tools for robotics simulation.
+* [osrf/simulation](https://github.com/osrf/homebrew-simulation): Tools for robotics simulation.
-* [brewsci/bio](https://github.com/brewsci/homebrew-bio): Bioinformatics formulae.
+* [brewsci/bio](https://github.com/brewsci/homebrew-bio): Bioinformatics formulae.
-* [davidchall/hep](https://github.com/davidchall/homebrew-hep): High energy physics formulae.
+* [davidchall/hep](https://github.com/davidchall/homebrew-hep): High energy physics formulae.
-* [lifepillar/appleii](https://github.com/lifepillar/homebrew-appleii): Formulae for vintage Apple emulation.
+* [lifepillar/appleii](https://github.com/lifepillar/homebrew-appleii): Formulae for vintage Apple emulation.
-* [gromgit/fuse](https://github.com/gromgit/homebrew-fuse): macOS FUSE formulae that are no longer available in `homebrew/core`.
+* [gromgit/fuse](https://github.com/gromgit/homebrew-fuse): macOS FUSE formulae that are no longer available in `homebrew/core`.
## Unsupported interesting forks
-* [mistydemeo/tigerbrew](https://github.com/mistydemeo/tigerbrew): Experimental Tiger PowerPC version.
+* [mistydemeo/tigerbrew](https://github.com/mistydemeo/tigerbrew): Experimental Tiger PowerPC version. | true |
Other | Homebrew | brew | c1531cd7b349dadd58e5ebb463ba2224570bb17b.json | Add line breaks & indentation | docs/Taps.md | @@ -9,21 +9,23 @@ but the command isn't limited to any one location.
* `brew tap` without arguments lists the currently tapped repositories. For
example:
-```sh
-$ brew tap
-homebrew/core
-mistydemeo/tigerbrew
-dunn/emacs
-```
+ ```sh
+ $ brew tap
+ homebrew/core
+ mistydemeo/tigerbrew
+ dunn/emacs
+ ```
<!-- vale Homebrew.Terms = OFF -->
<!-- The `terms` lint suggests changing "repo" to "repository". But we need the abbreviation in the tap syntax and URL example. -->
+
* `brew tap <user/repo>` makes a clone of the repository at
https://github.com/user/homebrew-repo. After that, `brew` will be able to work on
those formulae as if they were in Homebrew's canonical repository. You can
install and uninstall them with `brew [un]install`, and the formulae are
automatically updated when you run `brew update`. (See below for details
about how `brew tap` handles the names of repositories.)
+
<!-- vale Homebrew.Terms = ON -->
* `brew tap <user/repo> <URL>` makes a clone of the repository at URL. | true |
Other | Homebrew | brew | c1531cd7b349dadd58e5ebb463ba2224570bb17b.json | Add line breaks & indentation | docs/Tips-N'-Tricks.md | @@ -16,6 +16,7 @@ This can be useful if a package can't build against the version of something you
And of course, you can simply `brew link <formula>` again afterwards!
## Pre-downloading a file for a formula
+
Sometimes it's faster to download a file via means other than those
strategies that are available as part of Homebrew. For example,
Erlang provides a torrent that'll let you download at 4–5× the normal
@@ -80,10 +81,12 @@ In Sublime Text 2/3, you can use Package Control to install
which adds highlighting for inline patches.
### Vim
+
[brew.vim](https://github.com/xu-cheng/brew.vim) adds highlighting to
inline patches in Vim.
### Emacs
+
[homebrew-mode](https://github.com/dunn/homebrew-mode) provides syntax
highlighting for inline patches as well as a number of helper functions
for editing formula files.
@@ -92,6 +95,7 @@ for editing formula files.
for emacs shell-mode and eshell-mode.
### Atom
+
[language-homebrew-formula](https://atom.io/packages/language-homebrew-formula)
adds highlighting and diff support (with the
[language-diff](https://atom.io/packages/language-diff) plugin). | true |
Other | Homebrew | brew | 7bd5374dccd864f09314c51e9ed747bc1363f6e2.json | Revert "linkage_checker: check variable references with dlopen"
Trying to `dlopen` some Qt libraries causes Ruby to crash.
This reverts commit 0191a275ccc3e1a9377c956751bbc1c4ba7b0cea. | Library/Homebrew/linkage_checker.rb | @@ -32,7 +32,6 @@ def initialize(keg, formula = nil, cache_db:, rebuild_cache: false)
@unnecessary_deps = []
@unwanted_system_dylibs = []
@version_conflict_deps = []
- @broken_variable_dylibs = []
check_dylibs(rebuild_cache: rebuild_cache)
end
@@ -47,7 +46,6 @@ def display_normal_output
display_items "Undeclared dependencies with linkage", @undeclared_deps
display_items "Dependencies with no linkage", @unnecessary_deps
display_items "Unwanted system libraries", @unwanted_system_dylibs
- display_items "Libraries with broken variable references", @broken_variable_dylibs
end
def display_reverse_output
@@ -70,12 +68,11 @@ def display_test_output(puts_output: true)
display_items "Broken dependencies", @broken_deps, puts_output: puts_output
display_items "Unwanted system libraries", @unwanted_system_dylibs, puts_output: puts_output
display_items "Conflicting libraries", @version_conflict_deps, puts_output: puts_output
- display_items "Libraries with broken variable references", @broken_variable_dylibs, puts_output: puts_output
end
sig { returns(T::Boolean) }
def broken_library_linkage?
- issues = [@broken_deps, @unwanted_system_dylibs, @version_conflict_deps, @broken_variable_dylibs]
+ issues = [@broken_deps, @unwanted_system_dylibs, @version_conflict_deps]
[issues, unexpected_broken_dylibs, unexpected_present_dylibs].flatten.any?(&:present?)
end
@@ -151,7 +148,6 @@ def check_dylibs(rebuild_cache:)
end
checked_dylibs = Set.new
- dlopened_if_needed_files = Set.new
keg_files_dylibs.each do |file, dylibs|
dylibs.each do |dylib|
@@ -163,15 +159,6 @@ def check_dylibs(rebuild_cache:)
if dylib.start_with? "@"
@variable_dylibs << dylib
-
- if dlopened_if_needed_files.add?(file)
- file = Pathname.new(file)
- next if file.binary_executable?
- next if dylib_found_via_dlopen(file.dylib_id)
-
- @broken_variable_dylibs << file.dylib_id
- end
-
next
end
| false |
Other | Homebrew | brew | 0191a275ccc3e1a9377c956751bbc1c4ba7b0cea.json | linkage_checker: check variable references with dlopen
The linkage check currently does nothing to check the validity of
variable-referenced libraries (prefixed with an `@`).
We could rectify that by mimicking the dynamic linker in looking up the
variable-referenced library, but this could get quite complicated.
Instead, let's let the linker do the hard work by checking if we can
`dlopen` libraries and bundles that contain variable linkage. The
`dlopen` will fail if the linker cannot resolve the variable reference.
There are at least two disadvantages to this approach relative to the
alternative suggested above:
1. This doesn't work for binary executables.
2. This doesn't identify which variable references are broken.
It's still better than not checking them at all, which is what we do
currently, and saves us from having to carry around code that parses and
verifies variable references directly. | Library/Homebrew/linkage_checker.rb | @@ -32,6 +32,7 @@ def initialize(keg, formula = nil, cache_db:, rebuild_cache: false)
@unnecessary_deps = []
@unwanted_system_dylibs = []
@version_conflict_deps = []
+ @broken_variable_dylibs = []
check_dylibs(rebuild_cache: rebuild_cache)
end
@@ -46,6 +47,7 @@ def display_normal_output
display_items "Undeclared dependencies with linkage", @undeclared_deps
display_items "Dependencies with no linkage", @unnecessary_deps
display_items "Unwanted system libraries", @unwanted_system_dylibs
+ display_items "Libraries with broken variable references", @broken_variable_dylibs
end
def display_reverse_output
@@ -68,11 +70,12 @@ def display_test_output(puts_output: true)
display_items "Broken dependencies", @broken_deps, puts_output: puts_output
display_items "Unwanted system libraries", @unwanted_system_dylibs, puts_output: puts_output
display_items "Conflicting libraries", @version_conflict_deps, puts_output: puts_output
+ display_items "Libraries with broken variable references", @broken_variable_dylibs, puts_output: puts_output
end
sig { returns(T::Boolean) }
def broken_library_linkage?
- issues = [@broken_deps, @unwanted_system_dylibs, @version_conflict_deps]
+ issues = [@broken_deps, @unwanted_system_dylibs, @version_conflict_deps, @broken_variable_dylibs]
[issues, unexpected_broken_dylibs, unexpected_present_dylibs].flatten.any?(&:present?)
end
@@ -148,6 +151,7 @@ def check_dylibs(rebuild_cache:)
end
checked_dylibs = Set.new
+ dlopened_if_needed_files = Set.new
keg_files_dylibs.each do |file, dylibs|
dylibs.each do |dylib|
@@ -159,6 +163,15 @@ def check_dylibs(rebuild_cache:)
if dylib.start_with? "@"
@variable_dylibs << dylib
+
+ if dlopened_if_needed_files.add?(file)
+ file = Pathname.new(file)
+ next if file.binary_executable?
+ next if dylib_found_via_dlopen(file.dylib_id)
+
+ @broken_variable_dylibs << file.dylib_id
+ end
+
next
end
| false |
Other | Homebrew | brew | b4fd89c8113b073d1eee49fa46c2cce7743c650f.json | Update RBI files for mechanize. | Library/Homebrew/sorbet/rbi/gems/mechanize@2.8.3.rbi | @@ -1,9 +1,9 @@
+# typed: true
+
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `mechanize` gem.
# Please instead update this file by running `bin/tapioca gem mechanize`.
-# typed: true
-
class HTTP::CookieJar
include ::Mechanize::CookieDeprecated
include ::Mechanize::CookieJarIMethods | false |
Other | Homebrew | brew | 50cde98fd393a8faf8937af3177c2ec58486d07f.json | utils/shfmt.sh: allow single line if blocks | Library/Homebrew/utils/shfmt.sh | @@ -292,6 +292,7 @@ wrap_then_do() {
local -a processed=()
local -a buffer=()
local line
+ local singleline_if_then_fi_regex='^( *)if (.+)\; then (.+)\; fi( *#.*)?$'
local singleline_if_then_regex='^( *)(el)?if (.+)\; (then( *#.*)?)$'
local singleline_for_do_regex='^( *)(for|while) (.+)\; (do( *#.*)?)$'
local multiline_if_then_begin_regex='^( *)(el)?if '
@@ -301,7 +302,10 @@ wrap_then_do() {
do
if [[ "${#buffer[@]}" == 0 ]]
then
- if [[ "${line}" =~ ${singleline_if_then_regex} ]]
+ if [[ "${line}" =~ ${singleline_if_then_fi_regex} ]]
+ then
+ processed+=("${line}")
+ elif [[ "${line}" =~ ${singleline_if_then_regex} ]]
then
processed+=("${BASH_REMATCH[1]}${BASH_REMATCH[2]}if ${BASH_REMATCH[3]}")
processed+=("${BASH_REMATCH[1]}${BASH_REMATCH[4]}") | false |
Other | Homebrew | brew | 49de2b0c1ae56d31d5c59dc42c292475f57d4344.json | Check arch instead of the brand string | Library/Homebrew/brew.sh | @@ -6,6 +6,7 @@
# Doesn't need a default case because we don't support other OSs
# shellcheck disable=SC2249
HOMEBREW_PROCESSOR="$(uname -m)"
+HOMEBREW_PHYSICAL_PROCESSOR="${HOMEBREW_PROCESSOR}"
HOMEBREW_SYSTEM="$(uname -s)"
case "${HOMEBREW_SYSTEM}" in
Darwin) HOMEBREW_MACOS="1" ;;
@@ -17,12 +18,19 @@ esac
# same file under the native architecture
# These variables are set from the user environment.
# shellcheck disable=SC2154
-if [[ "${HOMEBREW_CHANGE_ARCH_TO_ARM}" == "1" ]] &&
- [[ "${HOMEBREW_MACOS}" == "1" ]] &&
- [[ "$(sysctl -n hw.optional.arm64 2>/dev/null)" == "1" ]] &&
- [[ "$(sysctl -n sysctl.proc_translated 2>/dev/null)" == "1" ]]
+if [[ "${HOMEBREW_MACOS}" == "1" ]] &&
+ [[ "$(sysctl -n hw.optional.arm64 2>/dev/null)" == "1" ]]
then
- exec arch -arm64e "${HOMEBREW_BREW_FILE}" "$@"
+ # used in vendor-install.sh
+ # shellcheck disable=SC2034
+ HOMEBREW_PHYSICAL_PROCESSOR="arm64"
+ HOMEBREW_ROSETTA="$(sysctl -n sysctl.proc_translated)"
+
+ if [[ "${HOMEBREW_CHANGE_ARCH_TO_ARM}" == "1" ]] &&
+ [[ "${HOMEBREW_ROSETTA}" == "1" ]]
+ then
+ exec arch -arm64e "${HOMEBREW_BREW_FILE}" "$@"
+ fi
fi
# Where we store built products; a Cellar in HOMEBREW_PREFIX (often /usr/local | true |
Other | Homebrew | brew | 49de2b0c1ae56d31d5c59dc42c292475f57d4344.json | Check arch instead of the brand string | Library/Homebrew/cmd/vendor-install.sh | @@ -14,15 +14,16 @@ VENDOR_DIR="${HOMEBREW_LIBRARY}/Homebrew/vendor"
# Built from https://github.com/Homebrew/homebrew-portable-ruby.
if [[ -n "${HOMEBREW_MACOS}" ]]
then
- if [[ "$(sysctl -n machdep.cpu.brand_string)" != "Apple"* ]] ||
+ if [[ "${HOMEBREW_PHYSICAL_PROCESSOR}" == "x86_64" ]] ||
# Handle the case where /usr/local/bin/brew is run under arm64.
# It's a x86_64 installation there (we refuse to install arm64 binaries) so
# use a x86_64 Portable Ruby.
- [[ "${HOMEBREW_PROCESSOR}" == "arm64" && "${HOMEBREW_PREFIX}" == "/usr/local" ]]
+ [[ "${HOMEBREW_PHYSICAL_PROCESSOR}" == "arm64" && "${HOMEBREW_PREFIX}" == "/usr/local" ]]
then
ruby_FILENAME="portable-ruby-2.6.8.yosemite.bottle.tar.gz"
ruby_SHA="0cb1cc7af109437fe0e020c9f3b7b95c3c709b140bde9f991ad2c1433496dd42"
- else
+ elif [[ "${HOMEBREW_PHYSICAL_PROCESSOR}" == "arm64" ]]
+ then
ruby_FILENAME="portable-ruby-2.6.8.arm64_big_sur.bottle.tar.gz"
ruby_SHA="f2d5cab5a4dd49e5b3de780a3cd0a1f61642fea247d1c25aa40cd43f1be290b5"
fi | true |
Other | Homebrew | brew | 98b33e673200778b06f564bba26b60be7918e818.json | Remove another redundant conditional
This condition is always true when we've reached this branch. | Library/Homebrew/cmd/vendor-install.sh | @@ -22,8 +22,7 @@ then
then
ruby_FILENAME="portable-ruby-2.6.8.yosemite.bottle.tar.gz"
ruby_SHA="0cb1cc7af109437fe0e020c9f3b7b95c3c709b140bde9f991ad2c1433496dd42"
- elif [[ "$(sysctl -n machdep.cpu.brand_string)" == "Apple"* ]]
- then
+ else
ruby_FILENAME="portable-ruby-2.6.8.arm64_big_sur.bottle.tar.gz"
ruby_SHA="f2d5cab5a4dd49e5b3de780a3cd0a1f61642fea247d1c25aa40cd43f1be290b5"
fi | false |
Other | Homebrew | brew | fd1ca7e2b74a6fc0b5a3a8a0eadfcc808325308a.json | Remove redundant conditionals
Whenever the `sysctl` call does not match `"Apple"*`, we can be sure
that `HOMEBREW_PROCESSOR` is `Intel`, so there's no need for this
additional check. | Library/Homebrew/cmd/vendor-install.sh | @@ -14,8 +14,7 @@ VENDOR_DIR="${HOMEBREW_LIBRARY}/Homebrew/vendor"
# Built from https://github.com/Homebrew/homebrew-portable-ruby.
if [[ -n "${HOMEBREW_MACOS}" ]]
then
- if [[ "${HOMEBREW_PROCESSOR}" == "Intel" &&
- "$(sysctl -n machdep.cpu.brand_string)" != "Apple"* ]] ||
+ if [[ "$(sysctl -n machdep.cpu.brand_string)" != "Apple"* ]] ||
# Handle the case where /usr/local/bin/brew is run under arm64.
# It's a x86_64 installation there (we refuse to install arm64 binaries) so
# use a x86_64 Portable Ruby. | false |
Other | Homebrew | brew | 51ab1649fbc3653be8f3a1b7019da0ebbdacf582.json | Install Portable Ruby on native ARM installs
The previous commit only prevented the installation of an Intel Portable
Ruby into `/opt/homebrew` prefix. Let's actually install an ARM64
Portable Ruby there too. | Library/Homebrew/cmd/vendor-install.sh | @@ -23,7 +23,7 @@ then
then
ruby_FILENAME="portable-ruby-2.6.8.yosemite.bottle.tar.gz"
ruby_SHA="0cb1cc7af109437fe0e020c9f3b7b95c3c709b140bde9f991ad2c1433496dd42"
- elif [[ "${HOMEBREW_PROCESSOR}" == "arm64" ]]
+ elif [[ "$(sysctl -n machdep.cpu.brand_string)" == "Apple"* ]]
then
ruby_FILENAME="portable-ruby-2.6.8.arm64_big_sur.bottle.tar.gz"
ruby_SHA="f2d5cab5a4dd49e5b3de780a3cd0a1f61642fea247d1c25aa40cd43f1be290b5" | false |
Other | Homebrew | brew | 8aeb28781c68fdb22ddfcca45501b19a29328bae.json | vendor-install: handle native ARM running under Rosetta
Since `HOMEBREW_PROCESSOR` is populated using `uname -m`, this will
register as `Intel` even when a native ARM install is running under
Rosetta.
Let's work around this by checking `sysctl -n machdep.cpu.brand_string`.
On my Intel machine:
❯ sysctl -n machdep.cpu.brand_string
Intel(R) Core(TM) i3-1000NG4 CPU @ 1.10GHz
On Apple Silicon:
brew@HMBRW-A-001-M1-001 ~ % sysctl -n machdep.cpu.brand_string
Apple M1
The case of a Rosetta installation of Homebrew is already handled below
the proposed change.
Fixes Homebrew/discussions#2434. | Library/Homebrew/cmd/vendor-install.sh | @@ -14,7 +14,8 @@ VENDOR_DIR="${HOMEBREW_LIBRARY}/Homebrew/vendor"
# Built from https://github.com/Homebrew/homebrew-portable-ruby.
if [[ -n "${HOMEBREW_MACOS}" ]]
then
- if [[ "${HOMEBREW_PROCESSOR}" == "Intel" ]] ||
+ if [[ "${HOMEBREW_PROCESSOR}" == "Intel" &&
+ "$(sysctl -n machdep.cpu.brand_string)" != "Apple"* ]] ||
# Handle the case where /usr/local/bin/brew is run under arm64.
# It's a x86_64 installation there (we refuse to install arm64 binaries) so
# use a x86_64 Portable Ruby. | false |
Other | Homebrew | brew | 5b47c6540c3681d16d2dbec820596f64def1126d.json | tests.yml: resume preinstalling subversion | .github/workflows/tests.yml | @@ -305,6 +305,10 @@ jobs:
- name: Install brew tests dependencies
run: |
+ brew install subversion
+ brew sh -c "svn --homebrew=print-path"
+ which svn
+ which svnadmin
brew install curl
which curl
| false |
Other | Homebrew | brew | 508b48d19e1627db45d33b82e1a2159a010594a5.json | formula_installer: preinstall any pre-fetch dependencies | Library/Homebrew/dependency_collector.rb | @@ -45,7 +45,7 @@ def fetch(spec)
end
def cache_key(spec)
- if spec.is_a?(Resource) && spec.download_strategy == CurlDownloadStrategy
+ if spec.is_a?(Resource) && spec.download_strategy <= CurlDownloadStrategy
File.extname(spec.url)
else
spec
@@ -148,7 +148,7 @@ def resource_dep(spec, tags)
strategy = spec.download_strategy
if strategy <= HomebrewCurlDownloadStrategy
- brewed_curl_dep_if_needed(tags)
+ @deps << brewed_curl_dep_if_needed(tags)
parse_url_spec(spec.url, tags)
elsif strategy <= CurlDownloadStrategy
parse_url_spec(spec.url, tags) | true |
Other | Homebrew | brew | 508b48d19e1627db45d33b82e1a2159a010594a5.json | formula_installer: preinstall any pre-fetch dependencies | Library/Homebrew/formula_installer.rb | @@ -215,6 +215,7 @@ def prelude
forbidden_license_check
check_install_sanity
+ install_fetch_deps unless ignore_deps?
end
sig { void }
@@ -343,6 +344,19 @@ def check_install_sanity
"#{formula.full_name} requires the latest version of pinned dependencies"
end
+ sig { void }
+ def install_fetch_deps
+ return if @compute_dependencies.blank?
+
+ compute_dependencies(use_cache: false) if @compute_dependencies.any? do |dep, options|
+ next false unless dep.tags == [:build, :test]
+
+ fetch_dependencies
+ install_dependency(dep, options)
+ true
+ end
+ end
+
def build_bottle_preinstall
@etc_var_dirs ||= [HOMEBREW_PREFIX/"etc", HOMEBREW_PREFIX/"var"]
@etc_var_preinstall = Find.find(*@etc_var_dirs.select(&:directory?)).to_a | true |
Other | Homebrew | brew | d97798e805084ad70a774b44f2e8d2081dafc6be.json | Update RBI files for sorbet. | Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi | @@ -4134,8 +4134,6 @@ class Pathname
include ::MachOShim
def fnmatch?(*arg); end
- def glob(*arg); end
-
def make_symlink(arg); end
end
| false |
Other | Homebrew | brew | 188265544bc5a65e80bfee31b0124794f7ae1add.json | cmd/vendor-install: add arm64 macOS portable-ruby build | Library/Homebrew/cmd/vendor-install.sh | @@ -22,6 +22,10 @@ then
then
ruby_FILENAME="portable-ruby-2.6.8.yosemite.bottle.tar.gz"
ruby_SHA="0cb1cc7af109437fe0e020c9f3b7b95c3c709b140bde9f991ad2c1433496dd42"
+ elif [[ "${HOMEBREW_PROCESSOR}" == "arm64" ]]
+ then
+ ruby_FILENAME="portable-ruby-2.6.8.arm64_big_sur.bottle.tar.gz"
+ ruby_SHA="f2d5cab5a4dd49e5b3de780a3cd0a1f61642fea247d1c25aa40cd43f1be290b5"
fi
elif [[ -n "${HOMEBREW_LINUX}" ]]
then | false |
Other | Homebrew | brew | d0f6f7d52b22f813d428077ae68f297543416b47.json | Require Ruby 2.6.8 | Library/Homebrew/brew.sh | @@ -458,9 +458,7 @@ then
# Set a variable when the macOS system Ruby is new enough to avoid spawning
# a Ruby process unnecessarily.
- # On Catalina the system Ruby is technically new enough but don't allow it:
- # https://github.com/Homebrew/brew/issues/9410
- if [[ "${HOMEBREW_MACOS_VERSION_NUMERIC}" -lt "101600" ]]
+ if [[ "${HOMEBREW_MACOS_VERSION_NUMERIC}" -lt "120000" ]]
then
unset HOMEBREW_MACOS_SYSTEM_RUBY_NEW_ENOUGH
else | true |
Other | Homebrew | brew | d0f6f7d52b22f813d428077ae68f297543416b47.json | Require Ruby 2.6.8 | Library/Homebrew/extend/os/mac/diagnostic.rb | @@ -201,19 +201,12 @@ def check_if_xcode_needs_clt_installed
end
def check_ruby_version
- # TODO: require 2.6.8 for everyone once enough have updated to Monterey
- required_version = if MacOS.version >= :monterey ||
- ENV["HOMEBREW_RUBY_PATH"].to_s.include?("/vendor/portable-ruby/")
- "2.6.8"
- else
- HOMEBREW_REQUIRED_RUBY_VERSION
- end
- return if RUBY_VERSION == required_version
+ return if RUBY_VERSION == HOMEBREW_REQUIRED_RUBY_VERSION
return if Homebrew::EnvConfig.developer? && OS::Mac.version.prerelease?
<<~EOS
Ruby version #{RUBY_VERSION} is unsupported on macOS #{MacOS.version}. Homebrew
- is developed and tested on Ruby #{required_version}, and may not work correctly
+ is developed and tested on Ruby #{HOMEBREW_REQUIRED_RUBY_VERSION}, and may not work correctly
on other Rubies. Patches are accepted as long as they don't cause breakage
on supported Rubies.
EOS | true |
Other | Homebrew | brew | d0f6f7d52b22f813d428077ae68f297543416b47.json | Require Ruby 2.6.8 | Library/Homebrew/utils/ruby.sh | @@ -1,4 +1,4 @@
-export HOMEBREW_REQUIRED_RUBY_VERSION=2.6.3
+export HOMEBREW_REQUIRED_RUBY_VERSION=2.6.8
# HOMEBREW_LIBRARY is from the user environment
# shellcheck disable=SC2154 | true |
Other | Homebrew | brew | 887a1408b00dd0688427a205e6ce746fa2f90fb6.json | Update RBI files for unparser. | Library/Homebrew/sorbet/rbi/gems/unparser@0.6.1.rbi | @@ -1,9 +1,9 @@
+# typed: true
+
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `unparser` gem.
# Please instead update this file by running `bin/tapioca gem unparser`.
-# typed: true
-
module Unparser
class << self
def buffer(source, identification = T.unsafe(nil)); end
@@ -1489,6 +1489,8 @@ module Unparser::NodeHelpers
def n_if?(node); end
def n_in_pattern?(node); end
def n_int?(node); end
+ def n_kwarg?(node); end
+ def n_kwargs?(node); end
def n_kwsplat?(node); end
def n_lambda?(node); end
def n_match_rest?(node); end | false |
Other | Homebrew | brew | f241f0d12e906bb12de72be2e1dfa525ed49345e.json | Update RBI files for rubocop-rspec. | Library/Homebrew/sorbet/rbi/gems/rubocop-rspec@2.6.0.rbi | @@ -1,9 +1,9 @@
+# typed: true
+
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `rubocop-rspec` gem.
# Please instead update this file by running `bin/tapioca gem rubocop-rspec`.
-# typed: true
-
module RuboCop; end
module RuboCop::Cop; end
module RuboCop::Cop::Layout; end
@@ -1505,11 +1505,13 @@ RuboCop::Cop::RSpec::Variable::Subjects = RuboCop::RSpec::Language::Subjects
class RuboCop::Cop::RSpec::VariableDefinition < ::RuboCop::Cop::RSpec::Base
include ::RuboCop::Cop::ConfigurableEnforcedStyle
include ::RuboCop::Cop::RSpec::Variable
+ extend ::RuboCop::Cop::AutoCorrector
def on_send(node); end
private
+ def correct_variable(variable); end
def string?(node); end
def style_violation?(variable); end
def symbol?(node); end
@@ -1585,6 +1587,8 @@ module RuboCop::RSpec; end
class RuboCop::RSpec::AlignLetBrace
include ::RuboCop::RSpec::Language
+ include ::RuboCop::PathUtil
+ include ::RuboCop::Cop::Util
def initialize(root, token); end
| false |
Other | Homebrew | brew | 66f5a2628473d7a27c68fe11e239885c279e8256.json | Update RBI files for rubocop-ast. | Library/Homebrew/sorbet/rbi/gems/rubocop-ast@1.13.0.rbi | @@ -1,9 +1,9 @@
+# typed: true
+
# DO NOT EDIT MANUALLY
# This is an autogenerated file for types exported from the `rubocop-ast` gem.
# Please instead update this file by running `bin/tapioca gem rubocop-ast`.
-# typed: true
-
module RuboCop; end
module RuboCop::AST
@@ -225,6 +225,7 @@ module RuboCop::AST::CollectionNode
def pack(*args, &block); end
def partition(*args, &block); end
def permutation(*args, &block); end
+ def place(*args, &block); end
def pop(*args, &block); end
def prepend(*args, &block); end
def product(*args, &block); end
@@ -1429,7 +1430,6 @@ RuboCop::AST::NodePattern::Sets::SET_FIRST_LAST__ETC = T.let(T.unsafe(nil), Set)
RuboCop::AST::NodePattern::Sets::SET_FIXNUM_BIGNUM = T.let(T.unsafe(nil), Set)
RuboCop::AST::NodePattern::Sets::SET_FLATTEN_FLATTEN = T.let(T.unsafe(nil), Set)
RuboCop::AST::NodePattern::Sets::SET_FORMAT_SPRINTF_PRINTF = T.let(T.unsafe(nil), Set)
-RuboCop::AST::NodePattern::Sets::SET_GEMCUTTER_RUBYGEMS_RUBYFORGE = T.let(T.unsafe(nil), Set)
RuboCop::AST::NodePattern::Sets::SET_GET_POST_PUT_ETC = T.let(T.unsafe(nil), Set)
RuboCop::AST::NodePattern::Sets::SET_GSUB_GSUB = T.let(T.unsafe(nil), Set)
RuboCop::AST::NodePattern::Sets::SET_GSUB_GSUB_SUB_SUB = T.let(T.unsafe(nil), Set) | false |
Other | Homebrew | brew | 9438dc94e3724bcf2456c1d550e3386ae0bc9d94.json | search: split missing formula help into its own method | Library/Homebrew/cmd/search.rb | @@ -143,14 +143,21 @@ def search_names(query, string_or_regex, args)
count = all_formulae.count + all_casks.count
- if $stdout.tty? && (reason = MissingFormula.reason(query, silent: true)) && local_casks.exclude?(query)
- if count.positive?
- puts
- puts "If you meant #{query.inspect} specifically:"
- end
- puts reason
- end
+ print_missing_formula_help(query, count.positive?) if local_casks.exclude?(query)
odie "No formulae or casks found for #{query.inspect}." if count.zero?
end
+
+ def print_missing_formula_help(query, found_matches)
+ return unless $stdout.tty?
+
+ reason = MissingFormula.reason(query, silent: true)
+ return if reason.nil?
+
+ if found_matches
+ puts
+ puts "If you meant #{query.inspect} specifically:"
+ end
+ puts reason
+ end
end | false |
Other | Homebrew | brew | b86fdfeb09e55678f5d35a738f55d7bc04dbfd54.json | style: use long options for `patch` command | Library/Homebrew/style.rb | @@ -167,7 +167,7 @@ def run_rubocop(files, output_type,
def run_shellcheck(files, output_type, fix: false)
files = shell_scripts if files.blank?
- files = files.map(&:realpath)
+ files = files.map(&:realpath) # use absolute file paths
args = [
"--shell=bash",
@@ -181,8 +181,13 @@ def run_shellcheck(files, output_type, fix: false)
]
if fix
+ # patch options:
+ # --get=0 : suppress environment variable `PATCH_GET`, ignore RCS, ClearCase, Perforce, and SCCS
+ # --force : we know what we are doing, force apply patches
+ # --directory=/ : change to root directory, since we use absolute file paths
+ # --strip=0 : do not strip path prefixes, since we are at root directory
+ patch_command = %w[patch --get=0 --force --directory=/ --strip=0]
patches = system_command(shellcheck, args: ["--format=diff", *args]).stdout
- patch_command = %w[patch -g 0 -f -d / -p0]
Utils.popen_write(*patch_command) { |p| p.write(patches) }
end
| false |
Other | Homebrew | brew | 800bd93c5aa719f28b572c016d4f935519e6e48f.json | .vscode: add extension editorconfig | .vscode/extensions.json | @@ -5,6 +5,7 @@
"rebornix.ruby",
"wingrunr21.vscode-ruby",
"timonwong.shellcheck",
- "foxundermoon.shell-format"
+ "foxundermoon.shell-format",
+ "editorconfig.editorconfig"
]
} | false |
Other | Homebrew | brew | 0331cbeda3b0093b1554e31eb7e66dbaf7ac0b8f.json | utils/shfmt.sh: use utils/shfmt.sh as shell script formmatter | .vscode/settings.json | @@ -13,5 +13,9 @@
"--external-sources",
"--source-path=${workspaceFolder}/Library"
],
- "shellformat.flag": "-i 2 -ci"
+ "shellformat.effectLanguages": [
+ "shellscript"
+ ],
+ "shellformat.path": "${workspaceFolder}/Library/Homebrew/utils/shfmt.sh",
+ "shellformat.flag": "-i 2 -ci -ln bash"
} | true |
Other | Homebrew | brew | 0331cbeda3b0093b1554e31eb7e66dbaf7ac0b8f.json | utils/shfmt.sh: use utils/shfmt.sh as shell script formmatter | Library/Homebrew/utils/shfmt.sh | @@ -35,6 +35,10 @@ then
if [[ -x "$(PATH="${HOMEBREW_PATH}" command -v diff)" ]]
then
DIFF="$(PATH="${HOMEBREW_PATH}" command -v diff)" # fall back to `diff` in PATH without coloring
+ elif [[ -z "${HOMEBREW_PATH}" && -x "$(command -v diff)" ]]
+ then
+ # HOMEBREW_PATH may unset if shfmt.sh is called by vscode
+ DIFF="$(command -v diff)" # fall back to `diff` in PATH without coloring
else
odie "${0##*/}: Please install diff by running \`brew install diffutils\`."
fi
@@ -81,9 +85,11 @@ do
done
unset file
+STDIN=''
if [[ "${#FILES[@]}" == 0 ]]
then
- exit
+ FILES=(/dev/stdin)
+ STDIN=1
fi
###
@@ -334,27 +340,41 @@ align_multiline_switch_cases() {
format() {
local file="$1"
local tempfile
- if [[ ! -f "${file}" || ! -r "${file}" ]]
- then
- onoe "File \"${file}\" is not readable."
- return 1
- fi
- tempfile="$(dirname "${file}")/.${file##*/}.temp"
- trap 'rm -f "${tempfile}" 2>/dev/null' RETURN
- cp -af "${file}" "${tempfile}"
-
- if [[ ! -f "${tempfile}" || ! -w "${tempfile}" ]]
+ if [[ -n "${STDIN}" ]]
then
- onoe "File \"${tempfile}\" is not writable."
- return 1
+ tempfile="$(mktemp)"
+ else
+ if [[ ! -f "${file}" || ! -r "${file}" ]]
+ then
+ onoe "File \"${file}\" is not readable."
+ return 1
+ fi
+
+ tempfile="$(dirname "${file}")/.${file##*/}.temp"
+ cp -af "${file}" "${tempfile}"
fi
+ trap 'rm -f "${tempfile}" 2>/dev/null' RETURN
# Format with `shfmt` first
- if ! "${SHFMT}" -w "${SHFMT_ARGS[@]}" "${tempfile}"
+ if [[ -z "${STDIN}" ]]
then
- onoe "Failed to run \`shfmt\` for file \"${file}\"."
- return 2
+ if [[ ! -f "${tempfile}" || ! -w "${tempfile}" ]]
+ then
+ onoe "File \"${tempfile}\" is not writable."
+ return 1
+ fi
+ if ! "${SHFMT}" -w "${SHFMT_ARGS[@]}" "${tempfile}"
+ then
+ onoe "Failed to run \`shfmt\` for file \"${file}\"."
+ return 2
+ fi
+ else
+ if ! "${SHFMT}" "${SHFMT_ARGS[@]}" >"${tempfile}"
+ then
+ onoe "Failed to run \`shfmt\` for file \"${file}\"."
+ return 2
+ fi
fi
# Fail fast when forbidden styles detected
@@ -364,6 +384,12 @@ format() {
wrap_then_do "${file}" "${tempfile}"
align_multiline_switch_cases "${file}" "${tempfile}"
+ if [[ -n "${STDIN}" ]]
+ then
+ cat "${tempfile}"
+ return 0
+ fi
+
if ! "${DIFF}" -q "${file}" "${tempfile}" &>/dev/null
then
if [[ -n "${INPLACE}" ]] | true |
Other | Homebrew | brew | 67c619d4f28b27ba9e33fadc149123fe237df4a1.json | style: use popen_write to apply patches | Library/Homebrew/style.rb | @@ -181,8 +181,9 @@ def run_shellcheck(files, output_type, fix: false)
]
if fix
- patch = system_command shellcheck, args: ["--format=diff", *args]
- system_command "patch", args: ["-d", "/", "-p0"], input: patch.stdout
+ patches = system_command(shellcheck, args: ["--format=diff", *args]).stdout
+ patch_command = %w[patch -g 0 -f -d / -p0]
+ Utils.popen_write(*patch_command) { |p| p.write(patches) }
end
case output_type | false |
Other | Homebrew | brew | 38ebaac869bacedd89aa885b0dadafa59874774d.json | dev-cmd/bottle: fix pkg_version comparison on merge | Library/Homebrew/dev-cmd/bottle.rb | @@ -626,9 +626,15 @@ def merge(args:)
path = HOMEBREW_REPOSITORY/bottle_hash["formula"]["path"]
formula = Formulary.factory(path)
+
old_bottle_spec = formula.bottle_specification
+ old_pkg_version = formula.pkg_version
+ FormulaVersions.new(formula).formula_at_revision("origin/HEAD") do |upstream_f|
+ old_pkg_version = upstream_f.pkg_version
+ end
+
old_bottle_spec_matches = old_bottle_spec &&
- bottle_hash["formula"]["pkg_version"] == formula.pkg_version.to_s &&
+ bottle_hash["formula"]["pkg_version"] == old_pkg_version.to_s &&
bottle.root_url == old_bottle_spec.root_url &&
old_bottle_spec.collector.tags.present?
| false |
Other | Homebrew | brew | cf7def0c68903814c6b4e04a55fe8f3cb3f5605e.json | style: apply shellcheck autofix | Library/Homebrew/cmd/update.sh | @@ -657,7 +657,7 @@ EOS
if [[ "${UPSTREAM_SHA_HTTP_CODE}" == "404" ]]
then
- TAP="${DIR#${HOMEBREW_LIBRARY}/Taps/}"
+ TAP="${DIR#"${HOMEBREW_LIBRARY}"/Taps/}"
echo "${TAP} does not exist! Run \`brew untap ${TAP}\` to remove it." >>"${update_failed_file}"
else
echo "Fetching ${DIR} failed!" >>"${update_failed_file}" | true |
Other | Homebrew | brew | cf7def0c68903814c6b4e04a55fe8f3cb3f5605e.json | style: apply shellcheck autofix | Library/Homebrew/completions/bash.erb | @@ -105,7 +105,7 @@ __brew_complete_tapped() {
for dir in "${taplib}"/*/*
do
[[ -d "${dir}" ]] || continue
- dir="${dir#${taplib}/}"
+ dir="${dir#"${taplib}"/}"
dir="${dir/homebrew-/}"
taps="${taps} ${dir}"
done | true |
Other | Homebrew | brew | cf7def0c68903814c6b4e04a55fe8f3cb3f5605e.json | style: apply shellcheck autofix | bin/brew | @@ -2,6 +2,7 @@
# Fail fast with concise message when not using bash
# Single brackets is needed here for POSIX compatibility
+# shellcheck disable=SC2292
if [ -z "${BASH_VERSION:-}" ]
then
echo "Error: Bash is required to run brew." >&2 | true |
Other | Homebrew | brew | cf7def0c68903814c6b4e04a55fe8f3cb3f5605e.json | style: apply shellcheck autofix | completions/bash/brew | @@ -92,7 +92,7 @@ __brew_complete_tapped() {
for dir in "${taplib}"/*/*
do
[[ -d "${dir}" ]] || continue
- dir="${dir#${taplib}/}"
+ dir="${dir#"${taplib}"/}"
dir="${dir/homebrew-/}"
taps="${taps} ${dir}"
done | true |
Other | Homebrew | brew | 00ebd8581ff3cdb1ac547d3a97cda3cb3a0aa012.json | style: apply shellcheck autofix | Library/Homebrew/cmd/update.sh | @@ -657,7 +657,7 @@ EOS
if [[ "${UPSTREAM_SHA_HTTP_CODE}" == "404" ]]
then
- TAP="${DIR#${HOMEBREW_LIBRARY}/Taps/}"
+ TAP="${DIR#"${HOMEBREW_LIBRARY}"/Taps/}"
echo "${TAP} does not exist! Run \`brew untap ${TAP}\` to remove it." >>"${update_failed_file}"
else
echo "Fetching ${DIR} failed!" >>"${update_failed_file}" | true |
Other | Homebrew | brew | 00ebd8581ff3cdb1ac547d3a97cda3cb3a0aa012.json | style: apply shellcheck autofix | Library/Homebrew/completions/bash.erb | @@ -105,7 +105,7 @@ __brew_complete_tapped() {
for dir in "${taplib}"/*/*
do
[[ -d "${dir}" ]] || continue
- dir="${dir#${taplib}/}"
+ dir="${dir#"${taplib}"/}"
dir="${dir/homebrew-/}"
taps="${taps} ${dir}"
done | true |
Other | Homebrew | brew | 00ebd8581ff3cdb1ac547d3a97cda3cb3a0aa012.json | style: apply shellcheck autofix | bin/brew | @@ -2,6 +2,7 @@
# Fail fast with concise message when not using bash
# Single brackets is needed here for POSIX compatibility
+# shellcheck disable=SC2292
if [ -z "${BASH_VERSION:-}" ]
then
echo "Error: Bash is required to run brew." >&2 | true |
Other | Homebrew | brew | 00ebd8581ff3cdb1ac547d3a97cda3cb3a0aa012.json | style: apply shellcheck autofix | completions/bash/brew | @@ -92,7 +92,7 @@ __brew_complete_tapped() {
for dir in "${taplib}"/*/*
do
[[ -d "${dir}" ]] || continue
- dir="${dir#${taplib}/}"
+ dir="${dir#"${taplib}"/}"
dir="${dir/homebrew-/}"
taps="${taps} ${dir}"
done | true |
Other | Homebrew | brew | 25bc1d88604ad396b9c63e82d21c64021562c4f7.json | Service: add interval support | Library/Homebrew/service.rb | @@ -9,14 +9,14 @@ class Service
extend T::Sig
extend Forwardable
- RUN_TYPE_IMMEDIATE = "immediate"
- RUN_TYPE_INTERVAL = "interval"
- RUN_TYPE_CRON = "cron"
+ RUN_TYPE_IMMEDIATE = :immediate
+ RUN_TYPE_INTERVAL = :interval
+ RUN_TYPE_CRON = :cron
- PROCESS_TYPE_BACKGROUND = "background"
- PROCESS_TYPE_STANDARD = "standard"
- PROCESS_TYPE_INTERACTIVE = "interactive"
- PROCESS_TYPE_ADAPTIVE = "adaptive"
+ PROCESS_TYPE_BACKGROUND = :background
+ PROCESS_TYPE_STANDARD = :standard
+ PROCESS_TYPE_INTERACTIVE = :interactive
+ PROCESS_TYPE_ADAPTIVE = :adaptive
# sig { params(formula: Formula).void }
def initialize(formula, &block)
@@ -124,35 +124,47 @@ def restart_delay(value = nil)
end
end
- sig { params(type: T.nilable(String)).returns(T.nilable(String)) }
- def process_type(type = nil)
- case T.unsafe(type)
+ sig { params(value: T.nilable(Symbol)).returns(T.nilable(Symbol)) }
+ def process_type(value = nil)
+ case T.unsafe(value)
when nil
@process_type
- when PROCESS_TYPE_BACKGROUND, PROCESS_TYPE_STANDARD, PROCESS_TYPE_INTERACTIVE, PROCESS_TYPE_ADAPTIVE
- @process_type = type.to_s
- when String
+ when :background, :standard, :interactive, :adaptive
+ @process_type = value
+ when Symbol
raise TypeError, "Service#process_type allows: "\
"'#{PROCESS_TYPE_BACKGROUND}'/'#{PROCESS_TYPE_STANDARD}'/"\
"'#{PROCESS_TYPE_INTERACTIVE}'/'#{PROCESS_TYPE_ADAPTIVE}'"
else
- raise TypeError, "Service#process_type expects a String"
+ raise TypeError, "Service#process_type expects a Symbol"
end
end
- sig { params(type: T.nilable(T.any(String, Symbol))).returns(T.nilable(String)) }
- def run_type(type = nil)
- case T.unsafe(type)
+ sig { params(value: T.nilable(Symbol)).returns(T.nilable(Symbol)) }
+ def run_type(value = nil)
+ case T.unsafe(value)
when nil
@run_type
- when "immediate", :immediate
- @run_type = type.to_s
- when RUN_TYPE_INTERVAL, RUN_TYPE_CRON
- raise TypeError, "Service#run_type does not support timers"
- when String
+ when :immediate, :interval
+ @run_type = value
+ when :cron
+ raise TypeError, "Service#run_type does not support cron"
+ when Symbol
raise TypeError, "Service#run_type allows: '#{RUN_TYPE_IMMEDIATE}'/'#{RUN_TYPE_INTERVAL}'/'#{RUN_TYPE_CRON}'"
else
- raise TypeError, "Service#run_type expects a string"
+ raise TypeError, "Service#run_type expects a Symbol"
+ end
+ end
+
+ sig { params(value: T.nilable(Integer)).returns(T.nilable(Integer)) }
+ def interval(value = nil)
+ case T.unsafe(value)
+ when nil
+ @interval
+ when Integer
+ @interval = value
+ else
+ raise TypeError, "Service#interval expects an Integer"
end
end
@@ -205,16 +217,18 @@ def manual_command
# @return [String]
sig { returns(String) }
def to_plist
+ # command needs to be first because it initializes all other values
base = {
Label: @formula.plist_name,
- RunAtLoad: @run_type == RUN_TYPE_IMMEDIATE,
ProgramArguments: command,
+ RunAtLoad: @run_type == RUN_TYPE_IMMEDIATE,
}
base[:KeepAlive] = @keep_alive if @keep_alive == true
base[:LegacyTimers] = @macos_legacy_timers if @macos_legacy_timers == true
base[:TimeOut] = @restart_delay if @restart_delay.present?
- base[:ProcessType] = @process_type.capitalize if @process_type.present?
+ base[:ProcessType] = @process_type.to_s.capitalize if @process_type.present?
+ base[:StartInterval] = @interval if @interval.present? && @run_type == RUN_TYPE_INTERVAL
base[:WorkingDirectory] = @working_dir if @working_dir.present?
base[:RootDirectory] = @root_dir if @root_dir.present?
base[:StandardInPath] = @input_path if @input_path.present? | true |
Other | Homebrew | brew | 25bc1d88604ad396b9c63e82d21c64021562c4f7.json | Service: add interval support | Library/Homebrew/test/service_spec.rb | @@ -32,6 +32,28 @@
end
end
+ describe "#run_type" do
+ it "throws for cron type" do
+ f.class.service do
+ run opt_bin/"beanstalkd"
+ run_type :cron
+ end
+
+ expect { f.service.manual_command }.to raise_error TypeError, "Service#run_type does not support cron"
+ end
+
+ it "throws for unexpected type" do
+ f.class.service do
+ run opt_bin/"beanstalkd"
+ run_type :cow
+ end
+
+ expect {
+ f.service.manual_command
+ }.to raise_error TypeError, "Service#run_type allows: 'immediate'/'interval'/'cron'"
+ end
+ end
+
describe "#manual_command" do
it "returns valid manual_command" do
f.class.service do
@@ -76,8 +98,9 @@
root_dir var
working_dir var
keep_alive true
- process_type "interactive"
+ process_type :interactive
restart_delay 30
+ interval 5
macos_legacy_timers true
end
@@ -154,6 +177,35 @@
EOS
expect(plist).to eq(plist_expect)
end
+
+ it "returns valid interval plist" do
+ f.class.service do
+ run opt_bin/"beanstalkd"
+ run_type :interval
+ interval 5
+ end
+
+ plist = f.service.to_plist
+ plist_expect = <<~EOS
+ <?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">
+ <plist version="1.0">
+ <dict>
+ \t<key>Label</key>
+ \t<string>homebrew.mxcl.formula_name</string>
+ \t<key>ProgramArguments</key>
+ \t<array>
+ \t\t<string>#{HOMEBREW_PREFIX}/opt/formula_name/bin/beanstalkd</string>
+ \t</array>
+ \t<key>RunAtLoad</key>
+ \t<false/>
+ \t<key>StartInterval</key>
+ \t<integer>5</integer>
+ </dict>
+ </plist>
+ EOS
+ expect(plist).to eq(plist_expect)
+ end
end
describe "#to_systemd_unit" do
@@ -168,7 +220,7 @@
root_dir var
working_dir var
keep_alive true
- process_type "interactive"
+ process_type :interactive
restart_delay 30
macos_legacy_timers true
end | true |
Other | Homebrew | brew | 4836ea0ba2119619697af87edf5fdb2280e90238.json | Remove XQuartz handling | Library/Homebrew/cask/exceptions.rb | @@ -153,24 +153,6 @@ def to_s
end
end
- # Error when a cask depends on X11.
- #
- # @api private
- class CaskX11DependencyError < AbstractCaskErrorWithToken
- extend T::Sig
-
- sig { returns(String) }
- def to_s
- <<~EOS
- Cask '#{token}' requires XQuartz/X11, which can be installed using Homebrew Cask by running:
- #{Formatter.identifier("brew install --cask xquartz")}
-
- or manually, by downloading the package from:
- #{Formatter.url("https://www.xquartz.org/")}
- EOS
- end
- end
-
# Error when there is a cyclic cask dependency.
#
# @api private | true |
Other | Homebrew | brew | 4836ea0ba2119619697af87edf5fdb2280e90238.json | Remove XQuartz handling | Library/Homebrew/extend/ENV/super.rb | @@ -20,7 +20,7 @@ module Superenv
include SharedEnvExtension
# @private
- attr_accessor :keg_only_deps, :deps, :run_time_deps, :x11
+ attr_accessor :keg_only_deps, :deps, :run_time_deps
sig { params(base: Superenv).void }
def self.extended(base)
@@ -168,17 +168,11 @@ def determine_pkg_config_libdir
).existing
end
- sig { returns(T::Array[Pathname]) }
- def homebrew_extra_aclocal_paths
- []
- end
-
sig { returns(T.nilable(PATH)) }
def determine_aclocal_path
PATH.new(
keg_only_deps.map { |d| d.opt_share/"aclocal" },
HOMEBREW_PREFIX/"share/aclocal",
- homebrew_extra_aclocal_paths,
).existing
end
| true |
Other | Homebrew | brew | 4836ea0ba2119619697af87edf5fdb2280e90238.json | Remove XQuartz handling | Library/Homebrew/extend/os/mac/diagnostic.rb | @@ -268,17 +268,6 @@ def check_xcode_license_approved
EOS
end
- def check_xquartz_up_to_date
- return unless MacOS::XQuartz.outdated?
-
- <<~EOS
- Your XQuartz (#{MacOS::XQuartz.version}) is outdated.
- Please install XQuartz #{MacOS::XQuartz.latest_version} (or delete the current version).
- XQuartz can be updated using Homebrew Cask by running:
- brew reinstall xquartz
- EOS
- end
-
def check_filesystem_case_sensitive
dirs_to_check = [
HOMEBREW_PREFIX, | true |
Other | Homebrew | brew | 4836ea0ba2119619697af87edf5fdb2280e90238.json | Remove XQuartz handling | Library/Homebrew/extend/os/mac/extend/ENV/super.rb | @@ -21,34 +21,16 @@ def bin
end
end
- alias x11? x11
-
- undef homebrew_extra_paths,
- homebrew_extra_pkg_config_paths, homebrew_extra_aclocal_paths,
+ undef homebrew_extra_pkg_config_paths,
homebrew_extra_isystem_paths, homebrew_extra_library_paths,
homebrew_extra_cmake_include_paths,
homebrew_extra_cmake_library_paths,
homebrew_extra_cmake_frameworks_paths,
determine_cccfg
- def homebrew_extra_paths
- paths = []
- paths << MacOS::XQuartz.bin if x11?
- paths
- end
-
# @private
def homebrew_extra_pkg_config_paths
- paths = \
- ["/usr/lib/pkgconfig", "#{HOMEBREW_LIBRARY}/Homebrew/os/mac/pkgconfig/#{MacOS.version}"]
- paths << "#{MacOS::XQuartz.lib}/pkgconfig" << "#{MacOS::XQuartz.share}/pkgconfig" if x11?
- paths
- end
-
- def homebrew_extra_aclocal_paths
- paths = []
- paths << "#{MacOS::XQuartz.share}/aclocal" if x11?
- paths
+ ["/usr/lib/pkgconfig", "#{HOMEBREW_LIBRARY}/Homebrew/os/mac/pkgconfig/#{MacOS.version}"]
end
# @private
@@ -64,7 +46,6 @@ def homebrew_extra_isystem_paths
paths = []
paths << "#{self["HOMEBREW_SDKROOT"]}/usr/include/libxml2" if libxml2_include_needed?
paths << "#{self["HOMEBREW_SDKROOT"]}/usr/include/apache2" if MacOS::Xcode.without_clt?
- paths << MacOS::XQuartz.include.to_s << "#{MacOS::XQuartz.include}/freetype2" if x11?
paths << "#{self["HOMEBREW_SDKROOT"]}/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers"
paths
end
@@ -75,7 +56,6 @@ def homebrew_extra_library_paths
paths << "#{self["HOMEBREW_SDKROOT"]}/usr/lib"
paths << Formula["llvm"].opt_lib.to_s
end
- paths << MacOS::XQuartz.lib.to_s if x11?
paths << "#{self["HOMEBREW_SDKROOT"]}/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries"
paths
end
@@ -84,16 +64,12 @@ def homebrew_extra_cmake_include_paths
paths = []
paths << "#{self["HOMEBREW_SDKROOT"]}/usr/include/libxml2" if libxml2_include_needed?
paths << "#{self["HOMEBREW_SDKROOT"]}/usr/include/apache2" if MacOS::Xcode.without_clt?
- paths << MacOS::XQuartz.include.to_s << "#{MacOS::XQuartz.include}/freetype2" if x11?
paths << "#{self["HOMEBREW_SDKROOT"]}/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers"
paths
end
def homebrew_extra_cmake_library_paths
- paths = []
- paths << MacOS::XQuartz.lib.to_s if x11?
- paths << "#{self["HOMEBREW_SDKROOT"]}/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries"
- paths
+ ["#{self["HOMEBREW_SDKROOT"]}/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries"]
end
def homebrew_extra_cmake_frameworks_paths | true |
Other | Homebrew | brew | 4836ea0ba2119619697af87edf5fdb2280e90238.json | Remove XQuartz handling | Library/Homebrew/extend/os/mac/system_config.rb | @@ -38,16 +38,11 @@ def clt
@clt ||= MacOS::CLT.version if MacOS::CLT.installed?
end
- def xquartz
- @xquartz ||= "#{MacOS::XQuartz.version} => #{describe_path(MacOS::XQuartz.prefix)}" if MacOS::XQuartz.installed?
- end
-
def dump_verbose_config(f = $stdout)
dump_generic_verbose_config(f)
f.puts "macOS: #{MacOS.full_version}-#{kernel}"
f.puts "CLT: #{clt || "N/A"}"
f.puts "Xcode: #{xcode || "N/A"}"
- f.puts "XQuartz: #{xquartz}" if xquartz
f.puts "Rosetta 2: #{Hardware::CPU.in_rosetta2?}" if Hardware::CPU.physical_cpu_arm64?
end
end | true |
Other | Homebrew | brew | 4836ea0ba2119619697af87edf5fdb2280e90238.json | Remove XQuartz handling | Library/Homebrew/os/mac.rb | @@ -3,7 +3,6 @@
require "os/mac/version"
require "os/mac/xcode"
-require "os/mac/xquartz"
require "os/mac/sdk"
require "os/mac/keg"
| true |
Other | Homebrew | brew | 4836ea0ba2119619697af87edf5fdb2280e90238.json | Remove XQuartz handling | Library/Homebrew/os/mac/xquartz.rb | @@ -1,129 +0,0 @@
-# typed: true
-# frozen_string_literal: true
-
-module OS
- module Mac
- # Helper module for querying XQuartz information.
- #
- # @api private
- module XQuartz
- extend T::Sig
-
- module_function
-
- DEFAULT_BUNDLE_PATH = Pathname("/Applications/Utilities/XQuartz.app").freeze
- NEW_BUNDLE_PKG_ID = "org.xquartz.X11"
- FORGE_BUNDLE_ID = "org.macosforge.xquartz.X11"
- FORGE_PKG_ID = "org.macosforge.xquartz.pkg"
-
- PKGINFO_VERSION_MAP = {
- "2.6.34" => "2.6.3",
- "2.7.4" => "2.7.0",
- "2.7.14" => "2.7.1",
- "2.7.28" => "2.7.2",
- "2.7.32" => "2.7.3",
- "2.7.43" => "2.7.4",
- "2.7.50" => "2.7.5_rc1",
- "2.7.51" => "2.7.5_rc2",
- "2.7.52" => "2.7.5_rc3",
- "2.7.53" => "2.7.5_rc4",
- "2.7.54" => "2.7.5",
- "2.7.61" => "2.7.6",
- "2.7.73" => "2.7.7",
- "2.7.86" => "2.7.8",
- "2.7.94" => "2.7.9",
- "2.7.108" => "2.7.10",
- "2.7.112" => "2.7.11",
- }.freeze
-
- # This returns the version number of XQuartz, not of the upstream X.org.
- # The X11.app distributed by Apple is also XQuartz, and therefore covered
- # by this method.
- def version
- if @version ||= detect_version
- ::Version.new @version
- else
- ::Version::NULL
- end
- end
-
- def detect_version
- if (path = bundle_path) && path.exist? && (version = version_from_mdls(path))
- version
- else
- version_from_pkgutil
- end
- end
-
- sig { returns(String) }
- def minimum_version
- # Update this a little later than latest_version to give people
- # time to upgrade.
- "2.7.11"
- end
-
- # @see https://www.xquartz.org/releases/index.html
- sig { returns(String) }
- def latest_version
- "2.7.11"
- end
-
- def bundle_path
- # Use the default location if it exists.
- return DEFAULT_BUNDLE_PATH if DEFAULT_BUNDLE_PATH.exist?
-
- # Ask Spotlight where XQuartz is. If the user didn't install XQuartz
- # in the conventional place, this is our only option.
- MacOS.app_with_bundle_id(NEW_BUNDLE_PKG_ID, FORGE_BUNDLE_ID)
- end
-
- def version_from_mdls(path)
- version = Utils.popen_read(
- "/usr/bin/mdls", "-raw", "-nullMarker", "", "-name", "kMDItemVersion", path.to_s
- ).strip
- version unless version.empty?
- end
-
- # Upstream XQuartz *does* have a pkg-info entry, so if we can't get it
- # from mdls, we can try pkgutil. This is very slow.
- def version_from_pkgutil
- [NEW_BUNDLE_PKG_ID, FORGE_PKG_ID].each do |id|
- str = MacOS.pkgutil_info(id)[/version: (\d\.\d\.\d+)$/, 1]
- return PKGINFO_VERSION_MAP.fetch(str, str) if str
- end
-
- nil
- end
-
- def prefix
- @prefix ||= Pathname.new("/opt/X11") if Pathname.new("/opt/X11/lib/libpng.dylib").exist?
- end
-
- def installed?
- !version.null? && !prefix.nil?
- end
-
- def outdated?
- return false unless installed?
-
- version < latest_version
- end
-
- def bin
- prefix/"bin"
- end
-
- def include
- prefix/"include"
- end
-
- def lib
- prefix/"lib"
- end
-
- def share
- prefix/"share"
- end
- end
- end
-end | true |
Other | Homebrew | brew | 4836ea0ba2119619697af87edf5fdb2280e90238.json | Remove XQuartz handling | Library/Homebrew/rubocops/lines.rb | @@ -55,7 +55,6 @@ def audit_formula(_node, _class_node, _parent_class_node, _body_node)
"# if this fails, try separate make/make install steps",
"# The URL of the archive",
"## Naming --",
- "# if your formula requires any X11/XQuartz components",
"# if your formula fails when building in parallel",
"# Remove unrecognized options if warned by configure",
'# system "cmake', | true |
Other | Homebrew | brew | 4836ea0ba2119619697af87edf5fdb2280e90238.json | Remove XQuartz handling | Library/Homebrew/test/cask/dsl_spec.rb | @@ -409,16 +409,6 @@ def caveats
end
end
- describe "depends_on x11" do
- context "with invalid depends_on x11 value" do
- let(:token) { "invalid/invalid-depends-on-x11-value" }
-
- it "refuses to load" do
- expect { cask }.to raise_error(Cask::CaskInvalidError)
- end
- end
- end
-
describe "conflicts_with stanza" do
context "when valid" do
let(:token) { "with-conflicts-with" } | true |
Other | Homebrew | brew | 4836ea0ba2119619697af87edf5fdb2280e90238.json | Remove XQuartz handling | Library/Homebrew/test/cask/installer_spec.rb | @@ -4,7 +4,7 @@
describe Cask::Installer, :cask do
describe "install" do
let(:empty_depends_on_stub) {
- double(formula: [], cask: [], macos: nil, arch: nil, x11: nil)
+ double(formula: [], cask: [], macos: nil, arch: nil)
}
it "downloads and installs a nice fresh Cask" do | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.