Fwd: questions concerning basedirspec

Trans transfire at gmail.com
Thu Jan 19 12:40:40 PST 2012


I really wish the return address was the list, not the poster. I
ALWAYS forget to change the `to` field b/c this is the ONLY list that
I subscribe that does this. Anyway....


---------- Forwarded message ----------
From: Trans <transfire at gmail.com>
Date: Wed, Jan 18, 2012 at 10:15 PM
Subject: Re: questions concerning basedirspec
To: chrysn <chrysn at fsfe.org>


On Wed, Jan 18, 2012 at 1:25 PM, chrysn <chrysn at fsfe.org> wrote:
> hello xdg people,
>
> i'm just patching an application to obey xdg and have got some problems
> in understanding:
>
> * concerning /etc/xdg: a typical setup of a program named calypso would
>  these days have its global config in /etc/calypso/config and its user
>  config in ~/.config/calypso/config. thus (unless XDG_CONFIG_DIRS is
>  set to /etc/xdg:/etc, which isn't the case anywhere i've seen so far),
>  the application could not use xdg for config file resolution without
>  some manual quirks or migrating its config files.
>
>  is such a migration the intention of xdg? (as the migration from
>  ~/.calypso/config to ~/.config/calypso/config was?) if so, why? i
>  could follow the idea of ~/.config, but i don't see any for /etc/xdg.

I concur with you sentiment here. I never quite understood why
/etc/xdg is used and not just /etc, or at least /etc/xdg:/etc as you
suggest.

> * /var vs. /usr/{local/,}. when i access globally installed data, i have
>  to know whether they are static or variable, and according to fhs go
>  to /usr/{local/,}share/ or /var/. there seems not to be such a
>  distinction with user data which is in ~/.local/share, and i don't
>  think there's much need for it (to my knowledge, the distinction
>  between /usr/share and /var is largely due to mounting considerations,
>  which are not that serious in user homes).
>
>  now whatever it is i want to pick both from per-user data and global
>  data, depending on the nature of what i'm looking up, i'd need to go
>  either to usr or var. shouldn't there, thus, be XDG_DATA_DIRS and
>  independently XDG_DATA_DIRS_VARIABLE? or, considering it's mainly used
>  to look up existing files which probably won't be present in both
>  locations, shouldn't XDG_DATA_DIRS default to
>  /var/lib:/usr/local/share:/usr/share?
>
>  to give an example: with calypso (a program that stores vcard and
>  calendar files), calypso run by a user would take its data from
>  ~/.local/share/calypso/calendars, while running as a system daemon,
>  it'd go for /var/lib/calypso/calendars, falling back because the
>  daemon user doesn't have a ~/.local/share/calypso/calendars.
>
>  in general, i feel that what's saved in ~/.local/shared more resembles
>  /var/lib from the way it is used than /usr/share, but that might well
>  be due to the application i have in mind.
>
>  quite possibly, the issue of deciding where to store data is too
>  complicated for the xdg specification to cover (after all, we do have
>  fhs for that), but then, why is ther XDG_DATA_DIRS in the first place?

First of all, just think of .local/ as the users personal version of
/usr/local. Holding strictly to the analogy makes it fairly easy to
work out what to use .local for and how.

Consequently, you are absolutely right that the base directory
standard is missing a "~/.variable" directory as a counterpart to the
system wide /var.

Something like $XDG_VARIABLE_HOME and $XDG_VARIABLE_DIRS would be nice
additions, and in at least once case I just pretended such was already
the case b/c I needed a pre-user var/ equivalent.


-- 
Sorry, says the barman, we don't serve neutrinos. A neutrino walks into a bar.

Trans <transfire at gmail.com>
7r4n5.com      http://7r4n5.com


More information about the xdg mailing list