5108 Commits

Author SHA1 Message Date
Bo Anderson
6d8b033eff
Significantly improve fetch speed of bottles 2023-06-22 15:08:16 +01:00
Bo Anderson
8dc2e80a98
Significantly improve install speeds with smarter postinstall detection 2023-06-22 03:06:45 +01:00
Razvan Azamfirei
b1baca7720
rephrase failure message 2023-06-20 11:33:49 -04:00
Razvan Azamfirei
c1009247bf
Apply suggestions from code review
Co-authored-by: FX Coudert <fxcoudert@gmail.com>
2023-06-20 08:59:01 -04:00
Razvan Azamfirei
adf6278e3c
rubocops: add emoji audit 2023-06-20 08:10:38 -04:00
hyuraku
de7152b7a3 rename Cask::outdated_versions 2023-06-19 22:09:01 +09:00
Mike McQuaid
75dd070395
Remove Google Analytics
We are now entirely migrated to InfluxDB so can remove all GA code.
2023-06-16 10:33:15 +01:00
Bo Anderson
f504b92c45
Preliminary macOS 14 (Sonoma) support 2023-06-05 23:21:11 +01:00
Mike McQuaid
286e175a31
Revert "PyPI: Handle non-pythonhosted formula URLs" 2023-06-05 17:21:56 +01:00
William Woodruff
7915363482
test: brew style --fix
Signed-off-by: William Woodruff <william@yossarian.net>
2023-06-04 23:33:46 -04:00
William Woodruff
af6f728eb4
utils, test: rewrite PyPI::Package
This rewrites the `Package` class from the ground up
to better accomodate non-PyPI URLs.

The existing APIs are largely preserved, but with
clearer invariants around when they can or can't be used
(e.g., `#pypi_info`).

Signed-off-by: William Woodruff <william@yossarian.net>
2023-06-04 23:32:09 -04:00
William Woodruff
ec0361fd9b
test: add another URL test for update_pypi_url
Signed-off-by: William Woodruff <william@yossarian.net>
2023-06-04 00:01:41 -04:00
Carlo Cabrera
8860d8398f
determine-test-runners: fix test 2023-05-29 23:06:09 +08: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
Sam Ford
ba7cf9df7a
Bitbucket: Fix tag match
The `Bitbucket` strategy currently matches versions from tag
tarball links on a project's `downloads/?tab=tags` page. It appears
that Bitbucket now uses a hash as the filename on this page instead
of the tag name, so the existing regex no longer matches.

This adds an alternative regex to match versions from the tag name
element (e.g., `<td class="name">example-1.2.3</td>`), which will fix
version matching in this scenario.
2023-05-19 10:55:28 -04:00
Markus Reiter
8371dde56a
Merge pull request #15435 from reitermarkus/working-dir-expand
Expand `service` paths.
2023-05-19 15:15:10 +02:00
Markus Reiter
e9bfcb9296
Merge pull request #15225 from reitermarkus/audit-os-arch
Add `--os=all` and `--arch=all` options for `brew audit`.
2023-05-19 15:03:32 +02:00
Markus Reiter
9885fbc129
Fix failing test. 2023-05-19 14:07:06 +02:00
Markus Reiter
c12ea0bc56
Also expand paths in command. 2023-05-18 20:00:46 +02:00
Markus Reiter
3484fa319b
Add tests. 2023-05-18 19:59:32 +02:00
Mike McQuaid
d70ebaea3d
Merge pull request #15409 from TheMDev/master
Download Strategy Dependency Missing Case
2023-05-18 13:09:57 +01:00
Kevin
946478aed4
Merge pull request #15396 from apainintheneck/custom-service-name
Custom service name
2023-05-17 22:09:31 -07:00
apainintheneck
f2adbf6613 service: change custom name DSL
After some discussion, we decided to change the DSL to get rid of
the `plist_name` and `service_name` methods which aren't meaningful
for most users.

The new DSL looks like this:

```rb
service do
  name macos: "name", linux: "name"
end
```

I also updated some specs here to reflect these changes.

