I hope I'm not confused or anything here but I spend some time looking into the FHS specifications. If found one interesting part about /var/cache. It states: ... The application must be able to regenerate or restore the data. Unlike /var/spool, the cached files can be deleted without data loss. ... I haven't found a tool that can regenerate the virtual file and it seems like /var/db/pkg/virtual/ isn't used anymore (not on my system anyway 1.1a). The world file can be regenerated but the tool doesn't exist in portage. The "worldsync" tool will add ALL non system packages which may not be true for the old world file. Well any sane user shouldn't delete the edb directory but the FHS spec. says it's ok to do so and the app should regenerate the deleted files. Are my teories totaly wrong? Have I misunderstood how the edb files are working? Is Gentoo not FHS compliant?
On a similar note if you delete /var/cache/edb you get errors like: Calculating world dependencies \Traceback (most recent call last): File "/usr/bin/emerge", line 1278, in ? mydepgraph.syscreate(getworldlist()) File "/usr/bin/emerge", line 481, in syscreate self.create(self.match(myline,mykey="update (likely old /var/db/pkg entry)")) File "/usr/bin/emerge", line 400, in create mydb=open(mydbkey,"r") IOError: [Errno 2] No such file or directory: '/var/cache/edb/dep/dep-man-pages-1.50.ebuild' The workaround is to run `mkdir -p /var/cache/edb/dep`. It would be nice if portage did that for you.
some stuff in /var/cache really belongs somewhere else.
*** Bug 34035 has been marked as a duplicate of this bug. ***
*** Bug 50200 has been marked as a duplicate of this bug. ***
All major FHS issues should be dealt with in portage-2.0.51 /var/cache/edb can be deleted at will. It's actually cache data now. /var/lib/portage contains state data & world file
*** Bug 64140 has been marked as a duplicate of this bug. ***
Bug has been fixed and released in stable portages on or before 2.0.51-r2
As every bug on portage and FHS seems to be marked duplicate to this i'll comment here. I've searched gentoo-dev and bugs.gentoo.org but I can't seem to find a solid debate regarding DISTDIR and PKGDIR with regards to the FHS. Is there a conclusion somewhere that I've missed? With regards to the ideas discussed in http://forums.gentoo.org/viewtopic-p-2218914.html maybe the default location of these should change. DISTDIR ======= /var/cache ---------- It could be regarded as cached data but I'm uncertain if downloadable fits within "Such data is locally generated as a result of time-consuming I/O or calculation." /usr/src -------- "Source code may be place placed in this subdirectory, only for reference purposes." This seems like an intuitive place to look for such data, but this only holds true for installed applications. /usr/share ---------- This is the place to put data meant to be shared between hosts in a heterogenous network, which very much describes this data (this also describes the current portage tree it self, but something tells me this will change in the future). However the FHS makes it clear that /usr is read only data that must not be written to and should not vary over time, probably to address fragmentation issues so /var seems more sensible. PKGDIR ====== This is certainly "locally generated as a result of time-consuming I/O or calculation." so /var/cache is clearly the right choice.