Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Provide standard file for sourcing environment variables #6828

Closed
kurtharriger opened this issue Aug 4, 2011 · 8 comments
Closed

Provide standard file for sourcing environment variables #6828

kurtharriger opened this issue Aug 4, 2011 · 8 comments
Labels

Comments

@kurtharriger
Copy link

When installing some packages, such as groovy, it suggests that you setup additional environment variables.

==> Caveats
You should set the environment variable GROOVY_HOME to
/Users/kurtharriger/local/homebrew/Cellar/groovy/1.8.1/libexec

/Users/kurtharriger/local/homebrew/Cellar/groovy/1.8.1/libexec

It would be great if I could add one line to my profile to setup configure all homebrew recipes such as:
HOMEBREW_HOME=~/local/homebrew
source $HOMEBREW_HOME/etc/environment

This script could add homebrew to my path and source additional scripts from each installed recipe to define these environment variables for me, then I wont forget to add them and/or remove them.

@Zearin
Copy link
Sponsor Contributor

Zearin commented Aug 12, 2011

Awesome idea!

+1!

@adamv
Copy link
Contributor

adamv commented Nov 27, 2011

@jacknagel @Sharpie - my preference on this one is "no", since it adds complexity vs. users manually editing shell profiles.

But I'm open to suggestion, since we are slowly increasing brew's complexity.

@Sharpie
Copy link
Contributor

Sharpie commented Nov 27, 2011

But I'm open to suggestion, since we are slowly increasing brew's complexity.

Same here. I'm a "no" vote unless someone presents a simple system that cleans up after its self when uninstalling.

@adamv adamv closed this as completed Nov 27, 2011
@jacknagel
Copy link
Contributor

"no" as well, seems like more trouble than it is worth. Editing config files is simple enough.

@kurtharriger
Copy link
Author

Because its complex we should make the user do it instead of the tool and make the user remember to do the cleanup after removal... Sounds backwards to me. Should read because its complex we should automate this stuff so the user doesnt even need to think about it.
Honestly though i dont think this is complex. The way I do this in my own .profile is to create a .profile.d folder and source every file in that folder. The same could be done here each recipe can create a link in homebrew/etc/env.d and the environment script would simply source each file in that folder. It doesnt need to be perfect, if the user wants more control of the process they can choose not to source the environment script and continue to do things manually. If these are just links homebrew can check for and remove broken links after removing a recipe.

@jacknagel
Copy link
Contributor

"Patches welcome." :)

@kurtharriger
Copy link
Author

Fair enough.

@Sharpie
Copy link
Contributor

Sharpie commented Nov 27, 2011

Because its complex we should make the user do it instead of the tool and make the user remember to do the cleanup after removal... Sounds backwards to me. Should read because its complex we should automate this stuff so the user doesnt even need to think about it.

Not exactly. Because it is so complex, we're not willing to risk putting Homebrew into a half-broken state and increase our maintenance burden.

We would be willing to look at a good patch though.

@Homebrew Homebrew locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants