111 Commits

Author SHA1 Message Date
apainintheneck
1322b9cb79 cask: remove os_versions
This was originally used by the API but was replaced months
ago by SimulateSystem. Essentially, it's only current use
was in the #to_h method but is not used internally at all
when creating cask instances from the API JSON.
2023-04-16 13:52:24 -07:00
Markus Reiter
844db75361
Add source paths to API. 2023-04-07 15:20:01 +02:00
Markus Reiter
5e52d415a9
Allow fetching for different arch. 2023-03-25 11:56:09 +01:00
apainintheneck
6ccf21c2c9 Merge branch 'master' into add-service-block-to-formula-api 2023-03-22 20:06:32 -07:00
apainintheneck
801ee5e474 Address feedback
- style nits
- better comments for tests that are not idempotent
- moved appdir placeholder constant to global.rb
2023-03-22 19:43:49 -07:00
apainintheneck
38146893c3 api_hashable: Make API path subs generic
This turns the ability to replace common paths with placeholders
into a mixin that can be used with both Casks and Formulae.

The idea here is to make formula hash generation more consistent.
2023-03-21 23:20:42 -07:00
apainintheneck
3aae28aa0d cask: remove old prefix placeholder
This was just a temporary workaround while we
waited for the API to regenerate the JSON content.
2023-03-18 16:42:44 -07:00
Douglas Eichelberger
e40d2b42c9
Update Library/Homebrew/cask/cask.rb
Co-authored-by: Markus Reiter <me@reitermark.us>
2023-03-13 09:10:36 -07:00
Douglas Eichelberger
0fe595f9c2 Elaborate on sorbet comments 2023-03-13 09:08:56 -07:00
Douglas Eichelberger
04fa6e24d7 Enable more typing 2023-03-13 09:08:56 -07:00
Douglas Eichelberger
1195772b02 Refactor Searchable into Homebrew::Search 2023-03-07 09:08:54 -08:00
apainintheneck
c19017c6bd Make Cask#to_h work without the API
Set metadata when we load casks from the source API.

Set `@tap_git_head` manually.

Also, allow `auto_update` to receive false.
This is only done for consistency.

Stop double printing the `kext` caveat.

Handle Array elements correctly when substituting
path elements in artifacts. This affected how the
Uninstall Signal keys were evaluated (they are
represented as arrays of arrays).
2023-02-28 19:36:20 -08:00
apainintheneck
39dd7e987d stop loading Cask#to_h from api 2023-02-28 18:00:38 -08:00
apainintheneck
fd62cdf636 cask: delay loading from source API
For casks with certain stanzas, *flight and language
stanzas in this case, we need to use the caskfile
to install them correctly. The JSON API is not an option.

This delays loading from the source API until just before
we try to install one of these casks. This reduces the
number of requests we make to the source API.
2023-02-25 20:54:37 -08:00
Bo Anderson
e86a8c2477
Move HOMEBREW_NO_INSTALL_FROM_API defaults to shell 2023-02-24 21:53:08 +00:00
Bo Anderson
c416e4bbee
cask: handle nil URLs 2023-02-24 18:04:18 +00:00
Bo Anderson
aebc125e9c
cask: support url specs in API 2023-02-24 13:56:46 +00:00
Bo Anderson
e663f532a6
Checksum Ruby source file downloads 2023-02-22 22:50:24 +00:00
Mike McQuaid
1d61b219db
cask/cask: fix non-absolute home error.
Needs a leading slash to avoid `File.expand.path` complaining about non-absolute home.
2023-02-14 17:22:18 +00:00
Mike McQuaid
237eec8ef8
Overhaul Formula/Cask JSON generation
- Use constants for placeholders
- Monkeypatch to set `HOMEBREW_PREFIX` consistently to placeholder
- Use environment variable to set `Dir.home` consistently to placeholder
- Use `appdir` short-circuit to set `Cask#appdir` consistently to placeholder
- Use `Cask.generating_hash!` to enable "generating mode" with these patches
- Fix `Formula#caveats` from JSON

Fixes #14505
Fixes #14595
2023-02-14 14:19:40 +00:00
apainintheneck
39c6f7d6fb Stop including *flight block source in cask API
Originally we were going to try and load the *flight blocks from the API
but we ended up going with downloading the caskfile for the subset of
casks that need this functionality for consisty's sake.

This reverts the following commits from most recent to oldest:
- ffc74a51fb32b66a4cd8bc41dbd076dd23d9100e
- e5616e94fe42505434c330be35eeafef2739944f
- d1490c3d5c087d00f2bca1787cce331202b195c5
- 7ca5a5d9a71a73f21bbb8555a38048f027bee89b
- 2d5d132713d0701d02d5ff33e9918812d13d2a83

It also changes how *flight blocks are handled in `.to_h`.
Essentially, when *flight blocks exist they are just included
as a hash of the artifact to nil to indicate that they exist.

