installing multiple copies of macports

Ryan Schmidt ryandesign at macports.org
Sun Oct 24 15:40:37 PDT 2010


On Oct 23, 2010, at 11:43, Bradley Giesbrecht wrote:

> I commented out the lines in ~/.profile that macports adds and added this.
> ~/.profile
> if [ -f ~/.macports/profile ]; then
>   . ~/.macports/profile
> fi
> 
> Then I created a macports profile file.
> ~/.macports/profile
> if [  "${OLDPATH}x" == "x" ]; then
>  export OLDPATH=$PATH
> fi
> if [  "${OLDMANPATH}x" == "x" ]; then
>  export OLDMANPATH=$MANPATH
> fi
> if [  "${PORTPREFIX}x" == "x" ]; then
>  export PORTPREFIX=/opt/local
> fi
> export PATH=~/bin:$PORTPREFIX/bin:$PORTPREFIX/sbin:$PORTPREFIX/apache2/bin:$OLDPATH
> export MANPATH=$PORTPREFIX/share/man:$OLDMANPATH
> 
> 
> Try this:
> $ PORTPREFIX=/opt.local2;source ~/.profile
> 
> 
> I am reminded of the recent thread where a user didn't like that macports modified PATH in .profile. This approach would not have solved all of the users complaints but it does make uninstall easier and you don't have to hunt through ~/.profile for things macports has or may in the future modify.

We already have such a script in MacPorts base which could be sourced by a bashrc. Unfortunately the work was never completed to update the installer to do that instead of munging the bashrc itself. And I've never tested the script to see if it works equivalently / correctly.

http://trac.macports.org/browser/trunk/base/setupenv.bash.in




More information about the macports-dev mailing list