installing multiple copies of macports

Bradley Giesbrecht brad at pixilla.com
Sat Oct 23 09:43:41 PDT 2010


On Oct 22, 2010, at 11:55 AM, Marko Käning wrote:

> Section 2.3.4 (http://guide.macports.org/#installing.macports.source.multiple 
> ) of the manual explains how multiple macports installations can be  
> created, but I cannot see a hint as to how these have to be set up  
> in such a way that one can easily switch between these copies.
>
> I can imagine that some services might get started for a specific  
> macports installation, which would have to be shut down in some  
> controlled manner before the alternative installation can be put  
> into action.
>
> Anyone out there who has such a setup actually in place and could  
> give a hint?

I found interesting so I tried a couple things.

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.

Brad




More information about the macports-dev mailing list