We'd like to reduce the size of the API JSON and to do that we are
going to remove unused and/or blank elements from the cask/formula
definition. This will reduce the amount of data that has to go
over the wire and make it easier to load this data into memory.
We were only loading casks from files with this command which,
of course, didn't work for casks that can only be loaded from
the API (when the core cask tap is not tapped). This changes
things to align more with what we do for formulae.
This was not returning the full name correctly for e.g. anything in
Homebrew/homebrew-fonts.
While we're here, fix up a few other places where `tap.core_cask_tap?`
can be used more appropriately.
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.
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.
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).
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.
- 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#14505Fixes#14595
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.