View previous topic :: View next topic |
Author |
Message |
Demosthenex n00b
Joined: 11 Sep 2002 Posts: 14 Location: Houston, TX
|
Posted: Tue Dec 31, 2002 9:30 pm Post subject: Ebuilds and Handling /etc/profile |
|
|
What is the best way to handle modifications to /etc/profile from an ebuild?
I'm creating an ebuild that absolutely must add a few lines to /etc/profile, but not just environment variables. That rules out /etc/env.d/.
Just tacking on lines at the end is, well, tacky! Not to mention hard to remove at a later date (ie. unmerge or upgrade).
Shouldn't there be something like env.d for profile, or better yet, let env.d be standard shell scripts instead of lists of environment variables?
Comments/suggestions/ideas?
Demo |
|
Back to top |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20067
|
Posted: Tue Dec 31, 2002 11:17 pm Post subject: |
|
|
What is it you are trying to do? That might help for possible solutions.
What is relying on something that needs to change it? Seems odd. _________________ Quis separabit? Quo animo? |
|
Back to top |
|
|
Naan Yaar Bodhisattva
Joined: 27 Jun 2002 Posts: 1549
|
Posted: Tue Dec 31, 2002 11:32 pm Post subject: |
|
|
bash-completion does this instead:
Quote: |
* Add the following line to your ~/.bashrc to
* activate completion support in your bash:
* [ -f /etc/profile.d/bash-completion ] && source /etc/profile.d/bash-completion
|
You can put your code in profile.d and have the user source it. |
|
Back to top |
|
|
Demosthenex n00b
Joined: 11 Sep 2002 Posts: 14 Location: Houston, TX
|
Posted: Wed Jan 01, 2003 8:50 am Post subject: |
|
|
I'm propogating some of my shell aliases and some environment variables that should be for root only across multiple Gentoo boxes.
ie: if [ ${UID} = 0 ] then export ...
I want to use portage for change management and syncronization.
I like the idea of /etc/profile.d, but if nothing else calls it then I'm just polluting /etc... Plus the point of altering the system profile is to prevent having to fuss with individual user profiles.
Obviously I don't like the idea of directly editing the files for change management reasons.
Further suggestions?
Demo |
|
Back to top |
|
|
Naan Yaar Bodhisattva
Joined: 27 Jun 2002 Posts: 1549
|
Posted: Wed Jan 01, 2003 2:04 pm Post subject: |
|
|
profile.d is already used by bash-completions and medusa; so there is some precedence for putting it in there. Unfortunately, there is no mechanism in /etc/profile in gentoo to source things in profile.d (RedHat has this); this bug tracks the issue.
Demosthenex wrote: | ...
I like the idea of /etc/profile.d, but if nothing else calls it then I'm just polluting /etc...
|
|
|
Back to top |
|
|
|