questions concerning basedirspec

chrysn chrysn at fsfe.org
Wed Jan 18 10:25:07 PST 2012


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.

  (will donnelly asked something similar here some time ago[1], cc'ing
  him in case he's still interested.)

* /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?


to be honest, i prefer to use the xdg basedir specification in a neatly
packaged library form, and unfortunately, due to said concerns, pyxdg
can't do much more for me than resolve XDG_DATA_HOME etc. to variables,
and i've got to hack it here and there to get it to do what i want --
that's not due to shortcomings of pyxdg, though, but because it does
just what the specification says.


could you enlighten me on the reasoning behind the /etc/xdg issue?

what are the possibilities of better reflecting the fhs choices
(/usr/share, /var/lib) for data storage?

thanks
chrysn

[1] http://lists.freedesktop.org/archives/xdg/2009-July/010805.html

-- 
To use raw power is to make yourself infinitely vulnerable to greater powers.
  -- Bene Gesserit axiom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/xdg/attachments/20120118/532efea2/attachment.pgp>


More information about the xdg mailing list