FS#35966 - [zsh] Package /etc/profile sourcing in zshenv, not zprofile
Attached to Project:
Arch Linux
Opened by patrick (brisbin33) - Friday, 28 June 2013, 17:57 GMT
Last edited by Pierre Schmitz (Pierre) - Sunday, 17 November 2013, 10:53 GMT
Opened by patrick (brisbin33) - Friday, 28 June 2013, 17:57 GMT
Last edited by Pierre Schmitz (Pierre) - Sunday, 17 November 2013, 10:53 GMT
|
Details
Problem:
The zsh package ships with an /etc/zsh/zprofile which sources /etc/profile. Request: Arch should package that content in /etc/zsh/zshenv, not /etc/zsh/zprofile. Details: /etc/zsh/zprofile is sourced *after* ~/.zshenv, overriding any $PATH set there. The Wiki notes this, telling users to modify the shipped zprofile or set their $PATH in ~/.zshrc. Modifying /etc/zsh/zprofile to not source /etc/profile breaks many things unless you know when and how to source /etc/profile yourself. Setting your $PATH in ~/.zshrc is sub-optimal b/c then that $PATH is only available in interactive shells. On my systems, I simply mv /etc/zsh/zprofile to /etc/zsh/zshenv. I've been doing this for a while without breakage. However, any zsh updates put /etc/zsh/zprofile back and break my $PATH until I realize what happened and remove it again. |
This task depends upon
Here's an updated PKGBUILD, if that's useful. The zprofile source should probably be renamed though.
# $Id: PKGBUILD 187080 2013-06-03 11:17:13Z allan $
# Maintainer: Pierre Schmitz <pierre@archlinux.de>
pkgname=zsh
pkgver=5.0.2
pkgrel=3
pkgdesc='A very advanced and programmable command interpreter (shell) for UNIX'
arch=('i686' 'x86_64')
url='http://www.zsh.org/'
license=('custom')
depends=('pcre' 'libcap' 'gdbm')
backup=('etc/zsh/zshenv')
install=zsh.install
source=("http://downloads.sourceforge.net/${pkgname}/${pkgname}-${pkgver}.tar.bz2"
'zprofile')
md5sums=('b8f2ad691acf58b3252225746480dcad'
'24a9335edf77252a7b5f52e079f7aef7')
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
# Set correct keymap path
sed -i 's#/usr/share/keymaps#/usr/share/kbd/keymaps#g' Completion/Unix/Command/_loadkeys
# Remove unneeded and conflicting completion scripts
rm -rf Completion/{AIX,BSD,Cygwin,Darwin,Debian,Mandriva,openSUSE,Redhat,Solaris}
rm -f Completion/Linux/Command/_{pkgtool,rpmbuild,yast}
rm -f Completion/Unix/Command/_osc
./configure --prefix=/usr \
--enable-etcdir=/etc/zsh \
--enable-zshenv=/etc/zsh/zshenv \
--enable-zlogin=/etc/zsh/zlogin \
--enable-zlogout=/etc/zsh/zlogout \
--enable-zprofile=/etc/zsh/zprofile \
--enable-zshrc=/etc/zsh/zshrc \
--enable-maildir-support \
--with-term-lib='ncursesw' \
--enable-multibyte \
--enable-function-subdirs \
--enable-fndir=/usr/share/zsh/functions \
--enable-scriptdir=/usr/share/zsh/scripts \
--with-tcsetpgrp \
--enable-pcre \
--enable-cap \
--enable-zsh-secure-free
make
}
check() {
cd "${srcdir}/${pkgname}-${pkgver}"
HOME="${srcdir}" make check
}
package() {
cd "${srcdir}/${pkgname}-${pkgver}"
make DESTDIR="${pkgdir}/" install
install -D -m644 "${srcdir}/zprofile" "${pkgdir}/etc/zsh/zshenv"
install -D -m644 LICENCE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
https://bugs.archlinux.org/task/24953 - June 2011
https://bugs.archlinux.org/task/31873 - October 2012
Is there some reason why we don't implement this as upstream intended? It is frustrating to have to use a work around to achieve what should be default behaviour.
I'm fairly sure I need/want /etc/profile sourced, just not from zprofile. If it can't be sourced in zshenv (for bash compatibility?), I'm at a loss as to where to do it.
Perhaps, if it's intended that PATHs be mucked with in a *profile file, then I should put my own path overrides in ~/.zprofile and not ~/.zshenv ?
Zsh ships without an /etc/zsh/zprofile and Debian with an empty one: why do we create one rather than using the /etc/zsh/zshenv that ships from upstream (albeit with the line inserted to source /etc/profile)?
I am probably just being dense, but the solution that Patrick and I use, to copy /etc/zsh/zprofile to /etc/zsh/zshenv seems closer to upstream than the current approach. Our /etc/profile, FWIW, only differs from debian's in unsetting the man path and termcap (and sourcing bash.bashrc).
Any light you can shed on this would be helpful. Thanks.
Perhaps it should be taken upstream, since most systems shipping zsh have an issue with this (even OS X does).