290 Commits

Author SHA1 Message Date
Mike McQuaid
36024e2a4d
Merge pull request #16506 from MikeMcQuaid/adjust_installfromapimessage
cmd/update-report: adjust installfromapimessage.
2024-01-19 19:20:04 +00:00
Mike McQuaid
6a8ac2bd0e
cmd/update-report: adjust installfromapimessage.
Only warn about `HOMEBREW_NO_INSTALL_FROM_API` and make this a one-time
message.

Fixes #16481
2024-01-19 08:55:03 +00:00
Issy Long
f682147598
Fix RuboCop Style/RedundantFreeze offenses 2024-01-18 22:20:01 +00:00
Douglas Eichelberger
0191af7899 resolve typecheck errors 2023-11-05 08:55:58 -08:00
apainintheneck
85bd4c7e1f utils/backtrace: scrub sorbet-runtime from backtrace
Ever since we started using this at runtime it's been polluting
the backtrace output. This makes it harder to debug errors and
increases the amount of info users have to paste into the box
when filing an issue.

This is a very direct approach. Essentially, we strip out
everything related to the `sorbet-runtime` gem whenever the top
line in the backtrace is unrelated to sorbet-runtime.

The hope is that this will allow errors related to sorbet to
be diagnosed easily while also reducing the backtrace size
for all other types of errors.

Sometimes it is useful to see the full backtrace though.
For those cases, we include the full backtrace when
`--verbose` is passed in and print a warning that the
Sorbet lines have been removed from the backtrace the
first time they are removed.

Note: This requires gems to be set up so that the call to
`Gem.paths.home` works correctly. For that reason, it must
be included after `utils/gems` which is included in
`standalone/load_path` already.
2023-09-21 21:07:22 -07:00
Mike McQuaid
2d133ba1a6
cmd/update-report: improve tap/untap behaviour.
- unify core tapping/untapping behaviour (so we can never tap and then
  immediately untap)
- automatically untap homebrew-core or homebrew-cask if it's old, on
  the default branch and it doesn't seem to be needed
- if we think it's unneeded but it's too new: output a message instead

Co-authored-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com>
2023-08-16 14:06:26 +01:00
Mike McQuaid
1481eac57c
brew.sh: don't set HOMEBREW_NO_INSTALL_FROM_API automatically.
My understanding is that now https://github.com/Homebrew/brew/pull/15778
has been merged this should now work fine on both older macOS versions
and non-default prefixes so let's try this again.
2023-08-15 11:42:02 +01:00
Mike McQuaid
38f00671c4
cmd/update-report: correctly handle added/deleted formulae/casks.
If a formulae or cask is marked as both added and deleted, we've just
incorrectly detected it. Remove it from the report.

This can happen when a formula or cask is moved around in the repository
e.g. with sharding.
2023-08-14 19:28:56 +01:00
Mike McQuaid
565eb363ea
update_report: show "Delete and Installed" header.
Clarify that the deleted formulae/casks when not using `report_all`
are only those that have been deleted _and_ the user has them
installed. This should avoid users glossing over this information as
it is pretty relevant to them.

