2149 Commits

Author SHA1 Message Date
Bevan Kay
a77a8ca564
cask/dsl/caveats: allow for simulated system checks in rosetta caveat 2024-07-09 15:42:38 +10:00
Rylan Polster
c16a9b33b2
Use cached json API file for formulae and cask specified paths 2024-07-03 13:41:52 -04:00
Mike McQuaid
c524e5c2fc
Merge pull request #17608 from Homebrew/audit_min_os-more-fixes 2024-07-02 09:03:49 +01:00
Eric Knibbe
3f73f32286
cask/audit: handle on_os range bounded by depends_on 2024-07-01 23:11:26 -04:00
apainintheneck
16e605e056 Load tap migration renames from API with short names
This is a follow-up to 484498e. I added loading for tap migration
renames from the API but it apparently only worked for full names.

There was a bug in both the code and the tests which prevented
loading by short names. This fixes those bugs so everything should
be good now.
2024-07-01 18:53:31 -07:00
Mike McQuaid
484498ea7c
Merge pull request #17599 from Homebrew/load-tap-migration-renames-from-api 2024-07-01 08:43:44 +01:00
Mike McQuaid
6ca46550d9
Merge pull request #17596 from Homebrew/audit_min_os-arch-specific 2024-06-30 19:32:34 +01:00
apainintheneck
10aa981209 Load tap migration renames from the API
These would not get loaded from the API at all meaning these
were not loadable by the old names when the core formula or cask
tap was not installed. We assume that most users don't have those
core taps tapped which means this is broken for most everyone.
2024-06-30 11:26:03 -07:00
Mike McQuaid
3948359aab
Merge pull request #17575 from krehel/update-audit-rosetta 2024-06-30 19:23:24 +01:00
Eric Knibbe
0d3e50d144
cask/audit: handle arch-specific detected min OS 2024-06-30 00:23:45 -04:00
Mike McQuaid
a7b2da0fc4
cask/audit: use select instead of reject.
Co-authored-by: Rylan Polster <rslpolster@gmail.com>
2024-06-28 08:33:20 +01:00
Sean Molenaar
203049b2f5 fix: improve audit for binary stanza 2024-06-28 09:28:55 +02:00
Sean Molenaar
8e570a0e9b feat: check for unknown arch for casks 2024-06-28 08:53:10 +02:00
Justin Krehel
475fc1d281
cask/audit: filter bad artifacts in rosetta audit 2024-06-27 12:25:46 -04:00
Sean Molenaar
5fc3af15c5 feat: check if casks should warn about rosetta 2024-06-27 14:22:03 +02:00
Eric Knibbe
16863f3884
cask/audit: ensure on_os blocks specify a min OS 2024-06-25 22:20:21 -04:00
Eric Knibbe
f627c6331d
cask/audit: support on_os blocks in audit_min_os 2024-06-21 19:25:51 -04:00
Eric Knibbe
1ef1b0b556
cask: ignore minimum macOS in on_os blocks for variations 2024-06-20 23:19:09 -04:00
Kevin
c3c1528611
Revert "Use cp -c when copying files" 2024-06-17 21:17:10 -07:00
Mike McQuaid
e2d01583f6
Merge pull request #17512 from samford/cask-audit-livecheck-availability-user-agents 2024-06-15 18:28:48 +01:00
Bo Anderson
fa00d2a9fd
cask: fix trash.swift under Xcode 16 2024-06-15 03:09:50 +01:00
Sam Ford
fcc87c901d
Cask::Audit: Align user agents with livecheck
The `#page_headers` and `#page_content` methods in
`Livecheck::Strategy` will fetch a URL using our default user agent
but if the request fails it will retry with the `:browser` user agent.
[For context, it was added as an interim measure to make URLs work
that require a different user agent but I aim to remove it in the
future in favor of specifying the user agent in a `livecheck` block
(so we don't make unnecessary requests that we know will fail).]

`Cask::Audit#audit_livecheck_https_availability` checks the
`livecheck` block URL but it only does so using our default user
agent (i.e., it calls `#validate_url_for_https_availability` which
calls `Utils::Curl#curl_check_http_content` which has a `user_agents:
[:default]` parameter). Due to this behavioral mismatch, it's possible
for a `livecheck` block to work but for this cask audit to fail.

This addresses the issue by adding `user_agents: [:default, :browser]`
to the arguments the audit uses, which aligns its behavior with
livecheck's.
2024-06-14 15:38:24 -04:00
Mike McQuaid
1e0add6d66
Merge pull request #17373 from tesaguri/cp-reflink 2024-06-13 08:57:20 +01:00
Daiki Mizukami
8e8d0c0248
brew style --fix 2024-06-12 12:28:42 +09:00
Daiki Mizukami
028cfe1ea6
Utils::Cp: Rename to Utils::Copy
As per review feedback:

https://github.com/Homebrew/brew/pull/17373#discussion_r1633217748
2024-06-11 20:31:34 +09:00
Kevin
f8b1d1f56c
Merge pull request #17385 from pe/migrations-broken
Fix migrations of formulae and casks to non homebrew taps
2024-06-08 19:34:14 -07:00
Daiki Mizukami
67f280eb53
Utils::Cp: Add force_system keyword argument
This fixes the test for `UnpackStrategy::Directory`, which needs the
`cp` command.
2024-06-09 07:57:56 +09:00
Philippe Eberli
20fb068085 Fix migrations of formulae and casks to non homebrew taps 2024-06-08 16:29:23 +02:00
Daiki Mizukami
b2ddeecdd9
Utils::Cp: Remove copy prefix from method name
As per review feedback:

https://github.com/Homebrew/brew/pull/17373#pullrequestreview-2104523770

Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2024-06-08 07:58:20 +09:00
Daiki Mizukami
58852106c1
Utils::Cp: Rename copy* methods to copy*_with_attributes
As per review feedback:

https://github.com/Homebrew/brew/pull/17373#pullrequestreview-2103870774
2024-06-07 19:03:33 +09:00
Eric Knibbe
2d00e50071
cask: skip variations for inapplicable versions 2024-06-03 12:33:00 -04:00
Issy Long
509fffab2b
Make more files Sorbet typed: strict
- According to Spoom, these could be bumped automatically with no errors.
2024-06-02 15:15:24 +01:00
Douglas Eichelberger
179419d8bc rm unnecessary casts 2024-05-31 15:49:12 -07:00
Justin Krehel
700cbd893b
cask/audit: fix nested container extraction
Fixes edge cases where nested containers are used. Extraction for auditing artifacts did not pull the secondary container, which tried to audit the container instead of the contents.
2024-05-29 11:38:25 -04:00
Sam Ford
e2220ecc42
cask/audit: Rework tmpdir removal
I previously introduced a finalizer method in `Cask::Audit` to remove
the created `@tmpdir` once it's no longer needed but the existing
approach produces a `finalizer references object to be finalized`
warning when `brew audit` is run. I didn't see this warning when I
was originally testing it but now it reliably appears.

This reworks the finalizer to define it within the
`#extract_artifacts` method and use `@tmpdir` as the target object.
2024-05-27 13:09:46 -04:00
Mike McQuaid
ed73551cc7
cask/audit: remove debug message. 2024-05-27 08:10:20 +01:00
Aaron Ruan
ae851a7aa4
seperate audit for osdn url 2024-05-27 12:22:48 +08:00
Daiki Mizukami
deaac7ce47
Use Utils::Cp to copy files
This replaces `FileUtils.cp` and `system_command! "cp"` with the new
`Utils::Cp` utility where it is expected that the performance
improvement outweighs the cost of the system command invocation.
2024-05-27 12:11:41 +09:00
Aaron Ruan
7b21cc1856
fix typecheck 2024-05-27 09:32:54 +08:00
Aaron Ruan
73ead3e5f5
match with url host instead of string 2024-05-27 00:26:35 +08:00
Aaron Ruan
7da9ea07d0
fix style 2024-05-26 17:00:42 +08:00
Aaron Ruan
2fcbff8ee2
disable osdn.jp URL 2024-05-26 16:51:44 +08:00
Sam Ford
5701f92321
Clean up cask audit tmpdir after use
`Cask::Audit#extract_artifacts` is used in the `#audit_signing` and
`#cask_plist_min_os` methods to create a directory in `/tmp` and
extract cask artifacts without duplicating the work if it's already
done. However, due to how this is set up, `tmpdir` isn't removed
afterward and the extracted artifacts will take up disk space until
the `tmp` directory is cleaned up. As a result, running
`brew audit --strict --online` locally can chew through disk space
and it may not be clear to the user where their free space has gone.

This adds a finalizer method to `Cask::Audit` to remove the created
`@tmpdir` (if any) once it's no longer needed. There may be a better
way of addressing the issue but this works for now without having to
restructure how these audits work.
2024-05-24 09:22:12 -04:00
Mike McQuaid
6e9288470e
brew style --fix 2024-05-23 17:15:43 +01:00
Mike McQuaid
82591d12dc
Merge pull request #17031 from krehel/update-artifact-audit
cask/audit: update signing checks for app, binary, and pkg
2024-05-22 17:39:27 +01:00
Justin Krehel
344a5021d8
cask/audit.rb: update signing checks for app, binary, and pkg 2024-05-22 10:29:47 -04:00
Mike McQuaid
9586473f77
brew style --fix 2024-05-17 14:25:54 +09:00
Patrick Linnane
773dbfa92a
docs: update for Homebrew/cask-fonts deprecation
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2024-05-16 09:21:14 -07:00
Bevan Kay
db4099d977
cask/audit: fix sharding for font-* casks 2024-05-16 11:29:58 +10:00
Mike McQuaid
d194ed1b4f
Merge pull request #17265 from krehel/cask-font-fixes
Support font sharding in Homebrew/cask
2024-05-10 16:59:48 +01:00