Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Ebuilds and Handling /etc/profile
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Demosthenex
n00b
n00b


Joined: 11 Sep 2002
Posts: 14
Location: Houston, TX

PostPosted: Tue Dec 31, 2002 9:30 pm    Post subject: Ebuilds and Handling /etc/profile Reply with quote

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
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Tue Dec 31, 2002 11:17 pm    Post subject: Reply with quote

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
View user's profile Send private message
Naan Yaar
Bodhisattva
Bodhisattva


Joined: 27 Jun 2002
Posts: 1549

PostPosted: Tue Dec 31, 2002 11:32 pm    Post subject: Reply with quote

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
View user's profile Send private message
Demosthenex
n00b
n00b


Joined: 11 Sep 2002
Posts: 14
Location: Houston, TX

PostPosted: Wed Jan 01, 2003 8:50 am    Post subject: Reply with quote

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
View user's profile Send private message
Naan Yaar
Bodhisattva
Bodhisattva


Joined: 27 Jun 2002
Posts: 1549

PostPosted: Wed Jan 01, 2003 2:04 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum