503 Commits

Author SHA1 Message Date
Mike McQuaid
5994f165f5
Merge pull request #14123 from bevanjkay/cask-wildcard-launchctl
cask/artifact/abstract_uninstall: allow wildcard entries for launchctl
2022-12-29 19:26:53 +00:00
Bevan Kay
3bdab156c2
add additional test 2022-12-29 12:54:21 +11:00
Bevan Kay
db9d48a7ec
fix tests 2022-12-28 12:50:16 +11:00
Bevan Kay
01f865f93a
update test 2022-12-19 14:35:31 +11:00
Mike McQuaid
77c0d38c35
brew style --fix 2022-12-13 11:37:06 +00:00
Bevan Kay
e8e6ee30b4
add initial tests 2022-12-13 00:00:43 +11:00
Ian Gregory
a715dec49d Add --adopt switch
Allows `brew install` & co. to adopt existing cask artifacts that are
identical to those being installed.

Discussion: #14006
2022-10-21 23:28:51 -04:00
Bo Anderson
eac32f0b20
Additional fixes for Ruby 3 compatibility 2022-10-18 01:54:59 +01:00
Sean Molenaar
67c6cae6a0
Merge pull request #13857 from SMillerDev/feature/cask/auto_audit
Cask: automatically add cask audits
2022-09-15 16:27:07 +02:00
Sean Molenaar
f049e90e41
audit_spec: style fix 2022-09-15 15:33:25 +02:00
Sean Molenaar
5697ca79b1
audit_spec: limit stanza check 2022-09-15 15:27:43 +02:00
Sean Molenaar
ff54095b8a
Cask: automatically add cask audits
This reverts commit 16618374653dc5461dd971e8ed1992188cc3803d.
2022-09-13 11:19:33 +02:00
Mike McQuaid
7349c2b996
brew style --fix 2022-09-13 09:43:09 +01:00
Mike McQuaid
1661837465
Revert "Cask: automatically add cask audits" 2022-09-06 11:46:40 +01:00
Sean Molenaar
86f011cefb
Cask: automatically add cask audits 2022-08-29 11:28:20 +02: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
Rylan Polster
fcb30c1ead
Merge pull request #13702 from Rylan12/sha256-arch
Add `arm:` and `intel:` arguments to cask `sha256` stanza
2022-08-17 10:34:04 -04:00
Sean Molenaar
cc61a759ed
Merge pull request #13627 from SMillerDev/feature/cask/signing_check
cask: add audit for incorrect signing
2022-08-16 10:51:59 +02:00
Rylan Polster
686e02b7ce
Add arm: and intel: arguments to cask sha256 stanza 2022-08-16 00:48:24 -04:00
fn ⌃ ⌥
783fcfb97c Fix tests 2022-08-15 07:52:32 -07:00
Sean Molenaar
e90371f8ab
cask: add audit for incorrect signing 2022-08-11 09:11:29 +02:00
Rylan Polster
19c955d19a
Fix tests 2022-08-09 14:54:33 -04:00
Rylan Polster
76ae20a12f
Re-add on_arch_conditional DSL 2022-08-09 11:34:52 -04:00
Rylan Polster
dd72f1ac95
Add arch cask DSL 2022-08-05 17:12:55 -04:00
Rylan Polster
6c35317732
Add and update tests 2022-07-21 16:41:23 +02:00
Rylan Polster
eab3d077bc
Improvements 2022-07-21 15:32:51 +02:00
apainintheneck
ee68f813d8 cask/cmd/list_spec.rb: fix leaky version variable
The lazy evaluation in let() was failing to reset MacOS#full_version
to the original_macos_version. This meant that all tests run after
this one automatically had MacOS#version == 12 which caused some
of the tests to fail if you were running a different macOS version.
2022-07-11 15:23:31 -07:00
Mike McQuaid
2d5eab2e1c
brew style --fix 2022-06-30 08:56:21 +01:00
Rylan Polster
ac067eedb2
Create MacOSVersions module 2022-06-29 11:34:49 -04:00
Rylan Polster
d96a8fd35e
Fix tests 2022-06-24 17:20:03 -04:00
Rylan Polster
6ebd5174d6
Update tests for on_* methods in formulae and casks 2022-06-24 14:39:17 -04:00
Bo Anderson
02164a35db
Use ORIGINAL_PATHS over envs; reject nil PATH 2022-06-17 19:47:57 +01:00
Bo Anderson
40bbdc659e
Fix some Style/FetchEnvVar offences 2022-06-17 19:47:57 +01: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
Bo Anderson
b63595a627
test/cask/quarantine: improve audit test output 2022-05-31 03:29:42 +01:00
Bevan Kay
e64ab4c0f7
Fix test 2022-05-30 18:30:18 +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
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
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
Issy Long
6b76fd012a
Fix (auto-correct) RuboCop RSpec/BeNil offenses 2022-03-01 00:10:10 +00:00
Mike McQuaid
16bdd42308
cask/dsl/version_spec: remove deprecated specs.
No idea why these didn't fail before now?
2022-02-25 15:26:37 +00:00
fn ⌃ ⌥
68160df041 cask: add #csv to version DSL 2021-11-16 16:34:12 -08: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
41e94afda5
Fix brew style
Fixes for https://github.com/Homebrew/brew/pull/12152.

Extracted into a separate PR so this can be merged immediately.
2021-09-30 10:13:53 +01: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
Misty De Meo
5d5fb944d2
List spec: fix hardcoded library path 2021-06-15 21:24:50 -07:00
Sam Ford
e8f803bc75
Cask::Audit: Handle livecheck skip conditions 2021-06-14 14:28:27 -04:00