There was some talk about maybe deprecating `plist_name` and `service_name`
but I think that's outside of the scope of this PR so I'm leaving
them as is for now. One benefit of this is that everything here is backwards
compatible.
2023-05-17 21:54:32 -07:00
Michael Wagner
78c07fd0e1
Fix Missing Download Strategy And Dependency 2023-05-17 16:30:00 -05:00
Markus Reiter
486c3765ce
Add --os=all and --arch=all options. 2023-05-17 15:26:46 +02:00
Sam Ford
104d30d231
Finish renaming GithubRelease to GithubReleases 2023-05-16 16:08:18 -04:00
Sean Molenaar
940b63cad3
chore: rename GitHubRelease to GitHubReleases 2023-05-16 14:19:01 -04:00
Sam Ford
bed4737826
GithubRelease: Add tests
This adds tests to cover all of the strategy outside of the
`#find_versions` method, which we don't currently test because it
involves a network request.
2023-05-16 14:19:00 -04:00
Sam Ford
db7a6baa33
GithubLatest: Fix test for GithubRelease changes
`GithubLatest` was updated to use parts of `GithubRelease` and this
works fine within `brew livecheck` (since we `require` all the
strategies) but we need to explicitly `require` `GithubRelease` in
the `GithubLatest` test file now. Without this, we encounter errors
in parts of `GithubLatest` where `GithubRelease` is referenced.
2023-05-16 14:18:22 -04:00
Markus Reiter
a7cc9a8b41
Fix BundleVersion comparison. 2023-05-16 14:23:15 +02:00
Markus Reiter
6c80308290
Merge pull request #15419 from reitermarkus/tag-standardized-arch
Compare `Tag` using `standardized_arch`.
2023-05-14 21:45:24 +02: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
apainintheneck
1bae81cba2 rubocops/service: add checks for custom service names
It now checks for two new edge cases.
1. Are the required methods defined in the block?
2. Is the `run` command defined if we're using methods other
   than `service_name` or `plist_name`?

It has also been updated to only get the list of method call nodes
once instead of doing it repeatedly for each cellar path check.
2023-05-13 14:53:01 -07:00
apainintheneck
1111706378 service: add custom service name DSL
The main thing is that this DSL allows us to provide an
interface that can be serialized to the JSON API.

Changes:
- Homebrew::Service
  - Adds `#service_name` and `#plist_name` methods
    - Each is now included in the `#serialize` method as well
  - Eval block on instantiation
    - Before we lazy evaluated this but the cost is not significant
      and it complicated the code a bunch. This only gets called
      during install, when evaluating caveats and in the `brew service`
      command. It skips this evaluation if the service block isn't there.
  - Add `#command?` helper to avoid `#command.blank?` and `#command.present?`
- Formula
  - `#service` now returns a service whenever it's called. This call is
    hidden behind a call to `#service?` most of the time anyway so this
    should be fine.
  - `#plist_name` and `#service_name` now call the methods of the same name
    on the service class. This should have already been in the service object
    to begin with and keeping these methods here helps preserve backwards
    compatibility with people who were overwriting these methods before.
- Caveats
  - Prefer `service#command?`
  - Add helpers for checking on service commands
    - This duplicates some of the work in `brew services`. Maybe we should
      merge that repo in at some point.
  - Check for installed service at `#plist_name` or `#service_name`. I think
    this should be used instead of `Keg#plist_installed?` which checked for any plist file.
    We should think about deprecating `#plist_installed?` in the future.
  - Stop using `ps aux | grep #{formula.plist_name}` to check for service files
    because it was inaccurate (it always returns true on my machine) because the grep
    process is started before the ps process.
  - Note: The behavior is the same as it was before. This means that caveats
    only show up for custom service files on install or if they're already installed.
    Otherwise it won't show up in `brew info`. This is because it has to check
    first if the service file has been installed.
- Utils::Service
  - Add utils for evaluating if a service is installed and running. This duplicates
    some of the work already found in `brew services`. We should seriously consider
    merging `brew services` with the main brew repo in the future since it's already
    tightly coupled to the code in the main repo.
- Formulary.load_formula_from_api
  - Be more explicit about which types can be deserialized into run params since
    it is now possible for run params to be nil.
- Update and add tests
2023-05-13 14:53:01 -07:00
Markus Reiter
4c3e8255cf
Compare Tag using standardized_arch. 2023-05-13 22:19:35 +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
d697037aca
Merge remote-tracking branch 'origin/master' into cask-upgrade/wildcards 2023-05-11 17:32:36 -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
Markus Reiter
5c9c089b68
Improve #to_str and #to_json for Version::NULL. 2023-05-11 19:16:42 +02: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