606 Commits

Author SHA1 Message Date
hyuraku
de7152b7a3 rename Cask::outdated_versions 2023-06-19 22:09:01 +09: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
d2231086bd
Merge pull request #15420 from reitermarkus/simulate-system-with
Add `SimulateSystem::with`.
2023-05-14 21:41:20 +02:00
Mike McQuaid
3dabf504bd
Merge pull request #15176 from reitermarkus/cask-renames
Implement cask renames.
2023-05-14 19:46:56 +01:00
Markus Reiter
0d56b97b07
Add SimulateSystem::with. 2023-05-14 01:45:04 +02:00
Markus Reiter
d7a0e260e8
Improve Cask::Utils.gain_permissions_remove for symlinks. 2023-05-13 03:54:48 +02:00
Markus Reiter
4e483c9a0e
Add test for Cask::Utils::gain_permissions_mkpath. 2023-05-13 03:42:00 +02:00
Markus Reiter
a3231a03fa
Implement cask renames. 2023-05-12 21:17:30 +02:00
JBYoshi
b1c7f12fbb
Clean up allow and expect. 2023-05-12 09:57:12 -05:00
JBYoshi
4a3b8923f2
More test cleanup. 2023-05-12 09:52:57 -05:00
JBYoshi
5e23a0563a
Switch base case expect() to allow(). 2023-05-11 17:10:41 -05:00
JBYoshi
7a108d3db0
Merge and_call_original instruction into expect() calls. 2023-05-11 17:09:27 -05:00
JBYoshi
84ad387661
Clean up code for feedback. 2023-05-11 13:29:56 -05:00
JBYoshi
a1780c842c
Improve unit test to make sure the sudo version is used. 2023-05-11 12:44:35 -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
8274920217
Rename OS::Mac::Version to MacOSVersion. 2023-05-09 05:08:38 +02: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
Ilya Kulakov
6a4322833f sudo: Fix tests. 2023-04-28 11:22:54 -07:00
Bo Anderson
44f058edb5
Refactor formula, cask and Ruby source downloads to use shared code 2023-04-27 23:23:07 +01:00
JBYoshi
a1571702d3
Merge remote-tracking branch 'origin/master' into cask-move-contents 2023-04-25 15:44:29 -05:00
Issy Long
935649abaf
Merge pull request #15263 from Homebrew/dependabot/bundler/Library/Homebrew/rubocop-rspec-2.20.0
build(deps): bump rubocop-rspec from 2.19.0 to 2.20.0 in /Library/Homebrew
2023-04-22 18:58:03 +01:00
Douglas Eichelberger
ec39fe7bb1
Merge pull request #15283 from dduugg/no-false-sigil
Remove `# typed: false` sigil in tests
2023-04-21 19:44:09 -07:00
Issy Long
4a87c624d7
Fix new RSpec/IndexedLet offenses 2023-04-22 01:02:38 +01:00
Douglas Eichelberger
9075cbae62 brew style --fix 2023-04-21 09:58:50 -07:00
Douglas Eichelberger
ac1e6ded9a git grep -l '# typed: false' | xargs gsed -i 's|# typed: false||g' 2023-04-21 09:57:47 -07:00
Mike McQuaid
f2d064b8ae
Merge pull request #15264 from vitorgalvao/patch-1
Cask audit: check binary signature and notarisation
2023-04-21 07:52:11 +01:00
apainintheneck
a2f9f89d30 cask/audit_spec: fix outdated test
We used the binary artifact as an example of an unsigned artifact
before in this test. Now that we're adding it as a signed artifact
the test has been updated with another example of an unsigned one.
2023-04-20 23:37:05 -07:00
hyuraku
b2156dc125 add casks install to cmd/install 2023-04-19 21:31:22 +09:00
hyuraku
cba118533b remove cask/cmd specs 2023-04-19 21:06:27 +09:00
Mike McQuaid
0b4c0350c2
Merge pull request #15201 from hyuraku/remove_cask/cmd/audit
remove `cask/cmd/audit`
2023-04-19 10:01:06 +01:00
JBYoshi
2e85f2beb2
Merge remote-tracking branch 'origin/master' into cask-move-contents 2023-04-15 21:37:56 -05:00
Ruoyu Zhong
1dd2e0cd7f
test/cask/dsl_spec: fix test for certain locale settings
As I mentioned in #15146, two `Cask::DSL` tests failed on my local
machine, even on `master`. `git bisect` suggested that it was #14998
that introduced those failures. It turned out that the tests here could
fail under certain locale settings, like this one below:

    $ defaults read -g AppleLanguages
    (
        "en-GB",
        "zh-Hans-SG"
    )

This is not actually a regression. With the aforementioned locale
settings, an explicit `let(:languages) { ["en"] }` setting would result
in locales being considered in the following order: `en`, `en-GB`,
`zh-Hans-SG`. For each of them, the `detect` method from `Locale` is
called, with `locale_groups` as `[["zh"], ["en-US"]]`, the list of
locales defined in the test cask.

    def detect(locale_groups)
      locale_groups.find { |locales| locales.any? { |locale| eql?(locale) } } ||
        locale_groups.find { |locales| locales.any? { |locale| include?(locale) } }
    end

Neither of `en` and `en-GB` satisfies the `detect` conditions. (Note
that `Locale.parse("en").include?("en-US")` evaluates to `false`.) But
`zh-Hans-SG` does (because `Locale.parse("zh-Hans-SG").include?("zh")`
is `true`). So, despite having `:languages` set to `en`, the Chinese
locale was still used.

This could be fixed by generalising the test cask's English locale
settings from `en-US` to `en`. This is already the case for most
existing casks:

    $ grep 'language "en.*", default: true' Casks/*.rb
    Casks/battle-net.rb:  language "en", default: true do
    Casks/cave-story.rb:  language "en", default: true do
    Casks/firefox.rb:  language "en", default: true do
    Casks/libreoffice-language-pack.rb:    language "en-GB", default: true do
    Casks/libreoffice-language-pack.rb:    language "en-GB", default: true do
    Casks/openoffice.rb:  language "en", default: true do
    Casks/seamonkey.rb:  language "en-US", default: true do
    Casks/thunderbird.rb:  language "en", default: true do
    Casks/wondershare-edrawmax.rb:  language "en", default: true do

Note that this should make the language stanza tests independent of
locale settings, because `zh` and `en` should be able to capture all the
test cases.

Signed-off-by: Ruoyu Zhong <zhongruoyu@outlook.com>
2023-04-13 11:27:20 +08:00
Markus Reiter
a085fb4ead
Fix code style.
Co-authored-by: Issy Long <issyl0@github.com>
2023-04-12 00:05:47 +02:00
Markus Reiter
3275b927b8
Make test not depend on macOS version. 2023-04-11 21:02:10 +02:00
hyuraku
4999639140 - remove cask/cmd/audit
- repair cmd/audit
2023-04-11 23:06:01 +09:00
hyuraku
ec0d492c09 move cask/cmd/reinstall to cask/reinstall 2023-04-10 22:07:06 +09:00
JBYoshi
9fedaee462
Only keep empty directories when the new version also has them. 2023-04-08 16:13:12 -05:00
Issy Long
dcc44f164d
Merge pull request #15105 from issyl0/cask-audit-only-failures-default
audit: Make `--display-failures-only` the default for Casks
2023-04-07 14:43:51 +01:00
Issy Long
d636d2de37
Apply suggestions from review comments
- Rename `strictish` to `strict_only` in `add_error` method.
- Return just `errors`, a Set, not `{ errors: errors }`, a Hash,
  from `Auditor.audit`.
2023-04-06 00:10:28 +01:00
JBYoshi
dcc4ae76e8
Also keep app directories with "brew reinstall". 2023-04-04 11:36:27 -05:00
Issy Long
7cfa544aec
cask/utils: Make more noise when encountering undefined methods
- https://github.com/Homebrew/homebrew-cask/actions/runs/4608585102/jobs/8144571098
  introduced syntax errors for the `mattermost` cask (`autoupdates`
  instead of `auto_updates`), but CI didn't fail so we didn't notice
  until it shipped to users and broke `brew update`.
2023-04-04 17:08:54 +01:00
JBYoshi
5c9fa845a8
Add unit test for upgrading. 2023-04-04 10:22:45 -05:00
Issy Long
df8e97fef6
Consolidate add_{warning,error} methods into one
- Specify `strictish: true` in `add_error` to specify that it's not a
  super big critical error.
- These will be shown only if `brew audit --strict` is requested.
2023-04-01 01:56:47 +01:00
Issy Long
2b8127d518
Turn cask warnings into errors when --strict is passed (or implied)
- Ignore them and don't show them otherwise.
- Part three of issue 15074:
  > As a result, I propose that all current cask audit warnings are never
  > displayed as warnings but the underlying audit checks turned into
  > errors displayed only with --strict (or one of the other relevant
  > flags).
2023-04-01 01:56:46 +01:00
Issy Long
a4e8f9e22b
audit: Make --display-failures-only the default for Casks
- Cask warnings are really noisy and numerous. Let's only show them if
  the user passes `--strict` or something implying `--strict`, like
  `--new-cask`.
- Additionally remove `display_passes` since we would like silence if
  nothing is wrong with the cask, the same as with formula audits.
2023-04-01 01:56:45 +01:00
Markus Reiter
bdd6523ce8
Deprecate appcast. 2023-03-30 03:29:06 +02:00
apainintheneck
6ccf21c2c9 Merge branch 'master' into add-service-block-to-formula-api 2023-03-22 20:06:32 -07:00
apainintheneck
801ee5e474 Address feedback
- style nits
- better comments for tests that are not idempotent
- moved appdir placeholder constant to global.rb
2023-03-22 19:43:49 -07:00