284 Commits

Author SHA1 Message Date
Mike McQuaid
56b3982e7a
Merge pull request #16784 from reitermarkus/tap-sig-7
Add signature for `Tap#config`.
2024-03-01 13:46:20 +00:00
Markus Reiter
0966d2cd8f
Add signature for Tap#config. 2024-03-01 13:16:56 +01:00
Markus Reiter
01133769ba
Clear cache for Tap#formula_reverse_renames. 2024-03-01 12:58:05 +01:00
Mike McQuaid
f1eea64523
Merge pull request #16779 from reitermarkus/fix-load-from-path
Fix loading casks/formulae from relative paths.
2024-03-01 08:47:41 +00:00
Mike McQuaid
0e1c1e3435
Merge pull request #16777 from reitermarkus/tap-sig-3
Simplify `Tap#formula_files_by_name`.
2024-03-01 08:41:33 +00:00
Markus Reiter
3da0f8c4a6
Fix loading casks/formulae from relative paths. 2024-03-01 04:05:15 +01:00
Markus Reiter
2a78eba1ad
Simplify Tap#formula_files_by_name. 2024-02-29 22:48:50 +01:00
Markus Reiter
755c8aecad
Simplify Tap#cask_files_by_name. 2024-02-29 22:47:43 +01:00
Mike McQuaid
8a846fb1c2
Merge pull request #16766 from reitermarkus/tap-installed
Only show installed taps in `brew tap` output.
2024-02-29 10:35:19 +00:00
Markus Reiter
e08e873921
Only show installed taps in brew tap output. 2024-02-28 20:18:55 +01:00
apainintheneck
bfe5e43ff4 api/formula: Fix failing specs
- clear the formula API cache
- make the API cache directory
- fix stubbed return values (thanks Sorbet!)
2024-02-27 20:55:16 -08:00
apainintheneck
cefd3273cc tap: Add helper to generate core formula API hash
This abstracts away this helper to make it easier to test and
reason about.
2024-02-27 20:55:16 -08:00
apainintheneck
d64de40e52 Update api code to load internal JSON v3 file 2024-02-27 20:55:16 -08:00
Markus Reiter
132a87aff5
Rename Tap#repo_var to Tap#repo_var_suffix. 2024-02-23 16:02:29 +01:00
Markus Reiter
ab27efbd9d
Make Tap::each respect the API. 2024-02-22 17:56:47 +01:00
Mike McQuaid
89fd6964f9
Merge pull request #16715 from reitermarkus/tap-ensure-installed
Clean up `Tap#ensure_installed!` usage.
2024-02-22 08:47:48 +00:00
Mike McQuaid
689b76cbad
Merge pull request #16714 from reitermarkus/tap-cask-files
Support `Tap#cask_files` when using API.
2024-02-22 08:47:18 +00:00
Markus Reiter
9f5e1f2870
Clean up Tap#ensure_installed! usage. 2024-02-21 03:21:02 +01:00
Markus Reiter
2d41fe8feb
Support Tap#formula_files when using API. 2024-02-20 20:44:13 +01:00
Markus Reiter
4cf0f79368
Support Tap#cask_files when using API. 2024-02-20 20:44:02 +01:00
apainintheneck
e96313f6ed formulary_spec: update API tests to avoid mocking
Stop mocking the formulary loader method. We just need to set the
environment variable so that it knows to load things from the API.

Fix spec that doesn't work with the `CoreTap.formula_names`.
That method assumes that we always have a valid `ruby_source_path`
in the API JSON even though that was optional for a while after
launching the API if my memory serves me. It's probably fine
to assume this should always be set though and I changed it to use
`Hash#fetch` to give use better error messages if something goes wrong in the future.

Remove unused `allow(x).to receive(y).and_call_original` in tap spec.
2024-02-17 13:00:50 -08:00
Markus Reiter
aaf39aa90b
Fix Tap#alias_table when using the API. 2024-02-16 22:39:16 +01:00
Markus Reiter
a3a1b4c253
Check tap migrations for renames. 2024-02-13 06:03:10 +01:00
Patrick Linnane
3fdba532a2
various: fix miscellaneous typos
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2024-01-12 10:56:49 -08:00
Bo Anderson
b42256d286
Deprecate, disable & delete code for Homebrew 4.2.0 2023-12-07 23:42:13 +00:00
Bo Anderson
5f95ca7259
tap: don't display file info for uninstalled taps 2023-11-25 13:38:37 +00:00
Bo Anderson
b1ddb056db
tap: optimise CoreTap#formula_files_by_name 2023-11-18 01:01:41 +00:00
Bo Anderson
34e4ec2460
tap: fix repair not working in some cases 2023-11-05 00:44:50 +00:00
Bo Anderson
0c08a3cccb
Improve performance of Formula#to_hash 2023-09-28 14:07:25 +01:00
apainintheneck
5760ae4fb2 cmd/readall: Cleanup todos
- keep running the command against all os/arch combinations
  as the default
- remove todos and deprecations related to changing the behavior
- create constants for os/arch combinations
2023-09-19 21:33:13 -07:00
apainintheneck
7e05a9b574 cmd/audit: improve performance of versioned formula names
There is a check for other versioned formula with the same name
in the file audit. This just memoizes all of the versioned
formulae in a tap during the first call and then uses that much
shorter list everytime it checks for things.
2023-09-16 09:18:13 -07:00
Eric Knibbe
931f762598
docs+rubydoc: various grammar/wording fixes 2023-09-11 02:26:37 -04: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
cf71b5b3ea
tap: always create new casks in subdirectory.
For homebrew-cask, all casks should now be created in subdirectories,
even if that subdirectory doesn't yet exist.
2023-08-09 12:11:20 +01: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
Eric Knibbe
b6c49b7a2d
docs: assume core repositories are untapped 2023-07-24 09:55:56 -04:00
EricFromCanada
d47aa103d2
cmd/tap: ensure remote exists before repairing 2023-07-23 00:42:09 -04:00
Bo Anderson
ba02c669e1
Introduce CoreCaskTap class 2023-07-13 20:33:26 +01:00
Bo Anderson
0a9e69ffdf
tap: fix handling of taps without formulae 2023-07-07 20:58:22 +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
Bo Anderson
8d1aabba81
tap: warn if tapping core taps under API mode 2023-07-05 21:57:00 +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
229a1f6c1e
Remove Tap#versioned_formula_files
This doesn't work with the API and the single caller can be
refactored to not need it instead.
2023-07-05 16:28:44 +01:00
Alexander Bayandin
f6e4849c0f
tap: disable fsmonitor for third-party taps 2023-07-04 09:56:57 +00:00
Mike McQuaid
cd414bd95f
Include core formulae from API in Formula.all.
This is needed to allow `Formula.all` to behave as expected when using
the API. Let's also (immediately, because it's broken) deprecate the
`CoreTap#formula_files` method.

Fixes #15122
2023-06-28 15:27:20 +01:00
Markus Reiter
a3231a03fa
Implement cask renames. 2023-05-12 21:17:30 +02:00
Bo Anderson
5510c3fb2b
Support formula renames in API 2023-04-27 05:15:45 +01:00
Douglas Eichelberger
24cf6076e8 brew style --fix 2023-04-24 20:42:39 -07:00
Douglas Eichelberger
403f08db8b Remove delegation 2023-04-16 09:30:21 -07:00
Douglas Eichelberger
b90897e280 Create git_repo attr 2023-04-15 19:35:13 -07:00