More information isn't necessary since we don't evaluate
the current source code in the *flight artifacts that
we get from the API.
2023-02-13 21:22:18 -08:00
Mike McQuaid
2a417f1416
Merge pull request #14609 from Bo98/json-fix
Fix `brew info --json` regressions around install status
2023-02-13 15:02:26 +00:00
Bo Anderson
cc956d73aa
Fix brew info --json regressions around install status 2023-02-13 05:07:40 +00:00
Bo Anderson
526871896c
cask: replace Caskroom in API for relocated artifacts 2023-02-13 04:33:53 +00:00
Rylan Polster
f7fa5937d8
Allow brew info --json=v2 without taps with JSON API 2023-02-12 12:03:40 +00:00
Mike McQuaid
6b4363092d
Revert "Merge pull request #14548 from Homebrew/revert-14382-deprecate-disable-remove"
This reverts commit 932d2cf3b77c9439a57b6a43577fc8d3b6399a62, reversing
changes made to f4e60482791d2ff628efadfdbf0d14d9237d2d29.
2023-02-07 19:25:51 +01:00
Mike McQuaid
6882ac17e7
Revert "Add deprecations and disables" 2023-02-07 15:13:19 +01:00
Mike McQuaid
c1b96e7199
Merge pull request #14382 from MikeMcQuaid/deprecate-disable-remove
Add deprecations and disables
2023-02-05 17:56:58 +01:00
Rylan Polster
0229196ac5
Merge pull request #14503 from Rylan12/artifact-json-fix
Don't convert boolean and blank values to strings in cask artifacts API
2023-02-05 15:40:14 +01:00
Rylan Polster
7b550ad8c6
Improve style
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2023-02-05 13:06:05 +01:00
Rylan Polster
7dbc33a0df
Cleanup case handling
Co-authored-by: Kevin <apainintheneck@gmail.com>
2023-02-05 12:42:31 +01:00
Rylan Polster
5ab7f14d2b
Fix cask not found error when upgrading certain casks 2023-02-05 12:26:22 +01:00
Rylan Polster
a166be9541
Don't convert boolean and blank values to strings in cask artifacts API 2023-02-05 02:58:03 +01:00
Mike McQuaid
59c03cb2a6
Add deprecations and disables
Do the usual dance:
- commented `odeprecated` to `odeprecated`
- `odeprecated` to `odisabled`
- `odisabled` removed
2023-02-03 10:48:43 +00:00
Mike McQuaid
90b154fdb5
Merge branch 'master' into cask_source_tweaks 2023-01-31 10:50:34 +00:00
Rylan Polster
0f79b24203
Add languages to cask API 2023-01-28 01:05:54 -06:00
Mike McQuaid
fd18c7b0ac
Tweak cask-source API handling
- Use raw.githubusercontent.com to download cask source rather than
  formulae.brew.sh. This allows us to remove these files
- output the tap's current `HEAD` for both formulae and cask JSON
- use this `HEAD` for the cask-source API to get the exact file on
  raw.githubusercontent.com rather than just whatever is newest (which
  is what the previous API did)
- set the `Tap` correctly when creating a `Cask` from the API
- if the `formula.json` file exists: print its modified time include
  `brew config`
- memoize `tap.git_head` as we'll be calling it a lot in the same
  process with the same value
2023-01-26 17:36:40 +00:00
Rylan Polster
2d5d132713
Include *flight block source in cask API 2023-01-02 14:33:33 -05:00
Rylan Polster
7a85492176
Use JSON instead of #inspect to include cask container in API 2022-12-29 02:05:16 -05:00
Mike McQuaid
e2759fbdff
Deprecate reading all formulae through commands
We added the `--all` flag (now renamed to `--eval-all`) for various
commands for this behaviour so let's start deprecating this.

Also, introduce a `HOMEBREW_EVAL_ALL` environment variable to use the
existing, less secure, behaviour by default and avoid passing
`--eval-all` everywhere.
2022-09-05 13:57:22 +01:00
Rylan Polster
5c7e7eebe4
Condense artifact entries
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2022-08-25 10:24:30 -04:00
Rylan Polster
90d22bc7b1
Include dsl key in cask artifact hash 2022-08-25 03:04:48 -04:00
hyuraku
acf39f8777 add TODO comment 2022-08-08 19:58:50 +09:00
hyuraku
0acadc857c repair CaskLoader.load args 2022-08-07 15:43:51 +09:00
Rylan Polster
f3e34230ad
Add --variations option to brew info 2022-07-21 16:41:15 +02:00
Rylan Polster
eab3d077bc
Improvements 2022-07-21 15:32:51 +02:00
Rylan Polster
ac067eedb2
Create MacOSVersions module 2022-06-29 11:34:49 -04:00
Rylan Polster
5ec19adf58
Rename Override module to SimulateSystem 2022-06-28 15:35:20 -04:00
Rylan Polster
d3c3f7be9e
Add variations to Cask#to_h 2022-06-24 14:39:17 -04:00
Sam Ford
d7a26cd6d3
ExtractPlist: Modify #find_versions url usage 2022-06-24 00:08:53 -04:00