env_helper

Bradley Giesbrecht brad at pixilla.com
Sun Mar 15 14:26:47 PDT 2009


On Mar 15, 2009, at 1:28 PM, Bradley Giesbrecht wrote:

> I have modeled an env setup script after the one apple supplies at / 
> usr/libexec/path_helper which is evaluated by /etc/profile.
>
> My idea is to add a line like this at the top of ones .profile file.
> eval `/opt/local/libexec/env_helper`
>
> I don't know if this list allows file attachments so if the tar file  
> is not attached I will upload it somewhere and send another email  
> with a link.
> If I should open a trac ticket someone tell me to and I will.
>
> I was thinking this might be a nice way to allow ports to modify the  
> users env in a managed fashion. They can drop their env files in the  
> proper place and they will be automatically added to the users env.
>
> Also, since the files would be registered to the port if the port is  
> deactivated the files can be removed.
>
> I was thinking of making this as a port (env_helper or macports_env)  
> that other ports could use or if people thought it useful adding it  
> directly to macports.
>
> I started with just path vars and only bash at this point but  
> looking at /usr/libexc/path_helper it shouldn't be difficult to add  
> support for other shells.
>
> I'm simply naming the files the same as the env var and looping over  
> the directory.
>
>
> //Brad

I modified /opt/local/libexec/env_helper to evaluate the paths so $ 
{PREFIX} can be used in the conf files. This would not NEED to be done  
because any installer could create the path properly but it does  
remove that necessary step.

//Brad 


More information about the macports-dev mailing list