Apologies if this has been addressed previously, but my searches of the
Gentoo website, devmanual, forums, and mailing list archives didn't turn
up anything definitive.
Is there any sort of policy covering how an ebuild should deal with
/var/cache during unmerge?
The devmanual pages for pkg_prerm (http://tinyurl.com/huh7n) and
pkg_postrm (http://tinyurl.com/f5b7o) are the closest I've come to an
answer, but I don't consider deletion of the cache dir to be the same as
updating it.
I've looked at a few ebuilds in the tree (including samba and squid) and
they seem to leave in place any cache files created during normal
execution of the package in question.
This means that after an unmerge the sysadmin needs to go and clean out
/var/cache/whatever.
During ebuild development and testing, I can see why one might want the
cache files to remain, so unconditional cleaning of /var/cache is out of
the question. However, removing of cache files could be controlled by a
FEATURE (eg. keepcache - unless that implies the retention of cache
files from the original merge a la keepwork and keeptemp).
A similar issue exists with log files, but I'd expect them to occupy
less space than caches, and generally be considered more useful (since
they can't be regenerated). If they were to be dealt with, perhaps
portage could have a purge option that removes all traces of a package
from the system - including log and cache files (it looks like temp
files should already be cleaned out by the ebuild).
Of course, the general opinion might be that management of /var/cache is
outside the scope of portage, and best left to the sysadmin (and/or an
separate automated tool), although the FHS doesn't specify either way
(http://tinyurl.com/26gpd). That's fine with me, but I think it's good
to have this on record in the mailing list archives, and perhaps in the
devmanual as well.
Cheers
Andrew
--
gentoo-dev@gentoo.org mailing list