Improve cask --adopt to only care about the installed version if auto_update is false #18405
Description
Verification
- This issue's title and/or description do not reference a single formula e.g.
brew install wget
. If they do, open an issue at https://github.com/Homebrew/homebrew-core/issues/new/choose instead.
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?
- could use
--force
I think? However, we don't generally want Homebrew to manage the version lifecycle. - simply stop using
--adopt
and, outside of brew, remove the application and then install it from Brew the first time.
One of these alternatives is what we will do if adjusting how --adopt
works is rejected.