5034 Commits

Author SHA1 Message Date
apainintheneck
e314a43754 dependency_helpers: include required & use public_send
- Use .required? instead of .tags.empty?
- use .public_send
- modify .reject_ignores to be .select_includes
  - checks ignores first now
- Don't use runtime deps with --missing in `brew deps` command
2023-08-25 00:25:14 -07:00
Clint Harrison
e75a72dcb5 Use HOMEBREW_CURLRC in vendor-install 2023-08-22 17:21:37 -04: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
Douglas Eichelberger
d01cda2815 Turn up the types 2023-08-12 22:01:22 -07:00
Mike McQuaid
22553cd34a
Fix cask sharding issues
- Fix cask info output being incorrect
- Improve some code referring to casks as formulae
- Move livecheck cask fixtures to not shadow existing names
- Adjust the cask tap symlinking logic to make handling outdated
  shadowed casks significantly easier
- Fix various flaky tests caused by casks sharding logic
- Prefer longer paths when there's multiple formulae or casks in a tap
  with the same name rather than always using the first
2023-08-10 16:08:47 +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
b3c33d34ab
Various sharding fixes
- Load paths with no API when needed (e.g. for `brew edit`)
- Use no API mode for `brew log` as it's needed there
- Define sharding format for homebrew-cask and homebrew-core inside
  `Tap` methods
- Create new formulae/casks in location defined by these `Tap` methods
- Fix a bug in Formulary that made sharded formulae lookup less
  efficient (and possibly broke it for core and some API usage)
- Fix various other hardcoded Formula/Cask directory assumptions

Co-authored-by: Bo Anderson <mail@boanderson.me>
2023-08-04 16:43:13 +01:00
Mike McQuaid
04e07dc0db
Deprecate postgresql-upgrade-database
This is an out-of-band deprecation but this command is broken and we're
not going to fix it so it's not really worth a deprecation cycle.

See https://github.com/orgs/Homebrew/discussions/4685
2023-08-01 12:00:30 +01:00
Mike McQuaid
389bcf4eb4
Merge pull request #15781 from MikeMcQuaid/post_install_improvements_fixes
post_install: improvements and fixes.
2023-07-28 12:06:05 +01:00
Mike McQuaid
7801878c74
post_install: improvements and fixes.
- warn if running `brew postinstall` explicitly and there's no
  `post_install` defined in the formula
- add a `post_install` alias for `brew postinstall` to make life
  easier for those jumping between `postinstall` and `post_install` in
  e.g. Homebrew development
- refactor `post_install` formula path logic into a new method for
  improved readability
- handle the JSON API `post_install` formula path case
2023-07-28 11:26:09 +01:00
Mike McQuaid
2c300cfbe9
brew update core/homebrew-cask taps properly
The existing logic in `update.sh` was both a bit hard to follow and
had some edge cases. Fix this up for improving #15775.
2023-07-28 10:13:57 +01:00
Mike McQuaid
f4760edfbf
Merge pull request #15774 from MikeMcQuaid/update_verboser
cmd/update: output more API information with `--verbose`.
2023-07-27 15:46:53 +01:00
Mike McQuaid
c4f65f2eee
cmd/update: output more API information with --verbose.
Also, hide some spammy/unnecessary newline printing.
2023-07-27 15:20:59 +01: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
71a4421c6c
cmd/install: add missing require.
Fixes #15748
2023-07-25 10:08:49 +01:00
Mike McQuaid
a78173b419
Merge pull request #15746 from apainintheneck/install-cmd-should-upgrade-existing-casks
cmd/install: upgrade already installed casks
2023-07-25 08:21:52 +01:00
Douglas Eichelberger
08e46c18cd Add type to Formula attrs 2023-07-24 14:12:36 -07:00
apainintheneck
c9dea04bd4 cmd/install: upgrade already installed casks
Previously, the behavior was to warn users that a cask was already
installed and then skip modifying the installed version. This is
different to how we handled things with formulas. For them we would
upgrade any already installed formulas. This just brings casks in line
with what we already do with formulas.

Changes:
- cmd/install: Upgrade already installed casks if HOMEBREW_NO_INSTALL_UPGRADE
  is not set
- env_config: Update wording of HOMEBREW_NO_INSTALL_UPGRADE to include casks
- remove error that was only used to alert about already installed casks

Note:
- The upgrade command for casks defaults to --greedy when you pass named casks
  to the command which means that this will always default to that behavior
  since you must specify the name of the cask when installing.
