zsh-workers
 help / color / mirror / code / Atom feed
* --enable-etcdir for multiple locations (similar to PATH)
@ 2016-06-23 10:14 Ben Woods
  2016-06-23 23:09 ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Woods @ 2016-06-23 10:14 UTC (permalink / raw)
  To: zsh-workers; +Cc: adamw

[-- Attachment #1: Type: text/plain, Size: 1230 bytes --]

Hi everyone,

I am wondering if it is possible to tell zsh to look in multiple different
locations for it's startup/shutdown configuration files?

I believe it is possible to change the location that it will look for them
at compile time with --enable-etcdir=INSERTDIRHERE. However, zsh then does
not look for the config files in the default /etc/ directory anymore - only
the newly specified directory.

As an example, it would be good if zsh could be configured at compile time
with a list of directories to search for config files in. If /usr/local/etc
is added to the list, it would look for /etc/zshrc and if it is not found,
it would look for /usr/local/etc/zshrc. The priority would be in the order
they were specified in the compile time flag (similar to PATH) - or they
could even both be read and compound each other.

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.
http://zsh.sourceforge.net/Doc/Release/Files.html

Thanks for your help.

Regards,
Ben

--
From: Benjamin Woods
woodsb02@gmail.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: --enable-etcdir for multiple locations (similar to PATH)
  2016-06-23 10:14 --enable-etcdir for multiple locations (similar to PATH) Ben Woods
@ 2016-06-23 23:09 ` Bart Schaefer
  2016-06-27  8:38   ` Ben Woods
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Schaefer @ 2016-06-23 23:09 UTC (permalink / raw)
  To: Ben Woods; +Cc: Zsh hackers list, adamw

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.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: --enable-etcdir for multiple locations (similar to PATH)
  2016-06-23 23:09 ` Bart Schaefer
@ 2016-06-27  8:38   ` Ben Woods
  0 siblings, 0 replies; 3+ messages in thread
From: Ben Woods @ 2016-06-27  8:38 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: Zsh hackers list, adamw

[-- Attachment #1: Type: text/plain, Size: 1361 bytes --]

On 24 June 2016 at 01:09, Bart Schaefer <schaefer@brasslantern.com> wrote:

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

Thanks for the reply Bart. The FreeBSD port has now been updated by adamw
to look for the config files in /usr/local/etc.
http://www.freshports.org/shells/zsh

Regards,
Ben

--
From: Benjamin Woods
woodsb02@gmail.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-06-27  8:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-23 10:14 --enable-etcdir for multiple locations (similar to PATH) Ben Woods
2016-06-23 23:09 ` Bart Schaefer
2016-06-27  8:38   ` Ben Woods

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).