kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #14569
Re: Environment variables (was Re: Config file relocation)
On 9/2/2014 11:58 PM, Moses McKnight wrote:
> On 09/02/2014 06:59 PM, Wayne Stambaugh wrote:
>> On 8/31/2014 4:31 AM, Lorenzo Marcantonio wrote:
> <snip>
>>> By the way, I always wondered... why using env vars instead of settings
>>> in a config file? IIRC there were really angry people at the prospect of
>>> having to set environment variables (which is, by the way, the usual way
>>> of doing that on posix systems...)
>>>
>>> Especially since Debian policy explicitly forbids to have applications
>>> relying on them; I don't agree with that and they even patch in defaults
>>> which is a Bad Thing(tm) for me:P
>>>
>>
>> I need to take a look at this. An order of precedence has already been
>> established: environment variable, user configuration, default. It just
>> needs to be coded. I am not willing to give up being able to trump
>> everything with an environment variable for development purposes.
>
> This was actually the next thing on my list of things I was planning on
> looking into. In fact I had these two links ready to put in my argument
> for putting the path variables into config files:
> http://peterlyons.com/problog/2010/02/environment-variables-considered-harmful
>
> http://www.insectnation.org/howto/environment-variables-considered-harmful
>
> The order of precedence you mention is exactly what I had in mind. My
> thought also was to add to the GUI the ability to define path variables,
> and save them in "kicad_common" config file. If you would like me to
> continue to look into this let me know, or let me know if you would just
> rather do it yourself.
>
> Thanks,
> Moses
>
If you have time, go ahead and take a look at it. I'm pretty sure the
code to do this is already in place. I seem to remember Dick mentioning
something about it so take a look at his Kiway work before you write
your own code to handle the environment variable, configuration setting,
and default value. I think it might be somewhere in the project code.
As far as I know, the only required environment variables we support are
KISYSMOD and KISYS3DMOD.
Wayne
Follow ups
References