He's not dead, he's resting

A Glimpse Into cave: Resolving Purges and Dependents

What happens when you upgrade a package, and the new version no longer uses a library that the old version did, and now nothing else uses that library either? In primitive distributions, you’re stuck with that library forever; in Gentoo and Exherbo the package manager will be able to tell you that the library is no longer used by any package in world. Until now, this has been a “do this once in a while, and try to remember what the heck all those things are” kind of affair. However, cave is cleverer:

pyxml no longer used

And you can easily decide to take it as part of the upgrade process (safely, since cave supports mixing installs and uninstalls with dependencies etc):

pyxml purged

This can also work with slots — however, doing so safely requires accurate slot information from packages, which sadly can’t take place in Gentoo until EAPI 4 is implemented in Portage.

Similarly, cave will tell you if you’re about to do something dangerous:

xulrunner breaks firefox

And if you decide to remove the packages that would be broken, rather than allow breakage to occur, you get to see more nice examples of purges:

xulrunner plus dependents has purges

This all works for downgrades too, as well as upgrades (although upgrades rarely break things, and when they do it’s time to yell at someone):

old asciidoc breaks awesome

And finally, if you’re about to do something immensely stupid, you’ll be told:

iputils is in system

All of this happens automatically, so there’s no need to remember to turn it on.


2 responses to “A Glimpse Into cave: Resolving Purges and Dependents

  1. Jason August 12, 2010 at 10:04 am

    What does the “xa” command do you have listed in the first two?

    Is it always required to specify the exact package name after the switches? –purge xulrunner? Or can I do a blanket –purge that will get everything?

    • Ciaran McCreesh August 12, 2010 at 10:10 am

      xa is a little bash alias I have that sticks a notice in the window manager status bar while something’s running, so I don’t have to keep switching tabs to see if something’s finished. I use it out of habit and don’t always remember to not do it for examples…

      You can do {{{–purge */*}}}. However, you probably shouldn’t, or at least not without checking what it says very carefully, since not all packages are entirely reliable in their dependencies…

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s