Setting up multiple MacPorts copies on one machine

Blair Zajac blair at orcaware.com
Wed Apr 22 08:24:30 PDT 2009


On Apr 22, 2009, at 1:31 AM, Bryan Blackburn wrote:

> On Wed, Apr 22, 2009 at 09:11:58AM +0200, Rainer Müller said:
>> David Bruce wrote:
>>> My question is how people make this simple to manage.   Is there an
>>> established way to set up aliases, paths, etc? I want to be sure  
>>> that
>>> if I type "sudo port", I run the default macports copy, and have a
>>> function or alias (say "sudo tuxport") that gives me "port" from my
>>> non-default installation.
>>
>> To be really sure, just use the full path to the port binary.  
>> Otherwise
>> a alias should do fine, but note that shell aliases will not work  
>> with
>> sudo. You would have to create a symlink.
>
> What I do is use aliases for those installs which are owned by me, and
> basically work like:
>
>
> basepath="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11/bin"
> alias port-1.7="/usr/bin/env PATH=/Users/blb/MacPorts/mp-1.7/bin:$ 
> {basepath} port"
> alias port-test="/usr/bin/env PATH=/Users/blb/MacPorts/mp-test/bin:$ 
> {basepath} port"
> ...
> unset basepath
>
>
> This way PATH does not even know about any other installs; note that  
> by
> default my PATH has the location of my primary install which is root- 
> owned.
>
> For those which are root-owned, I use a shell script wrapper around  
> the
> alias idea, and adding $*.
>
> Using the actual software installed by port into these various  
> alternate
> locations is left as an exercise.

I have a file I keep in the MacPorts install I just source:

bash-3.2# cat /opt/local-development/source.sh
export PATH=/opt/local-development/bin:/usr/bin:/usr/bin/cyrus:/usr/ 
X11/bin:/usr/X11R6/bin:/bin:/usr/sbin:/sbin:/etc:/usr/local/bin

Blair

-- 
Blair Zajac, Ph.D.
CTO, OrcaWare Technologies
<blair at orcaware.com>
Subversion training, consulting and support
http://www.orcaware.com/svn/




More information about the macports-dev mailing list