buo / homebrew-cask-upgrade

A command line tool for upgrading every outdated app installed by Homebrew Cask
MIT License
2.44k stars 90 forks source link

Installing as a Formula Instead of a Cask #177

Closed 404NetworkError closed 3 years ago

404NetworkError commented 4 years ago

I have noticed that when upgrading a couple of casks, e.g. macvim or wireshark, I get this warning message:

==> Upgrading wireshark to 3.2.7
Warning: Treating wireshark as a formula. For the cask, use homebrew/cask/wireshark

It's because of the deprecation of brew cask reinstall that this has become a problem. Maybe there is some way to ascertain which tap the cask if from, but I'm not sure.

Edit: It appears that according to the API documentation, cask.tap.name should provide the correct information.

yangyaofei commented 4 years ago

same problem, show in Dash and Docker

ondrejfuhrer commented 4 years ago

Hmmm, interesting. Will need to check if there a property that would give the info from which tap is the cask coming from (as it doesn't always have to be homebrew/cask/* one)

chunheisiu commented 4 years ago

Happened to me with Docker and Kite. The workaround, for now, is to pin them so it doesn't attempt to "update" them.

chunheisiu commented 4 years ago

The warning message I'm getting when I manually update docker via brew cask:

Warning: Calling brew cask upgrade is deprecated! Use brew upgrade --cask instead.

I was wondering if changing brew cask reinstall <name> to brew upgrade --cask homebrew/cask/<name> would solve the issue.

yurikoles commented 4 years ago

This seems to be caused by the fact that docker is available both as formulae and as cask.

chunheisiu commented 4 years ago

This seems to be caused by the fact that docker is available both as formulae and as cask.

Yea, and brew upgrade --cask seems to default to formulae instead of cask.

ondrejfuhrer commented 3 years ago

This seems to be caused by the fact that docker is available both as formulae and as cask.

Yea, and brew upgrade --cask seems to default to formulae instead of cask.

Yes, that is an issue. Also tested it with the --cask and doesn't work as expected (still installs formilae instead of cask as you mentioned).

The only solution seems to be using brew upgrade homebrew/cask/wireshark. Unfortunately the homebrew/cask prefix is dynamic (think about casks from non-default caskroom) and so far I haven't figured out how to get that value.

If anyone would like to help with that, contributions are welcomed.

ringods commented 3 years ago

Verified it is working correctly again. A brew update fetched the latest of this tap, and running brew cu --all correctly updated my casks, which in this update run included Dash. Before the fix, I had the problem where it tried to install the formula dash instead.