SHELL environment variable

Ryan Schmidt ryandesign at macports.org
Sat Sep 12 15:37:28 PDT 2009


On Sep 12, 2009, at 17:26, Matthew Cottrell wrote:

>>> I'd like to add some post-activate code to a Portfile that would  
>>> amend PATH in a .cshrc or .profile, depending on which shell the  
>>> user is running.
>>
>> Instead of doing that, just print instructions advising the user  
>> what to do.
>
> The Portfile currently prompts the user as you suggest, but I still  
> get email from novices who stumble.  I figure I'd be doing them and  
> myself a favor.
>
>> It's not customary for ports to modify files in a user's home  
>> directory.
>
> I actually got the idea from the modification to PATH that appeared  
> in my .cshrc when I installed MacPorts ;-)

Yeah... MacPorts does break its own rule a bit there.

Part of the problem is the user might change his shell later, or one  
user might be installing software on a Mac for use by multiple users.  
I concede the former is perhaps not very likely. For the latter, the  
user needs to be aware that software will not "just work" for those  
other users -- that something needs to be added to e.g. the .profile  
for it to work.


> ui_msg "
> 1)
> **************************************************************************
> bash-users add the following lines to your ~/.profile or to your  
> ~/.bashrc
> **************************************************************************
>      ARBHOME=${prefix}/share/arb;export ARBHOME
>      PATH=${prefix}/share/arb/bin:\$PATH
>      export PATH
>
>      enter the following command:
>      . ~/.profile
> 2)
> **************************************************
> tcsh users add the following lines to your ~/.cshrc
> **************************************************
>      setenv ARBHOME ${prefix}/share/arb
>      setenv PATH ${prefix}/share/arb\:\$PATH
>
>      enter the following command:
>      source ~/.cshrc
> "
> }

First thought: are these really necessary? Is there some way the  
software could be installed so that the user need not manually set  
these? For example, for the wine port, it wouldn't run right unless  
DYLD_LIBRARY_PATH was set; to avoid requiring the user to set this  
manually, I wrote a wrapper script so the user never knows. Read the  
wine port for more info.

Second thought: if manual setup is the only way, put the setup into a  
script the user can source from their .profile and install it along  
with the port. This condenses your instructions down to a single line  
change to the .profile to source your file; hopefully users will be  
able to grasp that.


P.S: Don't forget to Reply All so your reply goes to the list too, not  
just to me.





More information about the macports-dev mailing list