2034 Commits

Author SHA1 Message Date
Bo Anderson
9c3359afa1
cask/quarantine: fix quarantine not working under some setups 2022-06-02 18:53:46 +01:00
apainintheneck
6f06236bca Fix :svn download errors with :latest casks 2022-06-01 09:04:54 -07:00
Mike McQuaid
1bb44979ee
Disable and delete code for 3.5.0
The next planned release will be 3.5.0 so let's fix things up for there.
2022-05-30 14:59:14 +01: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
1f43bf32a4
cask: add statement when upgrade won't be installed 2022-05-26 10:06:58 +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
94148c3bc8
Fix handling unreadable casks
When casks are unreadable (e.g. have invalid syntax, the cask file
cannot be found) then it's not been possible to uninstall them, list
them or perform any operation which iterates through all casks.

Handle these various cases by falling back to creating a `Cask::Cask`
object using just the name/token and latest installed version on disk.

This provides enough functionality to be able to verbosely list these
casks, not error on listing and, most importantly, uninstall/reinstall
them.

Fixes https://github.com/Homebrew/homebrew-cask/issues/62223
2022-05-16 17:27:13 -04: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
Sam Ford
13e3f704c9
Cask::Audit: Account for nil appcast_contents 2022-04-20 23:47:51 -04:00
Issy Long
0b6b2f04da
cask/reinstall: Support --zap for entirely purging cask files
- The `brew uninstall` command has `--zap`, so let's make `brew
  reinstall` have parity here for a better user experience. (Requested
  in issue 12983.)
- It feels weird that to get my new reinstall test to pass I had to add
  `--zap` to `cask/cmd/install.rb`, not `cask/cmd/reinstall.rb` to get
  the tests to pass. But the `brew reinstall --cask caffeine --zap`
  command worked fine all the time. The CLI argument parser from the
  test run was complaining about not knowing what `zap` was. As a
  result, `--zap` now shows up as a switch in `brew install --help`
  which I'm not 100% convinced is the desired UX. But I've edited the
  description accordingly to specify that it will only work on
  `reinstall` operations (and `--zap` on `install` is a no-op).

```
issyl0 at pictor in /opt/homebrew on reinstall-cask-zap
❯ brew reinstall --cask caffeine --zap
==> Downloading https://github.com/IntelliScape/caffeine/releases/download/1.1.3/Caffeine.dmg
Already downloaded: /Users/issyl0/Library/Caches/Homebrew/downloads/3d6ccfdd3b8d0ab37d1c2468d6e69078c2d31d3b12bf51947c4db21e5f376af2--Caffeine.dmg
==> Implied `brew uninstall --cask caffeine`
==> Backing App 'Caffeine.app' up to '/opt/homebrew/Caskroom/caffeine/1.1.3/Caffeine.app'
==> Removing App '/Applications/Caffeine.app'
==> Dispatching zap stanza
==> Trashing files:
~/Library/Application Support/com.intelliscapesolutions.caffeine
~/Library/Preferences/com.intelliscapesolutions.caffeine.plist
~/Library/Caches/com.intelliscapesolutions.caffeine
~/Library/HTTPStoages/com.intelliscapesolutions.caffeine.binarycookies
==> Removing all staged versions of Cask 'caffeine'
==> Installing Cask caffeine
==> Moving App 'Caffeine.app' to '/Applications/Caffeine.app'
🍺  caffeine was successfully installed!
```
2022-04-09 16:37:23 +01:00
Mike McQuaid
61976e0672
caskroom: add, use any_casks_installed?.
Add a new method for the two places we're checking if we have any
casks installed. This is much more performance and user friendly than
attempting to load every cask.

Fixes #13027
2022-03-30 17:25:00 +01:00
Mike McQuaid
38e1b3d64b
Deprecations, disables, deletions for 3.4.0 2022-02-22 14:28:32 +00:00
Carlo Cabrera
902b4e1f3f
cask/dsl/caveats: add :requires_rosetta
Some casks will fail to install with a `Bad CPU type in executable`
error on Apple Silicon. See Homebrew/homebrew-cask#118638.

This error can be quite confusing, so let's add a way to help users know
that they need to install Rosetta to use or even install a cask.
2022-02-04 09:50:21 +08:00
Mike McQuaid
a691768c81
cask/exceptions: fix reinstall cask messaging.
Fixes #12813.
2022-02-01 08:39:40 +00: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
Dabezt
0b44dd5a48 Make trash.swift safer and more modern 2021-12-31 14:07:42 +03:00
Dabezt
e4f106533e Modernize quarantine.swift 2021-12-31 13:23:45 +03:00
Rylan Polster
2e6b6ab3a2
Fix style 2021-12-24 21:15:21 -05:00
fn ⌃ ⌥
68160df041 cask: add #csv to version DSL 2021-11-16 16:34:12 -08:00
Nihaal Sangha
1984ca098d
Update cask cookbook header 2021-11-07 01:23:31 +00:00
Bo Anderson
4836ea0ba2
Remove XQuartz handling 2021-11-05 12:40:22 +00:00
Sam Ford
77273fe2b3
Cask::Audit: Handle referenced cask in livecheck
`Cask::Audit#check_livecheck_version` was never updated to handle
a referenced cask in a `livecheck` block (e.g., `cask "other-cask"`).
As a result, this audit will wrongly give an error like `Version
'1.2.3' differs from '' retrieved by livecheck.` in this scenario.

