Cakebrew
Cakebrew copied to clipboard
"Status", "Installed Version" and "Latest Version" columns as in Synaptic
It would be nice displaying three more columns with the current status, the installed and the available version of a formula, like Synaptic.
In my personal project, Guigna, I am calling directly the Ruby interpreter with the following one-liner in order the get the name and the versions of all the available formulae:
/usr/bin/ruby -C /usr/local/Library/Homebrew -I. -e "require 'global'; require 'formula'; Formula.each {|f| puts f.name+' '+f.version}"
It is a little slow but I haven't found a simpler and faster way to get the list of the available versions of all the formulae.
Gonna have a look at it, thanks!
Fixed in https://github.com/brunophilipe/Cakebrew/commit/161eb7c0860a8a1f5df6c2af2778d2eb9e214c22 need to be closed.
The previous one-liner was not totally correct since it ignored the revision number.
The following version appends correctly the revision number when it is > 0:
/usr/bin/ruby -C /usr/local/Library/Homebrew -I. -e "require 'global'; require 'formula'; Formula.each {|f| rev = f.revision.to_s; puts \"#{f.name} #{f.version}#{rev == '0' ? '' : \"_#{rev}\"}\"}"
It could be useful to display the "Latest Version" column also when "All formulas" is selected.
There is a simpler version actually, thanks to pkg_version:
/usr/bin/ruby -C /usr/local/Library/Homebrew -I. -e "require 'global'; require 'formula'; Formula.each {|f| puts \"#{f.name} #{f.pkg_version}\"}"
That's really cool. I just want to get the brew tasks and the current problems fixed and stable before creating a new front to deal with direct queries like that.
Unfortunately such direct method isn't supported anymore (https://github.com/Homebrew/homebrew/pull/48261).
The recommended way to parse the detailed info of all the available formulae is to parse the JSON output of brew info --all --json=v1