264 Commits

Author SHA1 Message Date
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
apainintheneck
0020a57987 Split dump_formula_or_cask_report into multiple functions 2022-06-12 08:55:21 -07:00
apainintheneck
e0a6743580 HOMEBREW_UPDATE_REPORT_ALL_FORMULA displays new formulae and casks
Only show new formulae or casks when HOMEBREW_UPDATE_REPORT_ALL_FORMULAE
environment variable is set.

Stop checking for HOMEBREW_UPDATE_REPORT_ALL_FORMULAE when the key is
:R, :A or :AC in ReporterHub#dump_formula_or_cask_report because
that check is made redundant by the check in ReporterHub#dump.
2022-06-11 15:58:51 -07:00
Mike McQuaid
04c8e02418
cmd/update-report: use better wording where appropriate.
From reading https://github.com/orgs/Homebrew/discussions/3328: I
initially thought we should just change "Updated" to "Modified" when
appropriate. After conversation with Bo98, though, I thought more and
saw that we're already checking for outdated formulae here so, rather
than ever traverse through the formula history, look at the outdated
formula and list them unless we've set
`HOMEBREW_UPDATE_REPORT_ALL_FORMULAE` in which case we show the
modifications.

While we're here, also do a bit of reformatting and renaming to better
clarify intent.
2022-06-03 19:23:38 +01:00
Mike McQuaid
fb4c9353bb
Improve updating behaviour
- Rename use of "preinstall" to "auto update". The original "preinstall"
  naming came from the fact that we used to only auto-update before
  `brew install` but now that it's many commands: this is more confusing
  than useful.
- Add `HOMEBREW_NO_UPDATE_REPORT_ONLY_INSTALLED` and remove
  `HOMEBREW_UPDATE_REPORT_ONLY_INSTALLED`; the latter is now the default
  and the prior provides an opt-out for better output, performance and
  avoiding reading potentially untrusted formulae.
- Add `HOMEBREW_UPDATE_FORMULA_VERSION_CHECKS` and don't check formula
  versions by default for better performance by default.

Co-authored-by: Eric Knibbe <3324775+EricFromCanada@users.noreply.github.com>
Co-authored-by: Sam Ford <1584702+samford@users.noreply.github.com>
2022-05-19 11:04:20 -04:00
apainintheneck
f811774cab Display old and new version numbers when updating 2022-04-14 11:58:19 -07:00
EricFromCanada
2fdc70c3bf
desc, search: also search cask descriptions 2022-03-30 11:23:55 -04:00
Mike McQuaid
47f8636e7d
update-report: optimise update_report_only_installed code. 2022-02-28 09:58:20 +00:00
Mike McQuaid
d48a9337e4
Revert "update-report: default HOMEBREW_UPDATE_REPORT_ONLY_INSTALLED to on." 2022-02-28 09:54:12 +00:00