Just to make one point clear: yep the collision report does not give
you an `easy' way to delete the files (though saving the file and
apply some simple sed/awk like pattern is not that hard), because that's
the wrong way to think about the problem.

If you've got files in /usr/local, and pkg_* can't figure out where they
come from, then you are in trouble... Those dangling files are usually
a symptom something much more fishy is going on, like file system
corruption. And most often, you don't want to just fix the local problem,
you want to figure out what is going on, for real.

It's possible to extend pkg_add to sniff around, and to recover from some
simple situations... just means it will fail later in weirder ways.

Like, sure, you've got files right from a package, you could just reinstall
the package on top of it, and expect things to be right... except they
won't !

If this package was installed at some point, it probably also means some
stuff is/was depending on it. So you would need to also re-check each
and every dependency in packages to make sure they don't want this
package (fairly important in case of updates).

And if one package has missing meta-information, who says it's the only
one ? rescanning /usr/local looking for orphaned files would be needed.
then probably perusing pkglocatedb to try to figure out where they come
from in the first place, and trying to re-obtain those packages and
check more things out.

Assuming you still can grab the missing packages somewhere, all this
is feasible. It's just not being done with the current tools, and it's
probably a bit too complex to implement quickly...

Reply via email to