← Back to team overview

geda-developers team mailing list archive

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

 

Hi folks,

As you probably know, after 1.8.0 is released I'm planning on changing
the way gEDA is configured.  I want to change from relying on executable
Scheme scripts for per-project configuration, to having a parsed
configuration file format.  This will facilitate:

* Applications that can load gEDA schematics and symbols without
  needing to run a Scheme interpreter.

* Loading gEDA projects received from other users without the security
  risk of running untrusted code.

* Applications that can display and modify gEDA settings in a
  user-friendly manner.

Today, I'd like to solicit your input on two issues.  Firstly, what
should the configuration files be called?  And secondly, how should they
be found?  There will be three types of configuration file: system, user
and project.

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

  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

  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...

* 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.

  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.

                            Peter

-- 
Peter Brett

Electronic Systems Engineer
Integral Informatics Ltd


Follow ups