While we're here, refactor some of the `report_all` logic to make it
easier to remove it all on the next Homebrew major/minor version.
2023-08-08 16:57:03 +01:00
eugenesvk
2c7c064040 Allow hiding new formula/cask sections on update 2023-08-07 20:38:54 +07:00
Mike McQuaid
21d8f82056
Add/use HOMEBREW_INSTALL_FROM_API_UNSUPPORTED
When we're automatically setting `HOMEBREW_NO_INSTALL_FROM_API`
when on an old macOS version or with a non-default prefix (e.g. cases
where you're going to be mostly building from source).

My initial plan was to set
`HOMEBREW_AUTOMATICALLY_SET_NO_INSTALL_FROM_API` in these cases but
it's used differently enough it made sense to add another internal
variable instead: `HOMEBREW_INSTALL_FROM_API_UNSUPPORTED`.

At the moment this is only used to avoid printing the "You have set
`HOMEBREW_NO_INSTALL_FROM_API`" message inside `brew update` but may
make sense to use in other places over time.

Ideally, we'll get rid of these automatic sets of
`HOMEBREW_NO_INSTALL_FROM_API` and perhaps even the variable entirely.
2023-07-27 12:36:54 +01:00
Mike McQuaid
77061817f7
Fix (again) InfluxDB analytics messaging
Address https://github.com/Homebrew/brew/pull/15688#issuecomment-1638725595

Fixes https://github.com/Homebrew/brew/issues/15678
2023-07-18 08:03:57 +01:00
Bo Anderson
beaa6c32a0
Fix cases of core taps being unnecessarily installed 2023-07-13 20:33:31 +01:00
Bo Anderson
ba02c669e1
Introduce CoreCaskTap class 2023-07-13 20:33:26 +01:00
Bo Anderson
623eeb4e47
cmd/update-report: tweak messages for CI 2023-07-07 21:10:21 +01:00
Mike McQuaid
7da934f7e2
Deprecate/disable/delete code.
The next release after this is merged will be 4.1.0.

Co-authored-by: Markus Reiter <me@reitermark.us>
2023-07-06 16:56:20 +01:00
Mike McQuaid
28817dfe6c
cmd/update-report: use api_auto_update_secs default.
Otherwise this can be printed incorrectly.

As reported in https://github.com/Homebrew/brew/pull/14592#issuecomment-1623578695
2023-07-06 13:58:24 +01:00
Mike McQuaid
b64ed9dc58
cmd/update-report: nudge people to tweak settings.
Nudge people who have set update or analytics related settings to change
them and to run `brew untap` for taps they no longer need.
2023-07-05 17:18:26 +01:00
John Clark
1a6568b566
Update update-report.rb
Error: uninitialized constant Cask::Migrator
Please report this issue:
  https://docs.brew.sh/Troubleshooting
/usr/local/Homebrew/Library/Homebrew/cmd/update-report.rb:591:in `block in migrate_cask_rename'
/usr/local/Homebrew/Library/Homebrew/cmd/update-report.rb:590:in `each'
/usr/local/Homebrew/Library/Homebrew/cmd/update-report.rb:590:in `migrate_cask_rename'
/usr/local/Homebrew/Library/Homebrew/cmd/update-report.rb:250:in `each'
/usr/local/Homebrew/Library/Homebrew/cmd/update-report.rb:250:in `output_update_report'
/usr/local/Homebrew/Library/Homebrew/cmd/update-report.rb:41:in `update_report'
/usr/local/Homebrew/Library/Homebrew/brew.rb:94:in `<main>'
2023-05-14 15:12:11 -04:00
Markus Reiter
a3231a03fa
Implement cask renames. 2023-05-12 21:17:30 +02:00
Bo Anderson
8e7d4a5bee
cmd/update-report: don't invoke external diff tools 2023-05-09 05:19:55 +01:00
Ruoyu Zhong
5d9c3d0432
cmd/update-report: do not fail when tap has no origin
This fixes the following error:

    $ brew update
    Warning: No remote 'origin' in /usr/local/Homebrew/Library/Taps/foo/homebrew-bar, skipping update!
    Error: HOMEBREW_UPDATE_BEFORE_FOO_HOMEBREW_BAR is unset!
    /usr/local/Homebrew/Library/Homebrew/cmd/update-report.rb:361:in `initialize'
    /usr/local/Homebrew/Library/Homebrew/cmd/update-report.rb:187:in `new'
    /usr/local/Homebrew/Library/Homebrew/cmd/update-report.rb:187:in `block in output_update_report'
    /usr/local/Homebrew/Library/Homebrew/tap.rb:748:in `block (2 levels) in each'
    /usr/local/Homebrew/Library/Homebrew/tap.rb:747:in `each'
    /usr/local/Homebrew/Library/Homebrew/tap.rb:747:in `block in each'
    /usr/local/Homebrew/Library/Homebrew/tap.rb:746:in `each'
    /usr/local/Homebrew/Library/Homebrew/tap.rb:746:in `each'
    /usr/local/Homebrew/Library/Homebrew/cmd/update-report.rb:160:in `output_update_report'
    /usr/local/Homebrew/Library/Homebrew/cmd/update-report.rb:40:in `update_report'
    /usr/local/Homebrew/Library/Homebrew/brew.rb:94:in `<main>'
    Already up-to-date.

Signed-off-by: Ruoyu Zhong <zhongruoyu@outlook.com>
2023-05-01 23:37:01 +08:00
Douglas Eichelberger
6bc94abadc Remove delegation of ReporterHub#empty? 2023-04-27 08:13:51 -07:00
Bo Anderson
a696bd8203
Support multiple oldnames for formulae 2023-04-27 05:15:43 +01:00
Douglas Eichelberger
08af78a2a5 brew style --fix 2023-04-25 09:26:24 -07:00
Douglas Eichelberger
24cf6076e8 brew style --fix 2023-04-24 20:42:39 -07:00
Mike McQuaid
b7c55422b5
cmd/update-report: avoid unnecessary EOS.
Co-authored-by: Douglas Eichelberger <dduugg@users.noreply.github.com>
2023-03-28 08:49:05 +01:00
Mike McQuaid
9de0b619f3
More update tweaks
- Make copying to `*_names.before.txt` the responsibility of `update.sh`
  (unless the file doesn't exist at all). This provides the added
  benefit of allowing the inspection of the before/after state after
  running a `brew update` rather than both files always being identical
  at this point.
- State `No changes to formulae or casks.` on macOS.
- Rename and flip `updated_formula_report` to `auto_update`; this naming
  was confusing every time.
- Only display the `You can upgrade with...` messaging if we're not
  auto-updating as sometimes it will be displayed before the commands it
  references (e.g. `upgrade`, `outdated` or an `install` that proceeds
  to upgrade these formulae).

Fixes https://github.com/Homebrew/brew/issues/15065
2023-03-27 17:24:32 +01:00
Mike McQuaid
e75b983686
cmd/update-report: fix ordering.
New formulae/casks were shown as removed and vice versa.

Fixes #15036
2023-03-23 08:48:48 +00:00
Dustin Rodrigues
b776fb32de
change includecount to include_count for readability 2023-03-20 07:23:17 -04:00
Dustin Rodrigues
e5fba88035
use includecount argument in pluralize 2023-03-19 23:35:47 -04:00
Douglas Eichelberger
396954c3a8 Initialize lvars as empty arrays 2023-03-06 13:40:04 -08:00
Douglas Eichelberger
e57e50f228 Fix undefined error in update-report 2023-03-06 13:40:04 -08:00
Mike McQuaid
26182fd67a
Note that brew update will only report all without API.
It's not worth supporting this option any longer given the API
constraints.
2023-03-03 08:51:58 +00:00
Mike McQuaid
2451d017f9
update-report: allow additions/deletions from the API.
If we're installing from the API: we cannot use Git to check for differences in
packages so instead use `{formula,cask}_names.txt` to do so.

The first time this runs: we won't yet have a base state
(`{formula,cask}_names.before.txt`) to compare against so we don't output
anything and just copy the files for next time.
2023-02-28 16:46:44 +00:00
Douglas Eichelberger
f9f73f3ef6 Tidy up 2023-02-27 21:42:47 -08:00
Douglas Eichelberger
1ab278f74c Fix style/type violations 2023-02-27 20:34:07 -08:00
Douglas Eichelberger
0eccc0e987 git grep -l Utils::Inflection | xargs gsed -i 's|Utils::Inflection|Utils|g' 2023-02-27 20:18:27 -08:00
Douglas Eichelberger
eb2b990575 Port more call sites 2023-02-27 20:17:33 -08:00
Bo Anderson
e86a8c2477
Move HOMEBREW_NO_INSTALL_FROM_API defaults to shell 2023-02-24 21:53:08 +00:00
apainintheneck
8de625e0e2 extend/os: clean up requires
These need to be after the original module/class definitions
for the monkey-patching to work correctly.
2023-02-22 21:21:24 -08:00
Bo Anderson
c2342eca91
Further improvements to API handling in shell 2023-02-19 05:38:13 +00:00
Mike McQuaid
4c8ed77302
Improve homebrew/{core,cask} autotapping.
Don't automatically tap these when running a developer command that's
not using the API.

Fixes #14606
2023-02-14 09:54:24 +00:00
Mike McQuaid
b9b3bd2571
brew style --fix 2023-02-10 08:59:51 +00:00
hyuraku
6945cd7da4 - remove mac/cmd/update-report
- repair if condition
- repair require filename
2023-02-02 18:50:09 +09:00
hyuraku
653930bed8 mv files to os/*/cmd/ 2023-01-28 21:38:40 +09:00
hyuraku
2d864d70e0 apply extend/os to migrate_gcc_dependents_if_needed 2023-01-26 22:21:45 +09:00
apainintheneck
c477b9aab3 Cleanup after adding os specific rubocop
- Change name of rubocop warning
- Disable linting on remaining offending lines
- Add todos to move lines with disabled linting
  checks to extend/os in the future
2022-11-29 23:13:50 -08:00
Carlo Cabrera
ddc23eb268
update-report: reset version_scheme only for runtime dependents
`recursive_dependencies` includes build and test dependencies as well,
which means that we're doing this for too many formulae.
2022-08-06 20:56:53 +08:00
Carlo Cabrera
e1f8fa2c9b
Improve settings name
This leads to a slightly more readable entry in `.git/config`.
2022-08-03 20:15:45 +08:00