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

Version number contains invalid characters #187

Closed wydwww closed 3 years ago

wydwww commented 3 years ago

Using the latest version, brew cu gives an error:

Error: 1.0 (107) contains invalid characters: ()!
/usr/local/Homebrew/Library/Homebrew/cask/dsl/version.rb:73:in `initialize'
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/extend/cask.rb:15:in `new'
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/extend/cask.rb:15:in `block in installed_apps'
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/extend/cask.rb:13:in `map'
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/extend/cask.rb:13:in `installed_apps'
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/bcu/command/upgrade.rb:21:in `process'
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/bcu.rb:20:in `process'
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/cmd/brew-cu.rb:70:in `<top (required)>'
/usr/local/Homebrew/Library/Homebrew/utils.rb:92:in `require'
/usr/local/Homebrew/Library/Homebrew/utils.rb:92:in `require?'
/usr/local/Homebrew/Library/Homebrew/brew.rb:124:in `<main>'

It is caused by quitter, whose version number is 1.0 (107). Previously brew cu worked well handling this application.

ondrejfuhrer commented 3 years ago

Hey @wydwww , thx for the report. I just tried to install the app and works fine for me 🤔 Could you run brew update and then try to run brew cu again?

wydwww commented 3 years ago

Hi @ondrejfuhrer , I tried brew update and brew cu. It gave the same error message.

ondrejfuhrer commented 3 years ago

@wydwww can you please try as well ls -la /usr/local/Caskroom/quitter and pass the result here? This is where we're getting the versions from.

wydwww commented 3 years ago

@ondrejfuhrer

(base) ➜  ~ ls -la /usr/local/Caskroom/quitter
drwxr-xr-x  - username 28 Jan  2019 .metadata
drwxr-xr-x@ - username 28 Jan  2019 1.0 (107)
ondrejfuhrer commented 3 years ago

@wydwww Interesting, so that's where is it coming from. Right now, if I install it, I have a different format. I would suggest reinstalling it for now, that should fix it -> brew reinstall --cask quitter

If I do the same thing, I have following:

(base) ➜  ~ ls -la /usr/local/Caskroom/quitter
drwxr-xr-x  - username 11 Apr  2021 .metadata
drwxr-xr-x@ - username 11 Apr  2021 1.0,107

If you would get that after reinstalling it should then work 🙂

wydwww commented 3 years ago

Thanks for your solution! Although brew reinstall --cask quitter and brew uninstall --cask quitter with or without --force will still give error:

Warning: No checksum defined for cask 'quitter', skipping verification.
Error: Cask 'quitter' definition is invalid: 'version' stanza failed with: 1.0 (107) contains invalid characters: ()!

Deleting /usr/local/Caskroom/quitter and installing again fixed this error. Looks like an upstream problem.