54 Commits

Author SHA1 Message Date
Mike McQuaid
2a7c7511c3
cask/quarantine: tweak wording.
Co-authored-by: Eric Knibbe <enk3@outlook.com>
2025-03-20 18:07:30 +00:00
Mike McQuaid
10ad72c348
quarantine: allow skipping the app management permissions prompt.
If we know that we don't care about this prompt, let's allow setting
a variable to avoid alarming users.
2025-03-20 16:22:41 +00:00
Sean Molenaar
c34b71655c feat: allow font install on linux
Apply suggestions from code review

Co-authored-by: Douglas Eichelberger <697964+dduugg@users.noreply.github.com>

feat: add linux appdir

Apply suggestions from code review

Co-authored-by: Douglas Eichelberger <697964+dduugg@users.noreply.github.com>
2025-01-19 11:14:24 +01:00
Douglas Eichelberger
ffb15ffcf5
brew style --fix 2024-11-05 16:44:12 +00:00
Issy Long
45978435e7
rubocop: Use Sorbet/StrictSigil as it's better than comments
- Previously I thought that comments were fine to discourage people from
  wasting their time trying to bump things that used `undef` that Sorbet
  didn't support. But RuboCop is better at this since it'll complain if
  the comments are unnecessary.

- Suggested in https://github.com/Homebrew/brew/pull/18018#issuecomment-2283369501.

- I've gone for a mixture of `rubocop:disable` for the files that can't
  be `typed: strict` (use of undef, required before everything else, etc)
  and `rubocop:todo` for everything else that should be tried to make
  strictly typed. There's no functional difference between the two as
  `rubocop:todo` is `rubocop:disable` with a different name.

- And I entirely disabled the cop for the docs/ directory since
  `typed: strict` isn't going to gain us anything for some Markdown
  linting config files.

- This means that now it's easier to track what needs to be done rather
  than relying on checklists of files in our big Sorbet issue:

```shell
$ git grep 'typed: true # rubocop:todo Sorbet/StrictSigil' | wc -l
    268
```

- And this is confirmed working for new files:

```shell
$ git status
On branch use-rubocop-for-sorbet-strict-sigils
Untracked files:
  (use "git add <file>..." to include in what will be committed)
        Library/Homebrew/bad.rb
        Library/Homebrew/good.rb

nothing added to commit but untracked files present (use "git add" to track)

$ brew style
Offenses:

bad.rb:1:1: C: Sorbet/StrictSigil: Sorbet sigil should be at least strict got true.
^^^^^^^^^^^^^

1340 files inspected, 1 offense detected
```
2024-08-12 15:24:27 +01:00
Markus Reiter
0f0055ede4
Make documentation @api private by default. 2024-04-26 19:04:20 +02:00
Bo Anderson
2d929b8a9f
cask/quarantine: avoid xcrun when executing Swift 2024-03-02 19:31:38 +00:00
Douglas Eichelberger
eb7c3e52a0 Require SystemInclude only where needed 2024-01-31 11:42:01 -08:00
Edward
f21af1e3eb
fix: xattr check in download quarantine 2023-10-25 21:22:06 +08:00
Mike McQuaid
58df7885e6
cask/quarantine: sudo correctly during tests.
Use `NeverSudoSystemCommand` and pass it through to
`Quarantine.copy_xattrs` so `brew tests` doesn't try to `sudo`.

Fixes #15958

Co-authored-by: Bo Anderson <mail@boanderson.me>
Co-authored-by: Kevin <apainintheneck@gmail.com>
2023-09-06 10:03:45 -04:00
Mike McQuaid
eadac2fb2a
cask/quarantine: tweak wording. 2023-07-06 14:10:13 +01:00
Marcin Floryan
1b474a508d
App Management message updated
With the update of MacOS from Monterey (12) to Ventura (13) the appearance of the System Settings has changes and the "Security & Privacy" category has been renamed to "Privacy & Security".

I am aware that currently Ventura has a very low adoption rate so this change could be premature.
2023-07-06 14:43:36 +02:00
Ismayil Mirzali
8a52ae2933
cask/quarantine: fix exception not being caught
Changes the rescue clause to also handle EPERM.

This fixes the issue of cask upgrades/reinstalls to failing due to
permissions [1]. It's worth noting though, the prompt for allowing App
Management permissions does not seem to occur, so that's something else
to be investigated.

1. https://github.com/Homebrew/homebrew-cask/issues/148253

