Mailing List Archive

default XDG dirs handling - bug 264647
Hi

With KDE-4.2.2 entering tree hopefully on Monday, I would like to fix general
XDG dirs related issues.

(copied from bug https://bugs.gentoo.org/show_bug.cgi?id=264647 with some
minor edits) :

According to XDG data specification[1], applications should append default
values for XDG_DATA_DIRS and XDG_CONFIG_DIRS only when those variables are not
defined. Currently Gentoo does not define those variables in env.d at all.
In typical scenario, when only one XDG-aware Desktop Environment is installed
- everything works fine, as is such scenario, DE that follows specification.
not having found XDG-dirs defined by system, appends default locations:

XDG_DATA_DIRS="/usr/local/share:/usr/share"
XDG_CONFIG_DIRS="/etc/xdg"

Unfortunately, when some DE tries to insufficiently define XDG-dirs, let's
say:

XDG_DATA_DIRS="/usr/kde/4.2/share"

it will most likely break every DE, resulting in default locations for desktop
files being inaccessible (in menu - missing applications from /usr/local and
/usr), because those default locations are not added implicitly.

This is related to bug https://bugs.gentoo.org/show_bug.cgi?id=204310

The solution is to explicitly define standard XDG locations in env.d.
Example layout:

cat /etc/evn.d/01xdg-data-local
XDG_DATA_DIRS="/usr/local/share"
COLON_SEPARATED="XDG_DATA_DIRS XDG_CONFIG_DIRS"

cat /etc/env.d/99xdg-data-base
XDG_DATA_DIRS="/usr/share"
XDG_CONFIG_DIRS="/etc/xdg"

In such case, to properly define DE specific XDG locations, it would be just
up to DE to specify:

cat /etc/env.d/43kdepaths-4.2
[...]
XDG_DATA_DIRS="/usr/kde/4.2/share"

Currently kdelibs needs to explicitly append system-wide /usr/local/share and
/usr/share to XDG_DATA_DIRS, which is considered workaround.

Those env.d definitions would need to be either added to some existing xdg
related ebuild (xdg-utils ?) or in new ebuild, that would be added to RDEPEND
to any other XDG-aware DE.

Comments? Ideas? If it fits, it would be nice to do it quickly (to not dwell
in workarounds for too long).
It doesn't seem to create any regression - it may at most create duplicate
/usr/local/share and /usr/share XDG_DATA_DIRS entries for KDE users (as it
seems to be the only DE that appends anything to XDG_DATA_DIRS).

1. http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

--
regards
MM

----------------------------------------------------------------------
Kredyt z doplata, nawet 200 000 zl. Sprawdz!
http://link.interia.pl/f20fc