Homebrew / brew

🍺 The missing package manager for macOS (or Linux)
https://brew.sh
BSD 2-Clause "Simplified" License
41.67k stars 9.79k forks source link

Improve cask --adopt to only care about the installed version if auto_update is false #18405

Open ctaintor opened 2 months ago

ctaintor commented 2 months ago

Verification

Provide a detailed description of the proposed feature

I believe with #16889, the cask --adopt logic started failing to adopt if the installed application version was not the same as the "to be installed" version. For our organization, this means that the moment there is a new cask version, anyone who runs a cask --adopt will get a failure, requiring them to go into the application and manually update. What we'd expect instead is that if the application's update lifecycle is handled by the application (and not brew) then brew would happily adopt it whether it is the exact same version or not.

I propose that the --adopt logic is changed to only care about the installed version if the cask formula has auto_update false. (somewhat related to this, it would be amazing if we could also avoid downloading the cask if the application is already installed and we will --adopt it.)

What is the motivation for the feature?

In the current state, adopting causes more problems than it helps. This is both because it requires people to act on something (do an update) for the brew install to work and that the action they need to take is confusing to them (few understand that what this is saying is "go into the application and manually update it" – they just think of it as a failure that they can't overcome).

How will the feature be relevant to at least 90% of Homebrew users?

I believe this would make --adopt behave as people would expect it to.

What alternatives to the feature have been considered?

One of these alternatives is what we will do if adjusting how --adopt works is rejected.

MikeMcQuaid commented 2 months ago

I believe with #16889, the cask --adopt logic started failing to adopt if the installed application version was not the same as the "to be installed" version.

It's the other way around: #16889 made it more permissive, not less.

I propose that the --adopt logic is changed to only care about the installed version if the cask formula has auto_update false.

I agree with this, it makes sense to me 👍🏻

somewhat related to this, it would be amazing if we could also avoid downloading the cask if the application is already installed and we will --adopt it.)

I agree this would be amazing but also think this would require additional verification e.g. checksum/signature/etc.