147 Commits

Author SHA1 Message Date
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
Bo Anderson
e78665f4f7
Replace ENV["HOME"] with Dir.home 2022-06-17 19:47:57 +01:00
Rylan Polster
1e536217b2
Streamline loading casks from API 2022-06-15 16:35:49 -04:00
Harry Marr
aa9a07f49e
Only checksum file downloads, not VCS downloads 2022-06-12 11:24:50 -04:00
Mike McQuaid
845925bf56
Merge pull request #13311 from bevanjkay/fix-outdated-greedy
cask: fix greedy outdated command
2022-06-06 10:05:24 +01:00
apainintheneck
6f06236bca Fix :svn download errors with :latest casks 2022-06-01 09:04:54 -07:00
Bevan Kay
6b155d9328
Update Library/Homebrew/cask/cask.rb
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2022-05-28 10:14:51 +10:00
Bevan Kay
ac2f52cef3
cask: fix greedy outdated command 2022-05-24 22:38:30 +10:00
apainintheneck
b85f407e95 Only upgrade :latest casks when --greedy and the cask has been updated
A sha256 hash of the previous download is stored and compared with
new downloads before updating :latest casks. This prevents unnecessary
reinstalls when the cask hasn't been updated.

Move download path to cask from installer to prevent unnecessary
redownloads of casks.
2022-05-17 16:15:05 -07:00
Mike McQuaid
3a709d36b2
Start process to remove Enumerable from Formula and Cask::Cask.
This is the first step to address
https://github.com/Homebrew/brew/issues/11292.
2022-01-03 14:59:10 +00:00
Mike McQuaid
d43555dd75
brew style --fix 2021-11-02 11:16:10 +00:00
Rylan Polster
0b8032d421
Document HOMEBREW_INSTALL_FROM_API 2021-10-22 12:37:57 -04:00
Rylan Polster
5d536d66fc
Rename HOMEBREW_JSON_CORE to HOMEBREW_INSTALL_FROM_API 2021-08-27 00:24:15 -04:00
Rylan Polster
8690d661fd
Merge pull request #11859 from Rylan12/cask-json
Allow casks to be installed using the `cask-source` API
2021-08-26 23:58:51 -04:00
Rylan Polster
c3a8b3841e
Only include differring versions
Move the resetting of `MacOS.version` to an `ensure` block.

Fix the tests by adding a test OS and new fixture that has a
different version for that test OS.
2021-08-25 10:30:38 -04:00