From Filesystem Hierarchy Standard 2.3, /var/lib Purpose: /var/lib/<name> is the location that must be used for all distribution packaging support. Different distributions may use different names, of course. Therefore, /usr/portage -> /var/lib/portage . The variable to fix this is /etc/make.conf: PORTDIR="/var/lib/portage". For backwards compatibility during transition, possibly a symlink /usr/portage -> ../../var/lib/portage could be left. E.g., Debian uses /var/lib/apt/. ** From Filesystem Hierarchy Standard 2.3, /etc Purpose: /etc : Host-specific system configuration The /etc hierarchy contains configuration files. A "configuration file" is a local file used to control the operation of a program; it must be static and cannot be an executable binary. Therefore, /usr/local/portage -> /etc/portage . Hopefully the files already designated for /etc/portage will not conflict with anything in /usr/local/portage, similar to the way that other default configuration files are in /var/lib/portage (such as /var/lib/portage/profiles and skel.*). The variable for this in /etc/make.conf is PORTDIR_OVERLAY="/etc/portage". Also: /usr/local Purpose: No other directories, except those listed below, may be in /usr/local after first installing a FHS-compliant system. [It does not list /usr/local/portage in any way.] E.g., Debian uses /etc/apt/. ** From Filesystem Hierarchy Standard 2.3, /var/cache Purpose: /var/cache : Application cache data /var/cache is intended for cached data from applications. Such data is locally generated as a result of time-consuming I/O or calculation. The application must be able to regenerate or restore the data. Unlike /var/spool, the cached files can be deleted without data loss. The data must remain valid between invocations of the application and rebooting the system. Therefore, /var/lib/portage/distfiles or /usr/portage/distfiles -> /var/cache/portage/distfiles . E.g., Debian uses /var/cache/apt/, with a subdirectory /var/cache/apt/archives/ for its cached transferred deb files. As an alternative, we could choose something shorter like /var/cache/portage or /var/cache/distfiles ; I recommend one of these latter two instead of the former one (/var/cache/portage/distfiles), because they are shorter and easier to type. However, if there is other portage cache data that conforms to the above standard (can be deleted without data loss), then the four level deep location may be appropriate. Reproducible: Always Steps to Reproduce: Portage files were in /usr/portage, /usr/portage/distfiles, and suggested to be in /usr/local/portage. Expected Results: Portage files should be in /var/lib/portage, /var/cache/portage, and /etc/portage. The purposes of FHS do not properly function with the hereincontained violations. E.g., /usr must be read-write to simply perform a regular "emerge sync", or download a distribution file.
I left out the variable for setting the distfiles directory: in /etc/make.conf: DISTDIR="/var/cache/portage/distfiles".
This seems completely unnecessary to me. First of all, your assessment that /var/lib/<name> must be used for all distribution packaging support seems blatantly wrong. That's obviously not what's used now, and it's currently in working order. You also mention the "purposes of FHS". One of the first things a page on FHS will tell you is that it's written as a reference and not as a tutorial on how to manage a Unix filesystem or directory hierarchy. I personally feel it would be a good thing to abandon the old /etc /bin /usr /var structure altogether, in favor of understandable names like "Programs" and "Preferences", of course with possibly hidden symlinks to the old entries.
In addition to distfiles, there is a packages directory. It too has reproducable cached files, so it too would go into /var/cache : /var/cache/portage/packages . The variable in /etc/make.conf is PKGDIR="/var/cache/portage/packages".
Here are a few purposes of FHS: * Static and variable files should be segregated because static files, unlike variable files, can be stored on read-only media and do not need to be backed up on the same schedule as variable files. While /var/lib/portage or /usr/portage is easily reproducable from the Internet, the fundamental concept of /usr is that it is a read only filesystem, except for package updates. One could argue that /usr/portage is just like anything else on /usr: something that only gets updated when software gets updated (in which case emerge should appropriately remount the filesystem readwrite when doing 'emerge sync' and readonly when execution has ceased). However, portage is meant to be updated in a rapid fasion in order to be appraised of bug fixes, including security fixes that may be within those bug fixes. * The existence of a separate directory for cached data allows system administrators to set different disk and backup policies from other directories in /var. For instance, all of /var/cache can simply not ever be backed up, rather than having to keep track of a bunch of strange nonstandard directories in /usr. Long difficult to type names are a hallmark of Microsoft and other operating systems. We are free to change the names of the hierarchy as we see fit for our purposes, however, Gentoo is a Unix distribution, so what we see fit usually falls within the confines of that reality.
this is already handled with Bug 2553 and 2.0.51_pre's are doing it there has been another bug or two, and stuff on mailing lists ... i dont know what you're talking about with /usr/local/portage ... portage doesnt use that anywhere, just suggests as a default OVERLAY ... users can use whatever they want ... also, /etc/portage is already used for site-specific portage config files *** This bug has been marked as a duplicate of 2553 ***