Closed rcmdnk closed 1 month ago
In these functions, info was taken by from json file of API cache in addition to brew info
result.
This was added because brew info --installed
or brew info --eval-all
lacks packages when API method was implemented (maybe there was a bug?).
For now, as long as I tested, it seems brew info
always returns all information and no need to check json file.
https://github.com/rcmdnk/homebrew-file/blob/a81631376cd0151202b79c851289f754a7a55ce1/src/brew_file/brew_info.py#L483 https://github.com/rcmdnk/homebrew-file/blob/a81631376cd0151202b79c851289f754a7a55ce1/src/brew_file/brew_info.py#L509
get_tap_xxx
functions are used in write
function, too.
These tap information can be taken from each package information directly, and it should be faster (maybe)
brew tap-info
is now available.
brew tap-info --installed --json
gives all taps (including homebrew/core, cask) and their formula_names and cask_tokens (including username/tapname)
To get json list by brew info, currently
--eval-all
option is used:https://github.com/rcmdnk/homebrew-file/blob/2c762a31c3d4fec3c1539608ff2e34fda34732dc/src/brew_file/brew_helper.py#L249 https://github.com/rcmdnk/homebrew-file/blob/2c762a31c3d4fec3c1539608ff2e34fda34732dc/src/brew_file/brew_helper.py#L287
This is needed at least for
tapall
: https://github.com/rcmdnk/homebrew-file/blob/2c762a31c3d4fec3c1539608ff2e34fda34732dc/src/brew_file/brew_info.py#L267But not necessary for most of cases. Maybe it can be replaced by
--installed
option and use--eval-all
only fortapall
and something else which needs all non-installed formulae/cask information (is there any?)?It could be better to get list one by one for installed formulae/cask, as some formula can have problem and
brew info --eval-all --json=v1
does not work with it (ref #282).(if there is a such formula,
tapall
is disabled to work and just show warning?)