On Thu, Sep 26, 2024 at 05:26:59PM +0200, Patrice Dumas wrote:
> My understanding is that if you want to install on non-standard
> locations and want to have this non-standard location being searched for
> before other directories, then you should put first in XDG_DATA_DIRS (or
> XDG_CONFIG_DIRS).  It should be possible to change
> XDG_DATA_DIRS/XDG_CONFIG_DIRS as a user or for the system, but it
> depends on the platform configuration.  It seems to often be in
> /etc/profile.d/ for system-wide early change of environment variables
> for GNU/Linux.
> 
> > Could we consider ignoring the XDG_DATA_DIRS and XDG_CONFIG_DIRS part
> > of the specification?  (It seems that XDG_DATA_HOME and XDG_CONFIG_HOME
> > are the part that people really care about.)
> 
> It seems to me that being able to set the search paths are a good thing.
> They should be adustable if they are set by the distribution.
> 
> > We could try discussing with developers of other GNU packages what
> > they do about these variables, and how the XDG specification works
> > with the GNU Coding Standards and existing practice.
> 
> That could be possible.

Here is the search order I would like to use.

Current (from the documentation):

    ‘./’
         (the current directory)
    
    ‘leading input file path directory’
         If there is a leading directory and it is not the current
         directory.  For example, if the input file is
         ‘some/dir/mymanual.texi’, ‘htmlxref.cnf’ is searched for in
         ‘some/dir’.
    
    ‘./.texinfo/’
         (under the current directory)
    
    ‘XDG_CONFIG_HOME/texinfo’
         (with ‘XDG_CONFIG_HOME’ an environment variable)
    
    ‘~/.config/texinfo/’
         (where ‘~’ is the current user's home directory, only if
         ‘XDG_CONFIG_HOME’ is not set)
    
    ‘XDG_CONFIG_DIRS/texinfo’
         (for each directory in the ‘:’ delimited ‘XDG_CONFIG_DIRS’
         environment variable)
    
    ‘SYSCONFDIR/xdg/texinfo/’
         (where SYSCONFDIR is the system configuration directory specified
         at compile-time, e.g., ‘/usr/local/etc’)
    
    ‘XDG_DATA_DIRS/texinfo’
         (for each directory in the ‘:’ delimited ‘XDG_DATA_DIRS’
         environment variable)
    
    ‘DATADIR/texinfo/’
         (specified at compile time, e.g., ‘/usr/local/share’)

New:

    ‘./’
         (the current directory)
    
    ‘leading input file path directory’
         If there is a leading directory and it is not the current
         directory.  For example, if the input file is
         ‘some/dir/mymanual.texi’, ‘htmlxref.cnf’ is searched for in
         ‘some/dir’.
    
    ‘./.texinfo/’
         (under the current directory)
    
    ‘XDG_CONFIG_HOME/texinfo’
         (with ‘XDG_CONFIG_HOME’ an environment variable)
    
    ‘~/.config/texinfo/’
         (where ‘~’ is the current user's home directory, only if
         ‘XDG_CONFIG_HOME’ is not set)

    ‘SYSCONFDIR/xdg/texinfo/’
         (where SYSCONFDIR is the system configuration directory specified
         at compile-time, e.g., ‘/usr/local/etc’)
   
    ‘XDG_CONFIG_DIRS/texinfo’
         (for each directory in the ‘:’ delimited ‘XDG_CONFIG_DIRS’
         environment variable)
    
    ‘DATADIR/texinfo/’
         (specified at compile time, e.g., ‘/usr/local/share’)

Changes:

* Remove XDG_DATA_DIRS completely.  We do not need to allow or encourage
users to add files to /usr/share/texinfo or to add other directories to
check.  It is enough to allow users to add configuration files
to /etc/xdg/texinfo, or to change XDG_CONFIG_DIRS.

* Move SYSCONFDIR before XDG_CONFIG_DIRS.  This allows a user-configured
value to take priority over a value set by a distribution at login.

I'm happy to make these changes myself if there is agreement.

Reply via email to