322 Commits

Author SHA1 Message Date
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
Carlo Cabrera
f0d2de1869
Skip GCC version check
This is not necessary.

In addition,
1. Avoid an error when `formula.tap` is `nil`.
2. Use the more suggestive `gcc.dep.rpaths.migrated` as the setting
   name.
2022-08-03 15:29:53 +08:00
Carlo Cabrera
7be6b8e6d1
update-report: migrate GCC recursive dependents
When GCC 12 ships (Homebrew/homebrew-core#106755) ships, most (all?)
Linux bottles that depend on GCC will break.

Let's fix that by using the same trick for handling divergent formula
revisions when migrating formulae from linuxbrew-core (#11982). We set
the recorded `version_scheme` to -1, which spoofs the formula being
outdated. When `brew upgrade` installs GCC 12, the broken formulae will
have their bottles reinstalled too.

This works because the reinstallation will also rewrite the existing
RPATHs to point to the new version of GCC instead (#13631). This should
handle most of the breakage.
2022-08-02 23:57:16 +08:00
Darren Kavanagh
da4bf679de
Add new line after donate message 2022-07-07 14:46:41 -07:00
Darren Kavanagh
b878d9c1ca
Highlight new revision message 2022-07-07 14:46:41 -07:00
Darren Kavanagh
a25f827b8f
Report new_tag even when old_tag blank 2022-07-07 14:46:41 -07:00
Darren Kavanagh
387515e75a
State version number in messages 2022-07-07 14:46:40 -07:00
Darren Kavanagh
bc8103d356
Highlight release notes when version changes
Highlight release notes when the current version is updated to a newer
version (either major or minor) not just when revision version is zero
(e.g. x.x.0).
2022-07-07 14:46:40 -07:00
Darren Kavanagh
700e2f19f1
Expand output excluded by quiet 2022-07-07 14:46:40 -07:00
Darren Kavanagh
a94f6ec50c
Update latesttag in all cases
Set latesttag before it is bypassed by return statement and old_tag
being blank.
2022-07-07 14:46:40 -07:00
Darren Kavanagh
ae2196fa57
Use x_tag instead of x_repository_version 2022-07-07 14:46:39 -07:00
Mike McQuaid
2d5eab2e1c
brew style --fix 2022-06-30 08:56:21 +01:00
Mike McQuaid
3ef6db617a
update-report: always write non-blank lattesttag.
This handles this being unset when using `brew update --quiet`.

Fixes #13467
2022-06-24 13:37:32 +02:00
Rylan Polster
b941470216
Merge pull request #13440 from Rylan12/prefer-api-to-taps
Always prefer loading from API when `HOMEBREW_INSTALL_FROM_API` is set
2022-06-21 10:18:02 -04:00
Bo Anderson
f77722cfd3
cmd/update-report: fix Style/MapCompactWithConditionalBlock 2022-06-17 19:53:30 +01:00
Bo Anderson
a2033c397e
Use EnvConfig methods over direct ENV access 2022-06-17 19:47:56 +01:00
Rylan Polster
b63474398e
Always prefer loading from API when HOMEBREW_INSTALL_FROM_API is set 2022-06-17 13:54:05 -04:00
Bo Anderson
a6c6c4b915
cmd/update-report: fix error if new formulae/casks are already installed 2022-06-17 00:30:49 +01:00
Mike McQuaid
78695938ae
cmd/update-report: always output new formulae.
There's near zero performance overhead and this seems good for
discovery.

Fixes #13412
2022-06-13 09:12:32 +01:00