unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Chris Marusich <cmmarusich@gmail.com>
To: Leo Famulari <leo@famulari.name>, Meiyo Peng <meiyo.peng@gmail.com>
Cc: guix-devel@gnu.org
Subject: Re: move "source /etc/profile" from .zlogin to .zprofile
Date: Sat, 13 Oct 2018 23:30:10 -0700	[thread overview]
Message-ID: <8736t96nwt.fsf@gmail.com> (raw)
In-Reply-To: <20181014015608.GA31462@jasmine.lan> (Leo Famulari's message of "Sat, 13 Oct 2018 21:56:08 -0400")


[-- Attachment #1.1: Type: text/plain, Size: 1414 bytes --]

Hi Leo and Meiyo,

Leo Famulari <leo@famulari.name> 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 — zprofile is
> used before zshrc, whereas zlogin is used after zshrc.

Meiyo Peng <meiyo.peng@gmail.com> 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.

-- 
Chris

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-system-Rename-.zlogin-to-.zprofile.patch --]
[-- Type: text/x-patch, Size: 1526 bytes --]

From a80c1f231f0c94a2b2c3780039b3f6fc2957c2be Mon Sep 17 00:00:00 2001
From: Chris Marusich <cmmarusich@gmail.com>
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.
---
 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
--- a/gnu/system/shadow.scm
+++ b/gnu/system/shadow.scm
@@ -181,7 +181,7 @@ fi
 alias ls='ls -p --color=auto'
 alias ll='ls -l'
 alias grep='grep --color=auto'\n"))
-        (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)
-      (".zlogin" ,zlogin)
+      ;; Zsh sources ~/.zprofile before ~/.zshrc, and it sources ~/.zlogin
+      ;; after ~/.zshrc.  To avoid interfering with any customizations a user
+      ;; may have made in their ~/.zshrc, put this in .zprofile, not .zlogin.
+      (".zprofile" ,zprofile)
       (".nanorc" ,(plain-file "nanorc" "\
 # Include all the syntax highlighting modules.
 include /run/current-system/profile/share/nano/*.nanorc\n"))
-- 
2.18.0


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  reply	other threads:[~2018-10-14  6:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-13 15:44 move "source /etc/profile" from .zlogin to .zprofile Meiyo Peng
2018-10-14  1:33 ` Chris Marusich
2018-10-14  1:56   ` Leo Famulari
2018-10-14  6:30     ` Chris Marusich [this message]
2018-10-14  7:58       ` Meiyo Peng
2018-10-15  9:48       ` Ludovic Courtès
2018-10-16  4:59         ` Leo Famulari
2018-10-16 11:55           ` Ludovic Courtès
2018-10-19  7:47             ` Chris Marusich
2018-10-14  3:14   ` Meiyo Peng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8736t96nwt.fsf@gmail.com \
    --to=cmmarusich@gmail.com \
    --cc=guix-devel@gnu.org \
    --cc=leo@famulari.name \
    --cc=meiyo.peng@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).