Signed-off-by: Ismayil Mirzali <ismayilmirzeli@gmail.com>
2023-06-05 18:54:44 +03:00
Mike McQuaid
89dfe4fc5b
Merge pull request #15483 from JBYoshi/cask-prompt-permissions
Check for App Management permissions before updating apps.
2023-05-29 09:15:22 +01:00
Mike McQuaid
98dd8610ae
Tweak code style and documentation wording 2023-05-29 08:59:35 +01:00
JBYoshi
97b9b61061
Change permission failure from fatal to warning. 2023-05-26 11:13:23 -05:00
JBYoshi
40352cb2da
Make Homebrew check for App Management permissions before updating apps. 2023-05-24 22:11:16 -05:00
Markus Reiter
43c6b0ab61
Use sudo for copying xattrs when necessary. 2023-05-24 23:39:18 +02:00
JBYoshi
ad8ce82673
Fix typing on revert_upgrade().
Also adds several type signature checks to test for these errors.
2023-05-12 14:53:27 -05:00
JBYoshi
3e249a9428
Improve styling. 2023-05-03 11:29:01 -05:00
JBYoshi
a1571702d3
Merge remote-tracking branch 'origin/master' into cask-move-contents 2023-04-25 15:44:29 -05:00
Douglas Eichelberger
24cf6076e8 brew style --fix 2023-04-24 20:42:39 -07:00
JBYoshi
f97bce040f
Update for feedback. 2023-04-24 10:50:01 -05:00
JBYoshi
3f8998a4fc
Reset extended attributes of the base directories. 2023-04-03 20:21:37 -05:00
Douglas Eichelberger
abfe29040b Enable types in Library/Homebrew/cask 2023-03-18 16:03:10 -07:00
Bo Anderson
9c3359afa1
cask/quarantine: fix quarantine not working under some setups 2022-06-02 18:53:46 +01: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
ylht
75a38b7187 refactor the format 2021-07-19 10:02:19 +08:00
ylht
e5986dba6c cmd/doctor: repair xattr not find 2021-07-19 09:55:30 +08:00
EricFromCanada
2ed324ebc0 use backticks around suggested input, flags, and binaries 2021-01-26 16:19:47 -05:00
Markus Reiter
da9289eff0 Add more type signatures. 2020-11-13 12:26:36 +01:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Markus Reiter
ad74b96dd8 Document Quarantine. 2020-08-26 03:13:59 +02:00
Markus Reiter
8a32954940 Move cask/all to just cask. 2020-08-09 01:34:07 +02:00
Markus Reiter
16b3cb0d71 Skip quarantining symlinks. 2019-10-15 18:32:37 +02:00
L. E. Segovia
ed7327296a
Cask: only quarantine working symlinks
Fixes Homebrew/homebrew-cask#70796
2019-10-14 15:38:41 +00:00
ytqh
24ef7fa5c8 remove xattr unsupported option in macOS 10.15 2019-10-11 21:18:53 +08:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Mike McQuaid
737b84b54b
brew style --fix fixes. 2018-11-02 17:29:23 +00:00
Markus Reiter
9b84b2404a
Merge pull request #5087 from amyspark/xattr-fail
Cask: fix quarantine check when xattr is broken
2018-10-13 23:52:41 +02:00
L. E. Segovia
1707caf968
Cask: fix quarantine check when xattr is broken 2018-10-13 01:27:36 +00:00
L. E. Segovia
2c9b599c0a
Cask: simplify chmod +w passes 2018-10-08 18:23:21 +00:00
L. E. Segovia
59fcaa3674
Cask: set write permissions on symlinks 2018-10-08 01:39:52 +00:00
Viktor Szakats
a0d971a0d0 secure/fix URLs 2018-10-03 21:21:05 +00:00
L. E. Segovia
6d7e49b02b
Cask: check if xattr works before quarantining
Fixes Homebrew/homebrew-cask#52128.
2018-09-26 20:55:54 +00:00
L. E. Segovia
123dda09f0
Cask: constrain quarantine support status
Quarantine is available ONLY if the script exits with '2'.
It is definitely NOT available if Swift doesn't exist or if
it exits with '5' (incompatible SDK). All other cases are
from now on treated as unsupported.

Also print to standard error only when explictly required (via an
exception).
2018-09-14 15:48:16 +00:00
L. E. Segovia
124a8109ce
Cask: rename no-translocation-bit changer function 2018-09-08 20:20:55 +00:00
L. E. Segovia
c7c14e1333
Cask: split quarantine/release functions 2018-09-08 14:00:44 +00:00
L. E. Segovia
53b95c6260
Cask: use native chmod to set write permissions
Ruby chmod follows symlinks, which can point to non-existent files. This
should fix quarantining Casks e.g. disk-inventory-x.
2018-09-07 16:57:00 +00:00
L. E. Segovia
ab31af2b4b
Cask: fixes for quarantining
Gatekeeper's Path Randomization is currently making automated
installation a nightmare. Let's manually toggle the (undocumented) app
translocation bit in the `com.apple.quarantine` extended attribute.

While we're at it, let's also toss in some fixes:

- zip downloads with improper permissions that prevent us from
quarantining
- quarantine/release/skip downloads as requested by the user
2018-09-07 15:37:31 +00:00