Please add if [ -e "/etc/profile.local" ] then source /etc/profile.local fi somewhere to /etc/profile to be able to have some settings, aliases, etc. that not get overwritten by portage. -Markus-
If you try adding a file with your settings to /etc/env.d and then running env-update you will find /etc/profile.env has your settings.... does this meet your need?
No, because I do not only have environment vars but also some aliases. Furthermore I want some settings only for root with "if [ whoami .. ]". I know I can also set this kind of settings in ~/.bash_profile, but I (and I think others too) find it convenient to have some settings for all users in one file. So it is not a *must* feature but a *would-be-nice-to-have* feature, and I think it doesn't get in the way because if you don't have a need for a /etc/profile.local then simply don't make one. -Markus-
This profile.local is nice but there is something better: # Source profile scripts for i in /etc/profile.d/*.sh ; do if [ -x $i ]; then . $i fi done Then create a dir /etc/profile.d/ and put there your .sh scripts and make them executable. BTW, that's the way Mandrake and Redhat do it.
Solution from Andreas Simon is the best in my opinion up to date. It also fits in nicely with our /etc/env.d/ and /etc/modules.d/ schemes.
Lets maybe just think about this again. I nearly never have a generic /etc/profile, but add whatever to it. Generally you should not need to worry about it being replaced. This is the whole idea behind the ._cfg* files ... you can have your own config without worrying that the package management system will loose your changes. If it does get fried with baselayout releases, it could be a bug in portage that we need to fix. Also have a look at etc-update in app-admin/gentoolkit for a easy way to update ._cfg* files.
If I rethink the whole thing, I think the only reason I asked for this "feature" is because I'm used to it from other (old-fashioned) distros. But as you stated, there isn't really a need for this as the config protection should take care of my personal settings in /etc/profile and makes profile.local obsolete. Thanks for enlightenment ;) -Markus-