FS#24953 - [zsh] /etc/profile should not replace /etc/zprofile and conflicts between /etc files and docs.
Attached to Project:
Arch Linux
Opened by David J. Haines (dhaines) - Wednesday, 29 June 2011, 16:02 GMT
Last edited by Allan McRae (Allan) - Friday, 16 November 2012, 11:45 GMT
Opened by David J. Haines (dhaines) - Wednesday, 29 June 2011, 16:02 GMT
Last edited by Allan McRae (Allan) - Friday, 16 November 2012, 11:45 GMT
|
Details
Description:
The PKGBUILD for zsh includes "--enable-zprofile=/etc/profile," the inclusion of which breaks zsh, according to the specifications laid out in zsh(1). Essentially, /etc/profile is not supposed to be looked at by zsh, but rather by sh and bash. Zsh takes this into account by using /etc/profile (so as to allow zsh-specific syntax and commands in the file without breaking bash). Arch is supposed to rely on not changing things from their defaults (part of KISS), and this doesn't do that. If you must change it from /etc/zprofile, at least call it /etc/zsh/zprofile. Accompanying this issue is the fact that zsh's manpages need to be updated to reflect the Arch-specific changes, lest users not be able to use system-wide init files. The PKGBUILD puts some stuff in /etc/zsh/, while the manpages refer to /etc/. Essentially, the package as it stands defies the documentation. One of them needs to be fixed. |
This task depends upon
Closed by Allan McRae (Allan)
Friday, 16 November 2012, 11:45 GMT
Reason for closing: Fixed
Additional comments about closing: only upstream documentation issue remains
Friday, 16 November 2012, 11:45 GMT
Reason for closing: Fixed
Additional comments about closing: only upstream documentation issue remains
See
FS#8946:"Again, zsh is built with --enable-zprofile=/etc/profile so profile is sourced when you use a login shell." - Xavier (shining)
/etc/profile is provided by filesystem, and by default sources /etc/bash.bashrc ONLY when $BASH is set (at least in filesystem 2011.04-1),
so this should be zsh compatible.
If you want zsh configuration in /etc/profile you should add similar lines using $ZSH_NAME or something like it.
The documentation however, is another thing.
EDIT: Attached default profile from filesystem 2011.04-1
So, to help the discussion forward, let's not "reimplement the wheel". These people were in the same boat as we,
https://bugzilla.redhat.com/show_bug.cgi?id=430665
though, they were already in this boat in 2008.
Looking at the version here: https://projects.archlinux.org/svntogit/packages.git/tree/trunk/profile?h=packages/filesystem&id=1afd567633c7e1b461cf8dffda1b20da694012df
* It unconditionally clobbers a number of environment variables that may
have been set by the user's zshenv (lines 7, 24, 27).
* It uses an unadorned * glob, which is an error by default in zsh
if there are no matches (line 12).
* It does not enable sh compatibility mode before sourcing other scripts in
/etc/profile.d (line 13).
Please don't force zsh to use the same startup scripts as bash. I was quite
surprised to discover that the reason my shell was not working properly was
because my zprofile was not being run! I have not encountered any other
distro which does this.
As a workaround, putting the following at the top of /etc/profile restores sane
behaviour:
if test x"$ZSH_VERSION" != x; then
. /etc/zsh/zprofile
return
fi
Cheers.