155 Commits

Author SHA1 Message Date
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
935c5efaf8
Use sudo for rmdir if necessary. 2023-05-13 06:46:59 +02:00
Markus Reiter
2c71d9dcd8
Use sudo for symlinks if necessary. 2023-05-13 03:42:00 +02:00
JBYoshi
84ad387661
Clean up code for feedback. 2023-05-11 13:29:56 -05:00
JBYoshi
29c9921726
Also use / above. 2023-05-11 12:47:37 -05:00
JBYoshi
d0e64e2c57
Use / for path concatenation. 2023-05-11 12:46:05 -05:00
JBYoshi
2e8232de39
Replace wildcard copy with a loop over children.
Fixes one of the errors in https://github.com/orgs/Homebrew/discussions/4498 (specifically "cp: [...].app/*:
No such file or directory").
2023-05-11 11:47:16 -05:00
Markus Reiter
df620ad3ba
Make manual installers easier to open. 2023-05-08 08:25:32 +02:00
Mike McQuaid
0e387fee8c
Merge pull request #15138 from JBYoshi/cask-move-contents
Don't remove cask directories when upgrading.
2023-05-04 11:43:44 +01:00
JBYoshi
4935a8fbb2
Remove unreachable warning. 2023-04-30 12:29:40 -05:00
Ilya Kulakov
476d97934f sudo: change sudo_user to sudo_as_root. 2023-04-28 11:22:54 -07:00
Ilya Kulakov
d470661b37 sudo: add the sudo_user arg to SystemCommand. 2023-04-28 11:11:53 -07:00
Ilya Kulakov
563387a7b4 sudo: explicitly specify the root user where necessary
With sudoers one may override default sudo user. This mostly works
provided the admin configured the replacement appropriately. However
there are exceptions that absolutely must be run by root such as
/usr/sbin/installer and, under certain circumstances, /bin/launchctl.
2023-04-28 11:11:53 -07:00
JBYoshi
a1571702d3
Merge remote-tracking branch 'origin/master' into cask-move-contents 2023-04-25 15:44:29 -05:00
Douglas Eichelberger
08af78a2a5 brew style --fix 2023-04-25 09:26:24 -07:00
Douglas Eichelberger
24cf6076e8 brew style --fix 2023-04-24 20:42:39 -07:00
JBYoshi
432e0c6b5b
Extract artifact checks to matching_artifact? function. 2023-04-24 10:59:01 -05:00
JBYoshi
f97bce040f
Update for feedback. 2023-04-24 10:50:01 -05:00
JBYoshi
2e85f2beb2
Merge remote-tracking branch 'origin/master' into cask-move-contents 2023-04-15 21:37:56 -05:00
EricFromCanada
b9dab243b5
cask/artifact: fix up some definitions
And expand the list of artifacts that target: works with.
2023-04-14 15:47:33 -04:00
JBYoshi
9fedaee462
Only keep empty directories when the new version also has them. 2023-04-08 16:13:12 -05:00
Mike McQuaid
63d8de3600
brew style --fix 2023-04-07 19:10:22 +01:00
JBYoshi
dcc4ae76e8
Also keep app directories with "brew reinstall". 2023-04-04 11:36:27 -05:00
JBYoshi
3f8998a4fc
Reset extended attributes of the base directories. 2023-04-03 20:21:37 -05:00
JBYoshi
8c4f29d983
Don't remove cask directories when upgrading.
Fixes Homebrew/homebrew-cask#102721.
2023-04-03 18:48:24 -05:00
Markus Reiter
3da305fa80
Add keyboard_layout stanza. 2023-03-26 08:14:24 +02:00
Douglas Eichelberger
4dcd5ac47f Remove HashValidator 2023-03-19 17:37:58 -07:00
Douglas Eichelberger
516c61057b Use ActiveSupport Hash#assert_valid_keys instend of refinement 2023-03-19 17:37:58 -07:00
Ruoyu Zhong
e9ce4a5a4e
Update path to system settings on Ventura
"System Preferences" has been renamed to "System Settings" on Ventura.
Privacy and security settings have moved, too. This commit makes sure
these changes are reflected. (Some adjustments were already made in
#14092.)

Signed-off-by: Ruoyu Zhong <zhongruoyu@outlook.com>
2023-03-17 19:24:07 +08:00
Douglas Eichelberger
900ee97f95 Revert splat changes to AbstractUninstall 2023-03-07 06:46:59 -08:00
Douglas Eichelberger
d98b7845d3 Enable typing in misc files 2023-03-03 08:29:26 -08: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
Douglas Eichelberger
29c6baeed1 Enable typing in Cask::Artifact 2023-02-22 09:11:29 -08:00
apainintheneck
39c6f7d6fb Stop including *flight block source in cask API
Originally we were going to try and load the *flight blocks from the API
but we ended up going with downloading the caskfile for the subset of
casks that need this functionality for consisty's sake.

This reverts the following commits from most recent to oldest:
- ffc74a51fb32b66a4cd8bc41dbd076dd23d9100e
- e5616e94fe42505434c330be35eeafef2739944f
- d1490c3d5c087d00f2bca1787cce331202b195c5
- 7ca5a5d9a71a73f21bbb8555a38048f027bee89b
- 2d5d132713d0701d02d5ff33e9918812d13d2a83

It also changes how *flight blocks are handled in `.to_h`.
Essentially, when *flight blocks exist they are just included
as a hash of the artifact to nil to indicate that they exist.

More information isn't necessary since we don't evaluate
the current source code in the *flight artifacts that
we get from the API.
2023-02-13 21:22:18 -08:00
Mike McQuaid
61d6f7c4ca
cask/artifact/stage_only: allow string argument.
This is what's passed from the JSON API.
2023-01-26 11:22:18 +00:00
Luca Ongaro
1fc1c82aed Fix code style and add tests 2023-01-25 00:08:15 +01:00
Luca Ongaro
f5765a73da Avoid mutating the script argument in place
Mutating the argument in place, and in particular deleting the
`:executable` entry, leads to a bug when the same code path leading to
read_script_arguments is invoked twice, like in
https://github.com/Homebrew/homebrew-cask/pull/139749

This commit makes a shallow copy of the argument, so that it can be
safely mutated in the rest of the method.
2023-01-24 23:34:47 +01:00
Mike McQuaid
1adc2c096b
Merge pull request #14370 from Kentzo/fix-cask-lowpriv-sudo
cask: don't assume that sudo has write access to the caskroom
2023-01-20 10:57:35 +00:00
Mike McQuaid
344d32bf7f
Merge pull request #14368 from Kentzo/fix-cask-backup
cask: fix writability check backing up an artifact
2023-01-19 09:58:03 +00:00
Ilya Kulakov
618700a95c cask: don't assume that sudo has write access to the caskroom 2023-01-13 18:10:21 -08:00
Ilya Kulakov
085bd8ddd1 cask: don't attempt to make a directory that already exists. 2023-01-13 16:15:31 -08:00
Ilya Kulakov
3d16112b14 cask: fix writability check backing up an artifact 2023-01-13 15:30:14 -08:00
Rylan Polster
7ca5a5d9a7
Simplify require "method_source" calls 2023-01-02 17:41:36 -05:00
Rylan Polster
2d5d132713
Include *flight block source in cask API 2023-01-02 14:33:33 -05:00
Bevan Kay
3869bf156c
change line splitting method 2022-12-29 12:54:59 +11:00
Bevan Kay
db9d48a7ec
fix tests 2022-12-28 12:50:16 +11:00
Bevan Kay
2614a29419
fix style 2022-12-19 14:43:16 +11:00
Bevan Kay
84f288be79
fix style 2022-12-19 14:39:48 +11:00
Bevan Kay
1ddd130ef9
add comment to .drop(), don't add blank lines to services array 2022-12-19 14:35:20 +11:00