From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Marusich Subject: Re: move "source /etc/profile" from .zlogin to .zprofile Date: Sat, 13 Oct 2018 23:30:10 -0700 Message-ID: <8736t96nwt.fsf@gmail.com> References: <87o9bxj1fy.fsf@gmail.com> <87sh198g6w.fsf@gmail.com> <20181014015608.GA31462@jasmine.lan> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60053) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gBZuy-0002Dl-0c for guix-devel@gnu.org; Sun, 14 Oct 2018 02:30:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gBZur-00027H-CT for guix-devel@gnu.org; Sun, 14 Oct 2018 02:30:18 -0400 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]:46381) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gBZuq-00024t-SL for guix-devel@gnu.org; Sun, 14 Oct 2018 02:30:17 -0400 Received: by mail-pl1-x636.google.com with SMTP id v5-v6so7750654plz.13 for ; Sat, 13 Oct 2018 23:30:15 -0700 (PDT) In-Reply-To: <20181014015608.GA31462@jasmine.lan> (Leo Famulari's message of "Sat, 13 Oct 2018 21:56:08 -0400") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Leo Famulari , Meiyo Peng Cc: guix-devel@gnu.org --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Leo and Meiyo, Leo Famulari writes: > On Sat, Oct 13, 2018 at 06:33:59PM -0700, Chris Marusich wrote: >> [...] If .zprofile and .zlogin are both meant to serve the same >> purpose, then I'm not sure why one would be preferable over the >> other. > > The difference is that they are used at different times =E2=80=94 zprofil= e is > used before zshrc, whereas zlogin is used after zshrc. Meiyo Peng writes: > [...] [S]ince .zlogin is sourced after .zshrc, it will override users > settings in .zshrc. It resets $PATH and many other environment > variables. This is counterintuitive. I see. I'm not a zsh user, but I agree it would make sense to rename .zlogin to .zprofile. I've attached a patch that does this in our /etc/skel. I haven't tested it, though. Would you like to test it and let me know if it works for you? I see that zsh also sources files like /etc/zprofile when they exist. I don't have a strong preference for putting this into /etc/zprofile vs. putting it into ~/.zprofile (via /etc/skel). What do you think about that? Can anybody think of anything bad that might happen if we apply the attached patch? It seems reasonable and safe to me, but you never know! I've always found the relationship between shell start-up scripts to be confusing; everyone seems to want to configure them differently. =2D-=20 Chris --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-system-Rename-.zlogin-to-.zprofile.patch Content-Transfer-Encoding: quoted-printable From=20a80c1f231f0c94a2b2c3780039b3f6fc2957c2be Mon Sep 17 00:00:00 2001 From: Chris Marusich Date: Sat, 13 Oct 2018 22:50:36 -0700 Subject: [PATCH] system: Rename .zlogin to .zprofile. * gnu/system/shadow.scm (default-skeletons): Rename zlogin to zprofile. =2D-- gnu/system/shadow.scm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gnu/system/shadow.scm b/gnu/system/shadow.scm index f800c3b54..63f544cec 100644 =2D-- a/gnu/system/shadow.scm +++ b/gnu/system/shadow.scm @@ -181,7 +181,7 @@ fi alias ls=3D'ls -p --color=3Dauto' alias ll=3D'ls -l' alias grep=3D'grep --color=3Dauto'\n")) =2D (zlogin (plain-file "zlogin" "\ + (zprofile (plain-file "zprofile" "\ # Honor system-wide environment variables source /etc/profile\n")) (guile-wm (computed-file "guile-wm" copy-guile-wm)) @@ -197,7 +197,10 @@ set debug-file-directory ~/.guix-profile/lib/debug set auto-load safe-path /gnu/store/*/lib\n"))) `((".bash_profile" ,profile) (".bashrc" ,bashrc) =2D (".zlogin" ,zlogin) + ;; Zsh sources ~/.zprofile before ~/.zshrc, and it sources ~/.zlogin + ;; after ~/.zshrc. To avoid interfering with any customizations a u= ser + ;; may have made in their ~/.zshrc, put this in .zprofile, not .zlog= in. + (".zprofile" ,zprofile) (".nanorc" ,(plain-file "nanorc" "\ # Include all the syntax highlighting modules. include /run/current-system/profile/share/nano/*.nanorc\n")) =2D-=20 2.18.0 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEy/WXVcvn5+/vGD+x3UCaFdgiRp0FAlvC4nIACgkQ3UCaFdgi Rp3P4Q/9GSXOa5GQNmPc7PI4Uod8HtKH+lOWiBZvaG9Hdu00nP9IDyIat5arbOc/ Qw7D+NkWxOxJcmSbr1bYBBIUQ/BZTkDS8ev/yY6/AfVLJbFw9kiYmTybKJnCdHuW plEJtoMfe/dw1GDaWhfwrmQGk3Q6qlW3UIGQx87e7PP+AB5PUNSPCDREiLQdZQ98 p2ym5LCxIEm36elxls3BRHMpTB+ZDVXaH43JCFg+BaeI2YlVjI7+QIjNyd/KYigK WT2S7WOBtiCThf03YRmUguCrQasSRZ8BguYfO2ke+Dsu9vdfH83rTBzpdWmRte9o tPsp/rOFzZ7vSKUEcljZsgafentvGUVL4BZxhnzy7/DXnJCWacjIUtpl+Gp8N2cJ Dp2CSWEkesGT0c9fSPBumFnA9ktU46V9ZrkKA5QgRVqsBRjAcYX/gDM5ZXxdWKgr yua9cEzXvj3LDcMZO1RGxCeLuWYIotrsXEGYVj3sRsXXQhEudkucualreusuSOck v1ptODlCYrAUipkIq5pTXPfjcPJ4JgFx0lnHP+mBeRB4R5bpKMC+sUJfKKgJH8zb z6+1Ml6c3549Ip/rMH54BszYsRDFQQWUshSr3SnMA4hsOGrLIJD06NTyPbJt0rrE XOXP4KuBSt7p6yNpiWlqMxZHotdB2p2rcTOXY5xPaQ3bb7N/o4s= =RW// -----END PGP SIGNATURE----- --==-=-=--