← Back to team overview

geda-developers team mailing list archive

Re: [RFC] What to call gEDA config files, and where to find them?

 

On Tue, 2011-12-13 at 02:14 +0000, Peter TB Brett wrote:

> My suggestion is as follows, and is based on the freedesktop.org XDG
> Base Directory Specification.  This is designed to minimise 
> 
> * The system configuration file would be named "system.conf".  It would
>   be found by searching each of the ${XDG_CONFIG_DIRS} in order,
>   followed by ${sysconfdir}.  That means that (on a FHS-compliant
>   system), the following candidate files would be checked in order and
>   the first found used:
> 
>     /etc/xdg/gEDA/system.conf                    XDG_CONFIG_DIRS
>     /etc/gEDA/system.conf                        sysconfdir

Why "system.conf"? Aside from the gEDA directory prefix, that isn't
particularly informative.

Do you intend that there are different legal options in the system /
user and project configs? If not, why not just call them all
"gEDA/config" and search any of the appropriate paths in desired the
order?

(I'm being lazy and haven't re-read the XDG base dir spec recently, so
please point out if this is contrary to the intent of the
specification).

>   Since the new config API allows one configuration file to reference
>   another, an alternative is to use *all* of the files found cascaded
>   together.  This makes it more complicated to determine where changes
>   to system configuration should be written to, though.
> 
> * The user configuration file would be named "user.conf".  It would be
>   found by searching ${XDG_CONFIG_HOME}.  That means that the following
>   candidate files would be checked:
> 
>     ${HOME}/.config/gEDA/user.conf               XDG_CONFIG_HOME

(Or the "gEDA/config" file above, only this time found in the user's
XDG_CONFIG_HOME directory).

>   Should ${HOME}/.gEDA/user.conf be checked? One of the aims of the Base
>   Directory Specification is to reduce dotfile clutter in users' home
>   directories...

I'd say no.. we've never loaded from there, so why start now.

This way we'll be able to help people find the right config files
without having to explain "look in ~/.gEDA/*, look in ~/.config/gEDA/*,
look down the back of the sofa.." each time.

> * The project configuration file would be named "project.conf".  It
>   would be found by searching the directory tree upward from a symbol or
>   schematic file until a project configuration file is found or a
>   filesystem boundary is encountered.  If no configuration file is
>   found, a file in the current working directory would be created.

No reason I can see to worry about checking for file-system boundaries.
Users might do all sorts of fun things with symlinks, mount --bind etc..

>   For schematic file named "/home/user/project/schematics/foo.sch",
>   where /home is on a separate filesystem, the following candidate
>   project config files would be checked:
> 
>     /home/user/project/schematics/project.conf
>     /home/user/project/project.conf
>     /home/user/project.conf
>     /home/project.conf                           (FS boundary)
>     /home/user/project/schematics/project.conf
> 
> Obviously, it's important to get this right, since once users start
> migrating their configurations to the new framework these filenames
> won't be at all easy to alter! (I also want to have the specification
> fairly well pinned down before I write lots of code).
> 
> Please bikeshed away.

I don't really like the sound of "project.conf", but I'll have to
consult my Dulux colour chart before I can suggest a more soothing
shade. I'm not a huge fan of forcing one project per dir, so in an ideal
world - I'd say this config would be referenced from, or contained
within a "project file" (whatever that looks like).


Best wishes,

Peter C

Attachment: signature.asc
Description: This is a digitally signed message part


References