kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #35566
Re: XDG_CONFIG_HOME on all platforms
-
To:
kicad-developers@xxxxxxxxxxxxxxxxxxx
-
From:
Wayne Stambaugh <stambaughw@xxxxxxxxx>
-
Date:
Tue, 24 Apr 2018 09:17:21 -0400
-
Autocrypt:
addr=stambaughw@xxxxxxxxx; prefer-encrypt=mutual; keydata= xsDiBEM0hxQRBAC2fNh3YOVLu1d5GZ0SbrTNldGiGnCJPLqzEnqFX9v6jmf33TMt6EmSLkl6 Wtfkoj0nVwKxcYmJkA8DX0QAokBkwNIzhSsBzQvthBLIk/5LnPVVKrEXOcL4mUyH1doKlkaE slgJozNa6Av+oavcvD02o1zJOloBbaHlNlyRt7fKswCgtIFlVjWggVH/15KfWk+Qo5JVPbME AIUBAQyL2OAx0n60AWec2WHnO9buHuG0ibtICgUMkE+2MRmYyKwYRdyVwGoIUemFuOyHp0AJ InX4T+vy2E7vkwODqjtMLfIoRkokW74Fi4nrvjlhOAw/vdq/twLbAmR9MOfPTpR4y7kQy1O2 /n+RkkRvh26vTzfbQmrH7cBJhk6aA/9Uwvu3E4zNJgHVZeS0HyWtmR1eOPPRbnkPgJTToX5O KMKzTJI/FX6kT7cFoCamitHrW3BJP4Dx+cMMsa47EGxqVTdbVJ4LjogsXTXxb+0Fn1u4zBdx x3Cer6O7+hqWy7zvpzeC6nSREjqDKa5CgHtv/GLm5uFPOmsjAsnHj2tlBs0mV2F5bmUgU3Rh bWJhdWdoIDxzdGFtYmF1Z2h3QGdtYWlsLmNvbT7CYgQTEQIAIgUCWXDoogIbAwYLCQgHAwIG FQgCCQoLBBYCAwECHgECF4AACgkQG1FxaVn4JF5QbACgmUn1LehNSvH8BMlCRmApskCt8sgA nAw4GoFvw6bm3b7w/Tv4cwapzwPAzsFNBEM0hzEQCACAKu77f9o4LpEKOm9gLvbBj53lKYem ELrJ6JXb+Y66bK3kwuj8+zYbOdmvXUmymoWTkr9mm+kwwuqqMNnf37nRraIpFAUno2Ur6ElY yaPp4nKBCsLBijcaNzoKp+upS/7xVKd/+Lmwhma05UDhmMwvXwy4G8xKw11UsUl3kc2dhvWI 4QKm+p09WH/bUssITDsxRQYaccGEKuaTZol7mEWZxI2DiV0FxeuAxAHB/toxWihtcEwUNv8g Q0HJefSWUHsavYgUxGY1L3+nyz8gjViXZtOrJfgVLPxx+fsL0oTPt9pnvDMBynAcUL/Ozcmg CMnQgQp01SkjACUozNPcLNy3AAMFB/9zGkbbwwrKuqSc2ar/wtAvL7HoVJhcEuPFDP0GIE1h 56wNlDonlRsvWaOknMxrm0tnKk9ijhtsbJHbaGtvIMUruboBxVowgkqX3yDi6Qy60V8AnJEN pEQflmX9fU/i7Vn/JoAjL2Ypo1torX/l2M0nnAJMV6dNSACn3F1zfSQaQUN0skWnm7ENjg/S 9pmJl2NQK8MzdmO/kjOk05/FWpNQFA1Q/8GecqGSTSkNMPqzdfxL4PSs60QFDwrRzAREj8Tw QVryePRM3Dh7YxgZHzCD5LGonvPl/TM9jRs7ob0MMUHBgKrPM9Yap0CH28Dn3vVMBs8RG10X JuGS6ujOnZJ9wkkEGBECAAkFAkM0hzECGwwACgkQG1FxaVn4JF6wdQCfSqokQS6ftWlwGN/e +uSvJR4wcrkAn1gPSGRloW9a9w+p6ugM6pNfNNpx
-
In-reply-to:
<36fa3b85-4489-2863-6e98-ddfc24c735c2@gmail.com>
-
Openpgp:
preference=signencrypt
-
User-agent:
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0
On 4/24/2018 6:54 AM, Strontium wrote:
> Hi Wayne,
>
> I have no personal problem with your patch, but from a standards point
> of view I want to raise this.
>
> As per:
> https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
> |"$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."
>
> The way I read your patch is that, XDG_CONFIG_HOME is being used to
> specify the absolute path of the kicad configuration directory, not it's
> relative base directory.
>
> My concern is that if XDG_CONFIG_HOME is set to someones "relative base
> config directory", then that relative base config directory is going to
> get filled with kicad config files.
>
> Also, on unix, wxStandardPaths::Get().GetUserConfigDir() uses
> XDG_CONFIG_HOME internally, so the current kicad specific support for
> XDG_CONFIG_HOME (as a relative base directory) is redundant.
> see:
> https://github.com/wxWidgets/wxWidgets/blob/master/src/unix/stdpaths.cpp
I just looked at the 3.0.0, 3.0.3, and 3.1.0 wxWidgets sources and
GetUserConfgDir() calls wxFileName::GetHomeDir() which calls
wxGetHomeDir( wxString *home ) found in src/unix/utilsunx.cpp and I
don't see XDG_CONFIG_HOME anywhere in that code path. Oddly enough,
XDG_CONFIG_HOME is used GetDocumentsDir(). This appears to have been
fixed in 3.1.1 of wxWidgets but as our minimum wxWidgets version is
3.0.0, we will have to keep the test for XDG_CONFIG_HOME. Are we having
fun yet? ;)
>
> Maybe its better to just define a new Kicad specific environment
> variable for the purpose, "KICAD_CONFIG_HOME" for example. Then there
> is no conflict with any existing uses or standards, your patch as
> written, would also then remove the redundant of processing XDG_CONFIG_HOME.
>
> Steven
This makes sense to me. I don't want to use XDG_CONFIG_HOME in a
non-standard way. I will place the redundant XDG_CONFIG_HOME
environment variable check within #if wxCHECK_VERSION)/#endif and add a
new KICAD_CONFIG_HOME which will take precedence.
>
> On 24/04/18 01:10, Wayne Stambaugh wrote:
>> Attached is a patch that allows users to have multiple configuration
>> paths using the XDG_CONFIG_HOME environment variable on all platforms.
>> I tested it on windows and it seems to work just fine. I can test it on
>> linux tonight when I get home but if someone can get to it before then I
>> would appreciate the help. Would one of our macos devs please test it
>> as well before I merge it.
>>
>> Thanks,
>>
>> Wayne
>>
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~kicad-developers
>> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~kicad-developers
>> More help : https://help.launchpad.net/ListHelp
>
>
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help : https://help.launchpad.net/ListHelp
>
References