54 Commits

Author SHA1 Message Date
Mike McQuaid
94416e82f0
Add new odeprecated, odisabled, remove disabled code.
Prepare the usual deprecation cycle for Homebrew 4.4.0.
2024-09-24 10:15:34 +01:00
Mike McQuaid
7abc6f4349
cask/installer: improve *_FORBIDDEN_* env handling.
- Improve the error message when a cask or formula is forbidden by an
  environment variable (fixes #17880)
- Move the `forbidden_tap_check` and `forbidden_cask_and_formula_check`
  methods to the top of the `install` method, so that they are checked
  before the main cask is downloaded.
2024-07-27 16:13:51 +01:00
Carlo Cabrera
be29afa5f7
Fix brew style 2024-05-06 15:26:29 +01:00
Carlo Cabrera
3b794fc6e8
formula_installer, cask/installer: add tests for HOMEBREW_ALLOWED_TAPS 2024-05-06 15:22:48 +01:00
Carlo Cabrera
34387bfc8a
cask/installer: update to match formula_installer 2024-05-05 14:00:02 +01:00
Mike McQuaid
1474806527
Add more HOMEBREW_FORBIDDEN_* configuration
We already had `HOMEBREW_FORBIDDEN_LICENSES` but this commit adds
`HOMEBREW_FORBIDDEN_CASKS`, `HOMEBREW_FORBIDDEN_FORMULAE` and
`HOMEBREW_FORBIDDEN_TAPS` for also forbidding those.

Relatedly, add `HOMEBREW_FORBIDDEN_OWNER` and
`HOMEBREW_FORBIDDEN_OWNER_CONTACT` to allow customising these
messages.

There were no existing tests for `HOMEBREW_FORBIDDEN_LICENSES` so have
added more tests for all of these checks.

Co-authored-by: Bo Anderson <mail@boanderson.me>
2024-04-08 16:38:32 +01:00
Douglas Eichelberger
26eda5a303
git grep -l '^describe' | xargs gsed -i 's|^describe|RSpec.describe|g' 2024-02-19 13:57:27 +00: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
Markus Reiter
a3231a03fa
Implement cask renames. 2023-05-12 21:17:30 +02:00
Markus Reiter
df620ad3ba
Make manual installers easier to open. 2023-05-08 08:25:32 +02:00
Bo Anderson
44f058edb5
Refactor formula, cask and Ruby source downloads to use shared code 2023-04-27 23:23:07 +01:00
Douglas Eichelberger
9075cbae62 brew style --fix 2023-04-21 09:58:50 -07:00
Douglas Eichelberger
ac1e6ded9a git grep -l '# typed: false' | xargs gsed -i 's|# typed: false||g' 2023-04-21 09:57:47 -07:00
Issy Long
3a83b5492c
rubocop: Clean up Style/BlockDelimiters excludes and autofix offenses
- The defaults of using "do ... end" for multi-line blocks everywhere is
  good, better than switching everything to braces everywhere.
2023-03-08 23:54:22 +00:00
hyuraku
122b24e9ff repair zap spec 2023-03-06 22:27:54 +09:00
hyuraku
e0416e0f65 add zap option spec to cask_installer spec 2023-03-06 22:27:53 +09: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
9af04fdf38 Add installer tests 2023-02-26 11:26:44 -08:00
Douglas Eichelberger
585098a9b9 Resolve cask/installer_spec violation 2023-01-22 17:09:55 -08: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
xxyzz
1b877273d8
Don't print Cask installed error message when --quiet is used 2022-05-11 11:03:20 +08:00
apainintheneck
0dd3764041 Allow casks with outdated caskfiles to be reinstalled
The problem occurred when calling `brew reinstall` on a cask
with an out of date caskfile.

To solve the problem Cask::Installer#uninstall_existing_cask has been changed to
catch a possible CaskInvalidError when trying to load outdated
caskfiles using Cask::CaskLoader#load.
2022-05-02 23:39:18 -07:00
Bo Anderson
4836ea0ba2
Remove XQuartz handling 2021-11-05 12:40:22 +00:00
Mike McQuaid
4f36217838
cask/installer_spec: delete flaky test.
I see this failing every couple of days despite no changes.
2021-05-05 10:32:52 +01:00
Michael Cho
1a398f9aaf cask install: increase APFS test sleep to avoid slow eject fail 2021-04-03 10:21:50 -07:00
Michael Cho
cf8d96e0b2 cask install: fix APFS DMG eject to use physical disk 2021-03-29 19:59:20 -07:00
EricFromCanada
cd3cb6928b indent suggested commands on subsequent line
and combine sequential puts calls
2021-01-26 15:36:44 -05:00
Markus Reiter
c54a9937e7 Remove cask-specific checksum errors. 2020-11-19 19:46:59 +01:00
Markus Reiter
7a83f34dd1 Support casks in brew fetch. 2020-11-19 19:46:59 +01:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Markus Reiter
5f005f67cf Refactor global Cask::Config. 2020-10-01 00:57:10 +02:00
Mike McQuaid
3a91c37e66
Fix RuboCop checks. 2020-08-19 17:12:32 +01:00
Markus Reiter
78725740e2 Refactor cask dependency resolution. 2019-10-31 20:20:55 +01:00
Mike McQuaid
e3ee64a5fd
Ruby 2.6.3 brew tests fixes 2019-10-10 16:17:06 +01:00
Mike McQuaid
3dc82bc8bf
Commit 'brew style --fix' results. 2019-07-23 17:09:57 +01:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
EricFromCanada
e0558dc7c7 trim line breaks 2019-04-13 21:37:48 -04:00
EricFromCanada
fa6404e0f5 grammar fixes 2019-04-13 21:29:32 -04:00
Markus Reiter
1e1ce1c471 Save config file for casks. 2019-02-15 10:09:14 +01:00
Mike McQuaid
3060125c45
rubocop: autofix problems. 2019-02-11 09:50:09 +00:00
Markus Reiter
a84a1c63db Rename Hbc module to Cask. 2018-09-06 09:30:52 +02:00
Markus Reiter
89dd608766 Deprecate gpg stanza. 2018-09-03 20:47:52 +02:00
Mike McQuaid
bcb1ec5499
Improve Homebrew/brew line length.
Use 124 max line length everywhere. Also, reduce tap max line length to
189 as Homebrew/homebrew-core has that as a maximum now. In future
Homebrew/homebrew-core will also be reduced to 124 maximum line length.
2018-09-02 16:15:09 +01:00
Markus Reiter
e5865e7e7f Assimilate Containers with UnpackStrategy. 2018-07-16 23:50:45 +02:00
Markus Reiter
3d423b0587 Add path method to Caskroom and Cache. 2018-06-09 09:52:48 +02:00
Markus Reiter
6760d26319 Create Hbc::Config class. 2018-01-27 21:47:18 +01:00
Markus Reiter
97333df4cb Add helper method for Cask fixture paths and refactor CaskLoader. 2017-10-07 16:11:25 +02:00
Markus Reiter
2ad3a87045 Silence all specs by default. 2017-07-29 20:25:37 +02:00
Mike McQuaid
4440afa99a installer_spec: silence test output. 2017-07-29 16:59:32 +01:00
Markus Reiter
66ce575301 🔨 Refactor Cask exceptions. 2017-06-13 17:14:28 +02:00