[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: XDG Base Directory Specification ignores installation directories
From: |
Patrice Dumas |
Subject: |
Re: XDG Base Directory Specification ignores installation directories |
Date: |
Thu, 26 Sep 2024 17:26:59 +0200 |
On Wed, Sep 25, 2024 at 06:54:12PM +0100, Gavin Smith wrote:
> I understand the idea of files in datadir not being edited, although
> I am still not really sure what the purpose of XDG_DATA_DIRS is (in
> general, not just as it relates to Texinfo). According to the XDG
> Specification, this is /usr/local/share:/usr/share by default, which is
> where the files are installed by the package as an integral part of the
> program. This corresponds to the ${datadir} of the GNU Coding Standards.
> I do not understand why anyone would set XDG_DATA_DIRS.
>
> It seems that XDG_DATA_DIRS (and XDG_CONFIG_DIRS) are already set on
> my system (Linux Mint 21.2 Xfce, which is an Ubuntu derivative) when I
> log in. If this is frequent, then it causes problems for people installing
> to non-standard ${datadir} (and ${sysconfdir}) where files in the wrong
> locations would be used if these variables take priority over compiled-in
> values.
My understanding is that if you want to install on non-standard
locations and want to have this non-standard location being searched for
before other directories, then you should put first in XDG_DATA_DIRS (or
XDG_CONFIG_DIRS). It should be possible to change
XDG_DATA_DIRS/XDG_CONFIG_DIRS as a user or for the system, but it
depends on the platform configuration. It seems to often be in
/etc/profile.d/ for system-wide early change of environment variables
for GNU/Linux.
> Could we consider ignoring the XDG_DATA_DIRS and XDG_CONFIG_DIRS part
> of the specification? (It seems that XDG_DATA_HOME and XDG_CONFIG_HOME
> are the part that people really care about.)
It seems to me that being able to set the search paths are a good thing.
They should be adustable if they are set by the distribution.
> We could try discussing with developers of other GNU packages what
> they do about these variables, and how the XDG specification works
> with the GNU Coding Standards and existing practice.
That could be possible.
As a side note, I am not sure that it is very useful, but I tried to
raise one issue I saw with inconsistency between $datadir/... and
directories searched for in the XDG specification on the Xdg info list.
There was some discussion and, in addition to my proposals a proposal to
remove completly reference to $datadir in the specification to avoid the
issue:
https://lists.freedesktop.org/archives/xdg/2024-August/014748.html
https://lists.freedesktop.org/archives/xdg/2024-August/014754.html
It was not followed by any action, be it a rejection, nor more
discussion nor implementation. It is not actually clear too me, now,
that this list is really the place to discuss freedesktop.org's
standards and specifications.
--
Pat