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

"Warning: Calling MacOS.release is deprecated!" #77

Closed giacgbj closed 5 years ago

giacgbj commented 7 years ago
Warning: Calling MacOS.release is deprecated!
Use MacOS.version instead.
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/extend/hbc.rb:39:in `load_cask'
Please report this to the buo/cask-upgrade tap!
ondrejfuhrer commented 6 years ago

Is this still happening? Does not seem like something that happens in the current version.

corporate-gadfly commented 6 years ago

Yup... still happening.

$ brew cu -a
==> Options
Include auto-update (-a): true
Include latest (-f): false
==> Updating Homebrew
Already up-to-date.
==> Finding outdated apps
Warning: Calling Hbc::DSL#license is deprecated!
There is no replacement.
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/extend/hbc.rb:41:in `load_cask'
Please report this to the buo/cask-upgrade tap!

Warning: Calling MacOS.release is deprecated!
Use MacOS.version instead.
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/extend/hbc.rb:41:in `load_cask'
Please report this to the buo/cask-upgrade tap!

and brew cask doctor

==> Homebrew-Cask Version
Homebrew-Cask 1.3.9-28-g5055c31-dirty
caskroom/homebrew-cask (git revision 848fe; last commit 2017-12-08)
==> macOS
10.13.2
==> Java
1.8.0_152, 1.7.0_80, 1.6.0_65-b14-468
==> Homebrew-Cask Install Location
<NONE>
==> Homebrew-Cask Staging Location
/usr/local/Caskroom
==> Homebrew-Cask Cached Downloads
~/Library/Caches/Homebrew/Cask
==> Homebrew-Cask Taps:
/usr/local/Homebrew/Library/Taps/caskroom/homebrew-cask (3897 casks)
/usr/local/Homebrew/Library/Taps/caskroom/homebrew-drivers (140 casks)
/usr/local/Homebrew/Library/Taps/caskroom/homebrew-fonts (1124 casks)
/usr/local/Homebrew/Library/Taps/caskroom/homebrew-versions (187 casks)
/usr/local/Homebrew/Library/Taps/caskroom/homebrew-eid (10 casks)
==> Contents of $LOAD_PATH
/usr/local/Homebrew/Library/Homebrew/cask/lib
/usr/local/Homebrew/Library/Homebrew
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3/lib/ruby/gems/2.3.0/gems/did_you_mean-1.0.0/lib
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3/lib/ruby/site_ruby/2.3.0
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3/lib/ruby/site_ruby/2.3.0/x86_64-darwin9.0
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3/lib/ruby/site_ruby/2.3.0/universal-darwin9.0
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3/lib/ruby/site_ruby
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3/lib/ruby/vendor_ruby/2.3.0
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3/lib/ruby/vendor_ruby/2.3.0/x86_64-darwin9.0
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3/lib/ruby/vendor_ruby/2.3.0/universal-darwin9.0
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3/lib/ruby/vendor_ruby
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3/lib/ruby/2.3.0
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3/lib/ruby/2.3.0/x86_64-darwin9.0
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3/lib/ruby/2.3.0/universal-darwin9.0
==> Environment Variables
LC_ALL="en_US.UTF-8"
PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/Homebrew/Library/Homebrew/shims/scm"
SHELL="/usr/local/bin/bash"
corporate-gadfly commented 6 years ago

~Is the bug upstream caskroom/homebrew-cask/issues/31968?~ Don't think so.

corporate-gadfly commented 6 years ago

Seems to be coming from an installed cask java7 (which I can't find in homebrew-versions any more).

In any case in /usr/local/Caskroom/java7/.metadata/1.7.0_80/20160612184014.329/Casks/java7.rb (an outdated cask which can't be found anywhere, any more), I commented out license :gratis line and replaced MacOS.release with MacOS.version in a couple of places and the warnings went away.

Hope that helps.

ondrejfuhrer commented 6 years ago

Those problems are most probably due to outdated cask. Most probably there is nothing that can be done about it in this repo.

OndroNR commented 6 years ago

It now says "Error: Calling MacOS.release is disabled!"

➜  ~ brew cu
==> Options
Include auto-update (-a): false
Include latest (-f): false
==> Updating Homebrew
Already up-to-date.
==> Finding outdated apps
Warning: Calling Hbc::DSL#license is deprecated!
There is no replacement.
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/extend/hbc.rb:41:in `load_cask'
Please report this to the buo/cask-upgrade tap!

Error: Calling MacOS.release is disabled!
Use MacOS.version instead.
/usr/local/Homebrew/Library/Taps/buo/homebrew-cask-upgrade/lib/extend/hbc.rb:41:in `load_cask'
Please report this to the buo/cask-upgrade tap!
Or, even better, submit a PR to fix it!
OndroNR commented 6 years ago

Also affects brew cask list. After printing this variable https://github.com/Homebrew/brew/blob/985202cf8e3f9e221753dd99adf1e8874fece03a/Library/Homebrew/cask/lib/hbc/cask_loader.rb#L42 in cask_loader.rb I found it was trying to load /usr/local/Caskroom/java7/.metadata/1.7.0_80/20160623095627.902/Casks/java7.rb. Looks like some failed upgrade process. Package name even does not exist anymore. After removing /usr/local/Caskroom/java7/, brew cu and brew cask list works.