Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID
	autolearn=ham autolearn_force=no version=3.4.1
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=brasslantern-com.20150623.gappssmtp.com; s=20150623;
        h=mime-version:in-reply-to:references:from:date:message-id:subject:to
         :cc;
        bh=O8qX/z6FSFlVEr5b71e3M3CqSVJSKc0M1msyAu+hL8I=;
        b=r7AC8U7Tdt3EYWGi7tEBThUHdYyaJykFMhIqUkjPSGshdRquZRTsmy0kYyfBr1gK+i
         ySiSlnjAC+7vqHOqaHHlud4w91BAxOsWqQw2RQxBAXyJd3vbyYaElU1XfMrFEI2lK9Dt
         t/jspPiEMRgWtpH3omPKxFEAX88rVvcdnYpodtxR16TCbSvaC/NM7MGY8aXQ49Acj7l7
         w0nKZnVm4DiS1FvbOvIb27pxZYp6q5q42rqdhvM6r0Rc9ta4G8hV6X/0Fjwrix8LV0Wl
         YyqvaI3mPoL8EiqTsOGaSn61HQO+W45tr39R3uWiG3Nmpda62eEbxspSQ05XK176bZCP
         Qmbw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:in-reply-to:references:from:date
         :message-id:subject:to:cc;
        bh=O8qX/z6FSFlVEr5b71e3M3CqSVJSKc0M1msyAu+hL8I=;
        b=U7YUX+g0I1A2cSBbSXYl1d9ugN47q/wBXh5J8veKnY6fEf6Rzx2J+7OgPQEtHwEqz2
         kRHxRuUD1nT5q/bdPCCnbkmw7AkG/iXexvpxx16WuVzRdnWZJ0dYA/6OZcm6lxzJ8hid
         hUqrGLzuXTD5+uBUxBnWKXrx+qBXv8cXRqsEuQCG/4j/MJyGuqoXV5FY0cX5EedIHmiP
         tQajECTiY42UzhU9AQgeL9U0eRRYwkkUMC7hIUeCZOYudJWLt6Lar5glo0BbvQvqo+EW
         cnPtzobnwyxdlXZBmAYEu0UYe2HpcAQBSkYdLVlD8eRo37p2rgoOmL2mJjyVj68iU9Dn
         a4SA==
X-Gm-Message-State: ALyK8tKERVw28wfBcb5cKUyYziFmxahkX7XtAU/5uShIRAUhTTmW2rMJG/NulTtS33GVH8J2EcmtiPIDV05oOQ==
X-Received: by 10.25.91.66 with SMTP id p63mr308725lfb.167.1466723378051; Thu,
 23 Jun 2016 16:09:38 -0700 (PDT)
MIME-Version: 1.0
In-Reply-To: <CAOc73CDmw2uRuMReVoon-ncnPB-zqYi37x9T-wcqQZ_WdDccKw@mail.gmail.com>
References: <CAOc73CDmw2uRuMReVoon-ncnPB-zqYi37x9T-wcqQZ_WdDccKw@mail.gmail.com>
From: Bart Schaefer <schaefer@brasslantern.com>
Date: Thu, 23 Jun 2016 16:09:37 -0700
Message-ID: <CAH+w=7Y7mXWfQodPuMTLhjXsSuU+ZQpVevTVPP0peynCz1kruQ@mail.gmail.com>
Subject: Re: --enable-etcdir for multiple locations (similar to PATH)
To: Ben Woods <woodsb02@gmail.com>
Cc: Zsh hackers list <zsh-workers@zsh.org>, adamw@freebsd.org
Content-Type: text/plain; charset=UTF-8
X-Seq: zsh-workers 38757

On Thu, Jun 23, 2016 at 3:14 AM, Ben Woods <woodsb02@gmail.com> 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.