2023-07-23 18:50:39 -07:00
Mike McQuaid
21f586c4bf
cmd/{casks,formulae}: handle sharding.
- Allow subdirectories inside `Casks`/`Formula` directories.
- DRY up repeated code with some variables.
2023-07-18 12:57:54 +01:00
Mike McQuaid
a1c9a21548
cmd/tap: remove --list-pinned option.
Not deprecating as it's broken and has been for several major versions.
2023-07-18 10:23:52 +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
Mike McQuaid
fb35578c54
Merge pull request #15676 from Bo98/tap-fixes
Introduce CoreCaskTap class and fix cases of core taps were being unnecessarily installed
2023-07-17 19:22:22 +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
Max R
a5abea4fa2 Support brew cleanup --quiet
I was looking for a way to suppress output in `brew cleanup` especially the `Warning: Skipping XXX: most recent version X.Y.Z not installed`. I noticed that `Homebrew::Cleanup#clean` takes a `quiet` argument, but `brew cleanup` doesn't pass one in. This PR updates `brew cleanup` to accept and forward along a `quiet` argument.
2023-07-13 14:45:43 -04:00
Carlo Cabrera
8c72df5213
Merge pull request #15643 from carlocab/cache-bottle-tag
cmd/--cache: undeprecate `--bottle-tag`
2023-07-11 01:52:42 +08:00
Bo Anderson
623eeb4e47
cmd/update-report: tweak messages for CI 2023-07-07 21:10:21 +01:00
Bo Anderson
8f13cfc529
cmd/update: adjustments for setup-homebrew in brew CI 2023-07-07 19:53:50 +01:00
Carlo Cabrera
f44e74dc34
cmd/--cache: undeprecate --bottle-tag
This is useful for quickly examining bottles with something like

    brew fetch --bottle-tag=$tag $formula && \
      tar xf "$(brew --cache --bottle-tag=$tag $formula)"

See discussion at #15632.
2023-07-07 15:09:21 +08: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
Bo Anderson
8d1aabba81
tap: warn if tapping core taps under API mode 2023-07-05 21:57:00 +01:00
Mike McQuaid
66fc022106
Merge pull request #14592 from MikeMcQuaid/env_update_prompts
cmd/update-report: nudge people to tweak settings.
2023-07-05 18:28:34 +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
Mike McQuaid
27dda52a5d
Download tap_migrations.json files from the API
Download the previously stored tap migrations files for homebrew/core
and homebrew/cask from the formulae.brew.sh API.

This adds a much longer stale time (24 hours) to decide whether or not
the migrations files need downloaded from the API in Ruby land.
`brew update` will still update them every time.

Requires https://github.com/Homebrew/brew/pull/15628
Fixes https://github.com/Homebrew/brew/issues/14897
2023-07-05 17:18:12 +01:00
Mike McQuaid
93a6335c30
cmd/update: update homebrew/core and homebrew/cask with devcmdrun.
If those folks have this tapped and explicitly run `brew update`:
let's update it from them.
2023-07-04 15:50:59 +01:00
Mike McQuaid
a5a728a4df
Merge pull request #15566 from Bo98/dep-refactor
Refactor some dependency handling to fix various API dependency issues
2023-07-04 14:58:11 +01:00
Bo Anderson
71d51faa55
Introduce tag for implicit dependencies 2023-07-04 13:40:58 +01:00
Bo Anderson
7e1efd61a5
cmd/update: don't fetch core taps on manual brew update 2023-07-03 20:03:17 +01:00
Bo Anderson
fa0ccdb3ba
cmd/postgresql-upgrade-database: fix brew not being found 2023-07-03 04:17:36 +01:00
John Britton
24c014b506
Fix single process logic in rbenv-sync and nodenv-sync 2023-06-29 09:54:18 -04:00
John Britton
03b455f460
cmd/pyenv-sync: add new command.
Similar to `rbenv-sync` and `nodenv-sync`, but for use with `pyenv`.

Python has separate formulae for minor Python versions, as such this
will symlink all patch versions to the latest minor version.
2023-06-29 09:37:56 -04:00
Mike McQuaid
20dfa3694b
cmd/update.sh: always move names*.txt files.
Move the `names*.txt` files even when the file size hasn't changed
(which can happen when the versions change in the API but the file
size doesn't change).

Fixes #15217

While we're here, also add some whitespace for easier reading.
2023-06-27 17:30:27 +01:00
Bo Anderson
4b48ea4509
cmd/update.sh: fix some fflags throwing errors on update report 2023-06-22 15:18:14 +01:00
Mike McQuaid
5fdd7f15d9
Merge pull request #15578 from Bo98/faster-install
Significantly improve install speeds with smarter postinstall detection
2023-06-22 12:36:26 +01:00
Bo Anderson
8dc2e80a98
Significantly improve install speeds with smarter postinstall detection 2023-06-22 03:06:45 +01:00
Bo Anderson
55419bfd8b
Allow bump commands to auto-update core tap clones 2023-06-22 01:39:55 +01:00