Package managers set HOME, but it is insufficient for many packages. Currently multiple eclasses and ebuilds set XDG_* variables. I suggest that package managers automatically set XDG_* variables to reasonable values. The following variables should be set (and exported) by package managers: - XDG_CACHE_HOME (example value: ${HOME}/.cache) - XDG_CONFIG_HOME (example value: ${HOME}/.config) - XDG_DATA_HOME (example value: ${HOME}/.local/share) - XDG_RUNTIME_DIR (example value: ${HOME}/.run) Package managers should create directories referenced by these variables. Directory referenced by XDG_RUNTIME_DIR variable should have 0700 permission bits. http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
We (gnome/gst/some fdo team members) were planning on having a new fdo/xdg eclass handle this much like the gnome2-utils function: gnome2_reset_environment. I know this is needed for almost any ebuild using glib nowadays, most likely qt/kde as well but is it really something up for PM ?
(In reply to comment #1) > We (gnome/gst/some fdo team members) were planning on having a new fdo/xdg > eclass handle this much like the gnome2-utils function: > gnome2_reset_environment. > > I know this is needed for almost any ebuild using glib nowadays, most likely > qt/kde as well but is it really something up for PM ? I prefer the idea of using an eclass, for the sake of keeping things modular / encapsulated. If at some point we have a "set of eclasses provided by the package manager", then an xdg eclass might be a good candidate for inclusion in that set.
*** Bug 499288 has been marked as a duplicate of this bug. ***
Wouldn't it be enough to scrub those variables as part of sanitizing the environment? I think then the default paths with ${HOME} (== ${T}) would apply.
Hi guys, I finally got some time to implement this: https://gitweb.gentoo.org/proj/gnome.git/commit/?id=6f14db878539ac475c7edd9a05d9f55cc21d8778 Unsetting these variables does not always work as some packages (like orc) would start having sandbox issues, see bug #534582.
(In reply to Gilles Dartiguelongue from comment #5) > I finally got some time to implement this: > https://gitweb.gentoo.org/proj/gnome.git/commit/ > ?id=6f14db878539ac475c7edd9a05d9f55cc21d8778 That xdg.eclass is not appropriate for packages not needing dev-util/desktop-file-utils and x11-misc/shared-mime-info.
How do you propose to make these dependencies optional. I had no intention to make them optional to start with because they really are small packages used in a lot of packages.
I can move the actual dir creation and export to a function in xdg-utils so that it can be called when not wanting the rest of the support.
FTR, eclass work has been merged as xdg.eclass and xdg-utils.eclass and is now used in gnome and gstreamer eclasses.
*** Bug 575890 has been marked as a duplicate of this bug. ***
EAPI 7 has a mechanism for blacklisting environment variables, see bug 499288. Also, most XDG_* variables are exported by xdg-utils.eclass. So I think that PMS specifying these vars won't happen. Closing.