Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for brewcask not working due brew cask list --versions #3

Closed
wants to merge 5 commits into from
Closed

Fix for brewcask not working due brew cask list --versions #3

wants to merge 5 commits into from

Conversation

jordigg
Copy link
Contributor

@jordigg jordigg commented Mar 4, 2016

Fix for making brewcask actually work. Error caused by brew cask list --versions and bad parsing of the results as explained on issue #2.

Parsing brew cask list --versions results like we do with brew seems to have fixed the problem. Work on my test and prod environment.

Jordia Garcia and others added 2 commits March 4, 2016 10:08
@TheKevJames
Copy link
Owner

Thanks for the issue report and bugfix! Leaving a note for myself that #1 needs to take this change into account, when I get around to fixing #1.

Would you mind updating lib/puppet/provider/package/homebrew.rb:33 with the same fix?

@jordigg
Copy link
Contributor Author

jordigg commented Mar 7, 2016

PR updated with the requested changes.

@TheKevJames
Copy link
Owner

Hmm, I'm having some trouble with this PR: it seems to break things for me. Would you mind pasting the output of running the following commands on your machine (feel free to obscure package names / use different packages than me)?

$ brew --version
Homebrew 0.9.5 (git revision 610b; last commit 2016-03-07)
$ brew cask --version
0.60.0 (git revision 2a865a; last commit 41 minutes ago)
$ brew list --versions | head -n1
ack 2.14
$ brew list --versions ack
ack 2.14
$ brew cask list --versions | head -n1
clementine 1.2.2
$ brew cask list --versions clementine
==> App Symlinks managed by brew-cask:
~/'Applications/clementine.app' -> '/opt/homebrew-cask/Caskroom/clementine/1.2.2/clementine.app'
==> Staged content:
/opt/homebrew-cask/Caskroom/clementine/1.2.2 (794 files)

As you can see, my brew cask list --versions <NAME> output does not work with this PR, as result is expected to be a variable of the form NAME VE.RS.ION à la output of brew list --versions <NAME>.

@jordigg
Copy link
Contributor Author

jordigg commented Mar 8, 2016

My fault then. Here my results:

$ brew --version
Homebrew 0.9.5 (no git repository)
$ brew cask --version
0.60.0 (git revision 98fe; last commit 16 hours ago)
$ brew list --versions | head -n1
gdbm 1.11
$ brew list --versions python
python 2.7.11
$ brew cask list --versions | head -n1
cmake 3.4.3
$ brew cask list --versions cmake
==> App Symlinks managed by brew-cask:
==> Binary Symlinks managed by brew-cask:
'/usr/local/bin/cmake' -> '/opt/homebrew-cask/Caskroom/cmake/3.4.3/CMake.app/Contents/bin/cmake'
'/usr/local/bin/ccmake' -> '/opt/homebrew-cask/Caskroom/cmake/3.4.3/CMake.app/Contents/bin/ccmake'
'/usr/local/bin/cmakexbuild' -> '/opt/homebrew-cask/Caskroom/cmake/3.4.3/CMake.app/Contents/bin/cmakexbuild'
'/usr/local/bin/cpack' -> '/opt/homebrew-cask/Caskroom/cmake/3.4.3/CMake.app/Contents/bin/cpack'
'/usr/local/bin/ctest' -> '/opt/homebrew-cask/Caskroom/cmake/3.4.3/CMake.app/Contents/bin/ctest'
'/usr/local/bin/cmake-gui' -> '/opt/homebrew-cask/Caskroom/cmake/3.4.3/CMake.app/Contents/bin/cmake-gui'
==> Staged content:
/opt/homebrew-cask/Caskroom/cmake/3.4.3 (4337 files)

I get exactly the same output as you. Sorry about that, I'm new to Puppet, Brew, etc...

The error must happen when checking the version of one package, I guess when this package isn't installed.
Is it possible that the error comes from brew list --versions package returning Error: No such keg: /usr/local/Cellar/package and brew cask list --versions package returning Warning: package is not installed Error: nothing to list when the package is not installed?

@jordigg jordigg closed this Mar 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants