You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Wolfram Nyaa~ <wo...@ritsuka.org> on 2012/04/19 09:20:38 UTC

XDG Base Directory Specification support?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Could Subversion please follow the XDG Base Directory Specification for
the configuration/data directory on linux?

more infos here:
- - http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
- - http://www.freedesktop.org/wiki/Software/pyxdg
- - https://wiki.ubuntu.com/LittleDetails#Use%20XDG%20folders
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJPj7zBAAoJEN9tENx5d7sAL60IAIQ4m03CaUH3WfwaXhNdUajf
/wn+oSWZO1lsCdm4xGaPJ2GO3lkS9LSObErhVU6YNqxhhn8RiordPv9Bwy1zflvu
gLnHGR/snSWsrqLWF/kgtcaCTOPx1TbWEm3NO9UkrOGNgrDUU35HdSP/NLUNmuTn
ILMQBVM5+HcXuAlkK9xLHAV4BgEacsY+tcrurhW5w4PUq50s9lDgD0Ny+7dg4Rbq
bDeUctdgK9XotnanvB4fD0K+OONEaGi/lfLQf3BrpCZNIzuDn53gjnTQDvvomr2P
cAUDCffgybKfh4CBUoCRCxmxdeUiG77UIk1CNnZ45D/Ci/jxdcchFICQAgekTJc=
=ZLr8
-----END PGP SIGNATURE-----

Re: XDG Base Directory Specification support?

Posted by Wolfram Nyaa~ <wo...@ritsuka.org>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 20.04.2012 14:28, Daniel Shahaf wrote:
>>> the default lookup order of config from: /etc/subversion, 
>>> $HOME/.subversion   (as modified by --config-dir) to some other
>>>  sequence of directories, obtained from $XDG_* envvars?
>> I think that the following sequence should be used: 1)
>> /etc/subversion 2) --config-dir (if set) 3)
>> $XDG_CONFIG_HOME/subversion (if XDG_CONFIG_HOME set and not
>> empty) 4) $HOME/.subversion
> 
> Not quite; --config-dir overrides/replaces $HOME/.subversion/.
> (This is how it works today, and I don't see why introducing $XDG_*
> support should change that part of the semantics.)
No problem.

>>> Is it safe to use those envvars whenever they are set?
>> According to FDO specification, [snip part of the spec describing
>> how to handle missing/empty envvars]
> 
> Doesn't answer my question.  Perhaps there is a competing spec that
> also uses the XDG_* vars in another manner?
I don't know about alternative specs.

> Perhaps using those envvars would break backwards compatibility
> somehow? (How could that be?  Perhaps a recent Linux distro decides
> to make bash set the XDG_CONFIG_HOME whenever it starts; this will
> cause pre-commit hook scripts to inherit that envvar.)
And what will happen? If you are talking about old configs already
stored in ~/.subversion, SVN may just check their existence if
XDG_CONFIG_HOME is set and move them into new location
(many software acting like so, midnight commander for example)

>>> Is it possible for them to be set but for the user not to want 
>>> them used to find config files?
>> In such case user should redefine or clear them I think
> 
> Not all users have root on the boxes they use svn on.  Perhaps
> someone uses a box where their admins set XDG_* envvars for them
> but for some reason they don't want use those (for svn)?  Can that
> happen?
Why not to just export XDG_CONFIG_HOME=""/set XDG_CONFIG_HOME=""/etc?
Such actions are never require administrative rights.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJPkRVyAAoJEN9tENx5d7sA31sIANPG9othVSewlhYoqOR+FavN
pEhMbxKXECdPnVeuz7YxG5IwLKxGzPGJwzOEi0XNOa7cz6WrnUiiD3UxRfwbpU8P
Uzc32S7C5kA47UJvtoolINIqyLs6e+lWLM+Q8TprbzJSeqZI4ISkPE6pxibMDRou
TXgVlzrQwT5O02W2AE8hjLZhl6T4EA9xcooqsSdpsBhsTWFN3LFi85sJ2nrXlVV2
2ZNuNE0Exs6JG7+sMBtkg3+oppHb8LRP6XEa5Wjwc7zSh+UcECKhMV18UMOKm4UE
ncuUl+/vb9p/JHDtjZMP+K/jjLy9WxLi2OXbKBXGlHl12GbYvMoalzaCGlojwyw=
=GEeG
-----END PGP SIGNATURE-----

Re: XDG Base Directory Specification support?

Posted by Philip Martin <ph...@wandisco.com>.
Daniel Shahaf <da...@elego.de> writes:

> Wolfram Nyaa~ wrote on Fri, Apr 20, 2012 at 14:05:17 +0700:
>> I think that the following sequence should be used:
>> 1) /etc/subversion
>> 2) --config-dir (if set)
>> 3) $XDG_CONFIG_HOME/subversion (if XDG_CONFIG_HOME set and not empty)
>> 4) $HOME/.subversion
>
> Not quite; --config-dir overrides/replaces $HOME/.subversion/.  (This is
> how it works today, and I don't see why introducing $XDG_* support
> should change that part of the semantics.)

Looking at the spec there is $XDG_CONFIG_DIRS, a colon separated list,
that should fall back to /etc/xdg if $XDG_CONFIG_DIRS is not set.  Then
there is $XDG_CONFIG_HOME that should fall back to $HOME/.config if not
set.

So the system locations are:

   - $XDG_CONFIG_DIRS/subversion or /etc/xdg/subversion

   - /etc/subversion

The user locations are:

   - $XDG_CONFIG_HOME/subversion or $HOME/.config/subversion

   - $HOME/.subversion

And the command-line is:

   - --config-dir if set

I assume the existing system/user/command-line rules remain unchanged.
What would change is how we locate the system and user dirs.  I suppose
we look for the XDG version first, and if not found fall back on the
current location.

-- 
Philip

Re: XDG Base Directory Specification support?

Posted by Daniel Shahaf <da...@elego.de>.
Wolfram Nyaa~ wrote on Fri, Apr 20, 2012 at 14:05:17 +0700:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On 20.04.2012 1:35, Daniel Shahaf wrote:
> > Wolfram Nyaa~ wrote on Fri, Apr 20, 2012 at 00:32:40 +0700:
> >> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
> >> 
> >> On 04/19/2012 11:32 PM, Daniel Shahaf wrote:
> >>> For what configuration and what data?  Client config?  Server 
> >>> config? Working copies?  Repositories?
> >> Any data from ~/.subversion. Client config as far as I know.
> > Does that entail anything beyond changing
> No, I think
> 

OK

> > the default lookup order of config from: /etc/subversion, 
> > $HOME/.subversion   (as modified by --config-dir) to some other 
> > sequence of directories, obtained from $XDG_* envvars?
> I think that the following sequence should be used:
> 1) /etc/subversion
> 2) --config-dir (if set)
> 3) $XDG_CONFIG_HOME/subversion (if XDG_CONFIG_HOME set and not empty)
> 4) $HOME/.subversion

Not quite; --config-dir overrides/replaces $HOME/.subversion/.  (This is
how it works today, and I don't see why introducing $XDG_* support
should change that part of the semantics.)

> 
> > Is it safe to use those envvars whenever they are set?
> According to FDO specification,
> [snip part of the spec describing how to handle missing/empty envvars]

Doesn't answer my question.  Perhaps there is a competing spec that also
uses the XDG_* vars in another manner?  Perhaps using those envvars
would break backwards compatibility somehow?

(How could that be?  Perhaps a recent Linux distro decides to make bash
set the XDG_CONFIG_HOME whenever it starts; this will cause pre-commit
hook scripts to inherit that envvar.)

> 
> > Is it possible for them to be set but for the user not to want
> > them used to find config files?
> In such case user should redefine or clear them I think

Not all users have root on the boxes they use svn on.  Perhaps someone
uses a box where their admins set XDG_* envvars for them but for some
reason they don't want use those (for svn)?  Can that happen?

> 

I'm not opposed to the idea, by the way.  I'm just reviewing the design
and trying to ensure we don't break A's use-case while implementing B's
new feature.

Cheers,

Daniel


Re: XDG Base Directory Specification support?

Posted by Wolfram Nyaa~ <wo...@ritsuka.org>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 20.04.2012 1:35, Daniel Shahaf wrote:
> Wolfram Nyaa~ wrote on Fri, Apr 20, 2012 at 00:32:40 +0700:
>> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
>> 
>> On 04/19/2012 11:32 PM, Daniel Shahaf wrote:
>>> For what configuration and what data?  Client config?  Server 
>>> config? Working copies?  Repositories?
>> Any data from ~/.subversion. Client config as far as I know.
> Does that entail anything beyond changing
No, I think

> the default lookup order of config from: /etc/subversion, 
> $HOME/.subversion   (as modified by --config-dir) to some other 
> sequence of directories, obtained from $XDG_* envvars?
I think that the following sequence should be used:
1) /etc/subversion
2) --config-dir (if set)
3) $XDG_CONFIG_HOME/subversion (if XDG_CONFIG_HOME set and not empty)
4) $HOME/.subversion

> Is it safe to use those envvars whenever they are set?
According to FDO specification,

>> If an environment variable is either not set or empty, its 
>> default
value as defined by this specification should be used instead.

and

>> $XDG_CONFIG_HOME defines the base directory relative to which 
>> user
specific configuration files should be stored. If $XDG_CONFIG_HOME is
either not set or empty, a default equal to $HOME/.config should be used.

Look at this page:
http://standards.freedesktop.org/basedir-spec/latest/ar01s03.html

