homebrew-cask/doc/faq/app_not_upgrading.md

28 lines
2.5 KiB
Markdown
Raw Normal View History

# Why some apps arent included in `upgrade`
After running `brew upgrade`, you may notice some casks you think should be upgrading, arent.
As youre likely aware, a lot of macOS software can upgrade itself:
![](https://upload.wikimedia.org/wikipedia/commons/c/c0/Sparkle_Test_App_Software_Update.png)
That could cause conflicts when used in tandem with Homebrew Casks `upgrade` mechanism.
If you upgrade software through its built-in mechanism, that happens without Homebrew Casks knowledge so both versions get out of sync. If you then upgraded through Homebrew Cask and we have a lower version on the software on record, youd get a downgrade.
There are a few ideas to fix this problem:
* Try to prevent the softwares automated updates. That wont be a universal solution and may cause it to break. Most software on Homebrew Cask is closed-source, so wed be guessing. This is also why pinning casks to a version isnt available.
* Try to extract the installed softwares version and compare it to the cask, deciding what to do at that time. Thats a complicated solution that breaks other parts of our methodology, such as using versions to interpolate in `url`s (a definite win for maintainability). That solution also isnt universal, as many software developers are inconsistent in their versioning schemes (and app bundles are meant to have two version strings) and it doesnt work for all types of software we support.
So we let software be. Installing it with Homebrew Cask should make it behave the same as if you had installed it manually. But we also want to support software that does not auto-upgrade, so we add [`auto_updates true`](https://github.com/Homebrew/homebrew-cask/blob/62c0495b254845a481dacac6ea7c8005e27a3fb0/Casks/alfred.rb#L10) to casks of software that can do it, which excludes them from `brew upgrade`.
Casks who use [`version :latest`](https://github.com/Homebrew/homebrew-cask/blob/4184d50d2d7fa4afb62e6c7eb6761ae5ac417c88/Casks/servo.rb#L2) are also excluded, because we have no way to track the version theyre in. It helps to ask the developers of such software to provide versioned releases (i.e. have the version in the path of the download `url`).
If you still want to force software to be upgraded via Homebrew Cask, you can:
* Reference it specifically in the `upgrade` command: `brew upgrade {{cask_name}}`.
* Use the `--greedy` flag: `brew upgrade --greedy`.
Refer to the `upgrade` section of the `brew` manual page by running `man -P 'less --pattern "^ {3}upgrade"' brew`.