Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 207037 - app-shells/zsh Settings in ~/.zshenv are overwritten by /etc/profile.env
Summary: app-shells/zsh Settings in ~/.zshenv are overwritten by /etc/profile.env
Status: RESOLVED DUPLICATE of bug 19924
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Torsten Veller (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-22 14:16 UTC by René 'Necoro' Neumann
Modified: 2008-05-07 08:37 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description René 'Necoro' Neumann 2008-01-22 14:16:49 UTC
In a login shell, user settings done in ~/.zshenv get overwritten by /etc/zsh/zprofile when it calls /etc/profile.env.
This is because ~/.zshenv gets sourced before the zprofile and profile.env sets absolute values and thus discarding the other ones...

In a non-login shell this does not happen as zprofile is ignored there.
Comment 1 Torsten Veller (RETIRED) gentoo-dev 2008-02-02 23:19:07 UTC
So why don't you set these variables in your .zprofile?

What change do you expect?
Comment 2 René 'Necoro' Neumann 2008-02-06 11:57:55 UTC
.zprofile is only sourced by login shells. To be honest: for my problem it would be an acceptable solution - but perhaps there are other cases which would cannot be fixed this way... (e.g. if the terminal starts a non-login shell)

So currently to guarantee, that the correct env-vars are set, you either have to put a "source .zshenv" in .zprofile (or vice versa) (which could result in other problems though) - or duplicate all relevant values.

Comment 3 Torsten Veller (RETIRED) gentoo-dev 2008-02-06 12:37:27 UTC
(In reply to comment #0)
> In a login shell, user settings done in ~/.zshenv get overwritten by
> /etc/zsh/zprofile when it calls /etc/profile.env.

(In reply to comment #2)
> .zprofile is only sourced by login shells.
> [...]
> but perhaps there are other cases which would
> cannot be fixed this way... (e.g. if the terminal starts a non-login shell)

/etc/zsh/zprofile is only sourced by login shells too. So we are talking about login shells here.

> So currently to guarantee, that the correct env-vars are set, you either have
> to put a "source .zshenv" in .zprofile (or vice versa) (which could result in
> other problems though) - or duplicate all relevant values.

Honestly I still don't see the problem.
Comment 4 René 'Necoro' Neumann 2008-02-06 12:49:54 UTC
An example: you want to append something to $PATH - and you want all shells (whatever their type is) to reflect this change.

With the current behavior you have to do two things:

To get the change in non-login shells: Modify .zshenv
To get the change in login shells: Modify .zshprofile

With other words: You have to do the change twice (which can result in a maintaining nightmare).

Following the original zsh idea, you would only have to modify .zshenv.

(by the way: same problem exists for everything in /etc/zsh/zshenv)
Comment 5 Torsten Veller (RETIRED) gentoo-dev 2008-02-09 09:35:00 UTC
So, I just spend some time reading old bug reports. This bug is in fact a duplicate of bug #19924.

A possible solution is in StartupFiles/zshenv. What do you think about this?
Comment 6 René 'Necoro' Neumann 2008-02-10 23:37:30 UTC
(In reply to comment #5)
> So, I just spend some time reading old bug reports. This bug is in fact a
> duplicate of bug #19924.
> 
> A possible solution is in StartupFiles/zshenv. What do you think about this?
> 

Ok - sounds reasonable. :) So perhaps set this bug as a duplicate.

Thanks for your help and digging in old and moldy bugs :).
Comment 7 Torsten Veller (RETIRED) gentoo-dev 2008-03-17 10:21:24 UTC
I am closing it as dup now. Anyway thanks for this report as i had to read some old bugreports.

*** This bug has been marked as a duplicate of bug 19924 ***