> Is it possible for them to be set but for the user not to want
> them used to find config files?
In such case user should redefine or clear them I think

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJPkQqsAAoJEN9tENx5d7sADKIIAIm5rfA1pQq4QOrhHKEKBsc3
fIaL8IXIm/RWSyH4SDmyMQcDq24a8WZfRWyWUe3fMAgOlSIjEdUyU/afycE8l32p
G77X7gBOf2juwZZ9QWAIPr8abgGcUS4R7frV0NbbkAnjIiMwSPjP/1//+/TFqQIE
2QwYYp1FUEvwQHHxecRYOwLC8NncEBuRzkY8LgYl3kIeTx+o4Jqkvt4nWVq4IhzK
y2ksuh+uxPaF5dNB2vXC0obutG3oBa62kloxXbKvM4PN3+Eg1UygSLWQnJqk6Jl5
FNZfqrpr2Lj0kKEMGmhF1Fhd89SUKS1Zeg6TUVGgORHxl3/ag4PIUsxT+zzzDg8=
=4CW0
-----END PGP SIGNATURE-----

Re: XDG Base Directory Specification support?

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Wolfram Nyaa~ wrote on Fri, Apr 20, 2012 at 00:32:40 +0700:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On 04/19/2012 11:32 PM, Daniel Shahaf wrote:
> > For what configuration and what data?  Client config?  Server
> > config? Working copies?  Repositories?
> Any data from ~/.subversion. Client config as far as I know.

Does that entail anything beyond changing the default lookup order of
config from:

/etc/subversion, $HOME/.subversion   (as modified by --config-dir)

to some other sequence of directories, obtained from $XDG_* envvars?


Is it safe to use those envvars whenever they are set?  Is it possible
for them to be set but for the user not to want them used to find config
files?

Re: XDG Base Directory Specification support?

Posted by Wolfram Nyaa~ <wo...@ritsuka.org>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 04/19/2012 11:32 PM, Daniel Shahaf wrote:
> For what configuration and what data?  Client config?  Server
> config? Working copies?  Repositories?
Any data from ~/.subversion. Client config as far as I know.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJPkEwzAAoJEN9tENx5d7sAtKEIAJ79PLvI9lUkCziTFASFqOrQ
Q5A2VQIFtaQcU1FOsvvik31C8UQmBvU/EE9vlJv7nyzJi2FZaTVf/KqJNWSKc/dO
9CfjRTfUC4nvwYKU94Y9TPe0RXNb7fPloohnHRP/SYSTU0XvuktDhVXNcga5AaDi
9J8RU3HPA3Sh6x4TgLStwsOLELt7IgBbmKEMasZQFffS7VC9HgSTYLKuAMvuX9+1
lKkQhs9ITpighBFlc9Ac7PoF/SqNAl6LSLdM+XpfbAyp/1lVzTVO8IygnZTu4o2k
+Mdsv6HpW+/VOaCS1i1r6YQzJylv5677HyetERbudAEIIFQTudHNapPtR5HX5Q4=
=umOj
-----END PGP SIGNATURE-----

Re: XDG Base Directory Specification support?

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
For what configuration and what data?  Client config?  Server config?
Working copies?  Repositories?

Wolfram Nyaa~ wrote on Thu, Apr 19, 2012 at 14:20:38 +0700:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Could Subversion please follow the XDG Base Directory Specification for
> the configuration/data directory on linux?
> 
> more infos here:
> - - http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
> - - http://www.freedesktop.org/wiki/Software/pyxdg
> - - https://wiki.ubuntu.com/LittleDetails#Use%20XDG%20folders
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iQEcBAEBAgAGBQJPj7zBAAoJEN9tENx5d7sAL60IAIQ4m03CaUH3WfwaXhNdUajf
> /wn+oSWZO1lsCdm4xGaPJ2GO3lkS9LSObErhVU6YNqxhhn8RiordPv9Bwy1zflvu
> gLnHGR/snSWsrqLWF/kgtcaCTOPx1TbWEm3NO9UkrOGNgrDUU35HdSP/NLUNmuTn
> ILMQBVM5+HcXuAlkK9xLHAV4BgEacsY+tcrurhW5w4PUq50s9lDgD0Ny+7dg4Rbq
> bDeUctdgK9XotnanvB4fD0K+OONEaGi/lfLQf3BrpCZNIzuDn53gjnTQDvvomr2P
> cAUDCffgybKfh4CBUoCRCxmxdeUiG77UIk1CNnZ45D/Ci/jxdcchFICQAgekTJc=
> =ZLr8
> -----END PGP SIGNATURE-----

> pub  2048R/7977BB00 2010-02-18 Wolfram Nyaa~ <wo...@ritsuka.org>
>       Key fingerprint = 0A0D 8615 0CEB 26E1 6996  43C1 DF6D 10DC 7977 BB00
> sub  2048R/DADBBBAE 2010-02-18 [expires: 2015-02-17]