macchina icon indicating copy to clipboard operation
macchina copied to clipboard

[BUG] Brew packages are displayed +1

Open Markos-Th09 opened this issue 2 years ago • 2 comments

Describe the bug The total number of homebrew packages including casks, bottles and formulae is also displayed +1. For example if I have 4 packages, they are displayed as 5.

To Reproduce Steps to reproduce the behavior:

  1. Install macchina in macOS
  2. Install homebrew
  3. Install some homebrew packages
  4. Use the macchina program

Expected behavior The total amount of packages should display the actual count

Screenshots Screenshot 2022-09-22 at 14 41 25

macchina --doctor output Screenshot 2022-09-22 at 14 40 23

System Information You don't have to provide this information if you're not comfortable doing so, but it'll help us solve the issue a lot faster.

  • Distribution: none
  • Desktop Environment: Aqua (not an option but whatever)
  • Operating System: macOS
  • Terminal: macOS terminal
  • Macchina's version: 6.1.5

Markos-Th09 avatar Sep 22 '22 10:09 Markos-Th09

Can you show me the output of brew list | wc -l?

grtcdr avatar Sep 22 '22 10:09 grtcdr

Can you show me the output of brew list | wc -l? brew list|wc -l 4

~~Actually I used a different command which also shows bottles (dependencies) which I assumed it was also counting brew info --json=v1 --installed | jq -r "map(select(.installed[].poured_from_bottle) | .name) | unique | .[]"|wc -l .~~ Edit: actually piping brew list seems to do the same thing

Markos-Th09 avatar Sep 22 '22 11:09 Markos-Th09

I just actually found the problem. There seems to also be a .keepme file along the packages (referring to this issue) Screenshot 2022-09-22 at 18 08 25 This problem comes down to libmacchina

Markos-Th09 avatar Sep 22 '22 14:09 Markos-Th09

Hmm, I thought we ignored any ".keepme"s.

This is an easy fix :)

I'll also subtract the result by one.

grtcdr avatar Sep 22 '22 14:09 grtcdr

Ok although imo the more correct solution fix would be to also check if the .keepme is there first

Markos-Th09 avatar Sep 22 '22 14:09 Markos-Th09

Also unrelated but I just noticed it isn't showing anything from cargo

Markos-Th09 avatar Sep 22 '22 14:09 Markos-Th09

Moving this to libmacchina

Markos-Th09 avatar Sep 23 '22 16:09 Markos-Th09