- 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>
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.
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.
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.
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.
- 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
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.
- 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
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.
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.