Subject: Re: --enable-etcdir for multiple locations (similar to PATH)
From: Bart Schaefer <[email-masked]>
To: Ben Woods <[email-masked]>
Cc: Zsh hackers list <[email-masked]>, [email-masked]
Date: Thu, 23 Jun 2016 16:09:37 -0700
List-Id: Zsh Workers List <zsh-workers.zsh.org>

On Thu, Jun 23, 2016 at 3:14 AM, Ben Woods <[email-masked]> wrote:
>
> I am wondering if it is possible to tell zsh to look in multiple different
> locations for it's startup/shutdown configuration files?

No, it's not.  We discussed this issue several (more like many) years
ago and concluded that the number of different ways that zsh can find
configuration files is already complicated enough, maybe even too
complicated.

> This is important, because in FreeBSD, configuration files for ports are
> not supposed to be in /etc, but in /usr/local/etc. However, we are aware
> that many people with read the official zsh documentation at the link below
> and try to put the configuration files in /etc.

The correct solution to this is for the port itself to supply the
/usr/local/etc file containing something like e.g for
/usr/local/etc/zshrc

[[ -f /etc/zshrc && ! /etc/zshrc -ef /usr/local/etc/zshrc ]] && source
/etc/zshrc

Additional tests to prevent recursive "source"ing are possible but may
be overkill.