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

See which packages were installed manually and which as dependencies #21

Closed
buresdv opened this issue Feb 26, 2023 · 6 comments
Closed
Assignees
Labels
Enhancement New feature or request

Comments

@buresdv
Copy link
Owner

buresdv commented Feb 26, 2023

This could be very useful to quickly scan which packages might be candidates for deletion.

@buresdv buresdv self-assigned this Feb 26, 2023
@buresdv
Copy link
Owner Author

buresdv commented Feb 26, 2023

Could be accomplished by checking the key installed_on_request from brew info --json=v2 [package]. Seems to be true for packages installed manually, and false for packages installed as dependencies.

@buresdv buresdv added the Enhancement New feature or request label Feb 26, 2023
@buresdv buresdv closed this as completed Feb 27, 2023
@buresdv
Copy link
Owner Author

buresdv commented Feb 27, 2023

Done!

Image

@occludedpixel
Copy link

But if brew upgrade foo is run, Cork will register foo as a installed manually even though it was originally just a dependency?

@buresdv
Copy link
Owner Author

buresdv commented Apr 14, 2024

The moment you manually update a dependency, Homebrew starts tracking it as manually installed, since you manually modified it.

@occludedpixel
Copy link

I see.. was hoping that Cork had a way of tracking intentionally installed packages that would differentiate between the two given the second point of "Things that Cork makes easier" in the README highlights "Knowing which packages you installed intentionally...".

Would you happen to have any suggestions on how to work around this?

@buresdv
Copy link
Owner Author

buresdv commented Apr 14, 2024

Tracking which packages were installed intentionally is very difficult in Homebrew itself.

Like you saw, modifying a dependency makes it act as if it was installed manually.

The core problem Cork solves is that the Homebrew way of listing manually installed packages doesn't actually list which packages were installed intentionally - it uses some weird internal fuckery that sometimes leaves packages out, and sometimes lists packages that were not installed manually at all. Cork solves it by taking installation info directly from package metadata - this is what is meant by that "know which packages were installed manually" line.

Of course, I could build a custom internal tracker that would keep track of which packages you actually clicked "Install" on, but then we get into the realm of weird edge cases.

I don’t think building a custom tracking solution would be worth the effort, and it would most likely end up being even less accurate than the current system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
Status: Done
Development

No branches or pull requests

2 participants