Michael Prokop <bts@bts.grml.org>:
> > Thanks for your work, works really fine. The only remaining issue is the
> > 'xsource' stuff we (ft + me) were talking about via ICQ. Keeping the bugreport
> > open therefore.
Okay, here's a fix. It's very simple and will not change anything for
anyone. I'll comment on the export and append a clean one:
[...]
> -if type xsource &>/dev/null ; then
> - xsource "${HOME}/.zshrc.global"
> -else
> - . "${HOME}/.zshrc.global"
> -fi
> +
> +# Note, that xsource() is defined in the global file, so here,
> +# we will have to do the sourcing manually for once:
> +
> + [[ -r "${HOME}/.zshrc.global" ]] && source "${HOME}/.zshrc.global"
> +
Doing this manually for '.zshrc.global' doesn't hurt too much, and it
solves the case.
[...]
> if [[ -z "$ZSHRC_GLOBAL_HAS_BEEN_READ" ]] ; then
> - print 'Warning: global zsh config has not been read'>&2
> + print 'Warning: global zsh config has not been read.' >&2
> + print ' prepare for possible errors!' >&2
Adding further information to the warning message. Because code, that
depends on stuff in the global file will make that code fail.
[...]
> -if type xsource &>/dev/null ; then
> - xsource "${HOME}/.zshrc.local"
> -else
> - . "${HOME}/.zshrc.local"
> -fi
> +xsource "${HOME}/.zshrc.local"
If the global file was sourced (which it *really* *should*), we can
depend on code from it unconditionally here. So we should just do it,
and expect user's who use the setup on non-grml-systems to follow the
instructions from the reference card (which we do not need to change
with this solution).
Comments? .o( Though, I really think this is the way to go. )
Regards, Frank |