This commit ensures that a referenced cask is handled by the audit
and it won't error when the referenced check provides a good version.
2021-11-02 12:32:38 -04: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
e24703e58d
Rename :cert_error_allowlist to :secure_connection_audit_skiplist 2021-10-21 21:11:06 -04:00
Rylan Polster
fa4bb7d74a
Refactor audit exception handling 2021-10-21 21:11:05 -04:00
Rylan Polster
d124d8eae8
cask/audit: allow the homepage https audit to have exceptions 2021-10-21 21:01:52 -04:00
George Adams
8c22e009ac
update depends_on_java to suggest temurin
AdoptOpenJDK has been deprecated. Temurin is the new cask
2021-10-21 13:00:00 +01:00
fn ⌃ ⌥
04710be2a8
install: fix --skip-cask-deps message 2021-09-27 18:25:39 -07:00
fn ⌃ ⌥
8dc060c88b upgrade: use greedy_* method parameters 2021-09-21 11:45:49 -07:00
XuehaiPan
c2d5d84b21 Merge remote-tracking branch 'upstream/master' into fix-inconsistent-shell-style 2021-09-16 01:01:49 +08:00
XuehaiPan
3f96d963f7 style: fix inconsistent code style for shell scripts 2021-09-15 14:59:01 +08:00
Bo Anderson
bb69e1ee4d
Merge pull request #12037 from Bo98/type-bump
Bump various type strictnesses
2021-09-14 02:18:38 +01:00
Mike McQuaid
1a904af264
Merge pull request #12018 from FnControlOption/upgrade-tsort
upgrade: use topological sort to upgrade formulae
2021-09-12 19:26:22 +01:00
Bo Anderson
861dea9ada
Bump various type strictnesses 2021-09-11 01:00:23 +01:00
hyuraku
e44ac800c2 repair cask install quiet mode 2021-09-10 23:12:52 +09:00
fn ⌃ ⌥
0c3e49092c upgrade: use topological sort to upgrade formulae 2021-09-09 13:41:50 -07:00
FnControlOption
eb16e10902 messages: record cask installations.
This is used to record installation times and also to determine
whether to display caveats.
2021-09-02 08:44:00 -07:00
FnControlOption
278c06f31d upgrade: deduplicate cask caveats.
Cask::Installer.caveats invokes Homebrew.messages.record_caveats
so only invoke it once and store the return value.
2021-09-02 08:43:56 -07:00
EricFromCanada
c234d1ea03
upgrade: list upgradeable dependencies/migrations/cleanups on dry run 2021-08-31 12:27:14 -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
Rylan Polster
663cc40139
Add per-os versions to Cask::Cask#to_h 2021-08-24 11:35:19 -04:00
Rylan Polster
ea2e40c69a
Add Cask::Cask#source to return cask's source code 2021-08-14 16:18:13 -04:00
Rylan Polster
99635bf3ae
Remove need for homebrew/cask to be tapped 2021-08-14 16:17:26 -04:00
Mike McQuaid
b3dd9fb42f
Merge pull request #11629 from bevanjkay/upgrade_outdated_skipunversioned
adds an option to skip unversioned casks in outdated and upgrade command
2021-08-03 08:53:53 +01:00
ylht
75a38b7187 refactor the format 2021-07-19 10:02:19 +08:00