# Upgrade a single port



## glenn (May 7, 2009)

Hi,

We have a main build server, where we build our packages, and push them to the rest of our servers.  Since this is a production system, we don't want to upgrade the whole ports tree, as we're concerned new ports and packages built against the tree may cause errors with our own custom packages.

Is there a way to maintain multiple ports trees on a single machine?  Or can you upgrade a single port to a new version at a time?

Thanks,
Glenn


----------



## DutchDaemon (May 8, 2009)

Sounds like it's jail(8) for you ..


----------



## glenn (May 8, 2009)

...or is it possible to have multiple ports trees on the same system?


----------



## DutchDaemon (May 8, 2009)

A lot of stuff is hard-wired to /usr/ports, but you could maintain several ports trees (/server1/usr/ports, /server2/usr/ports, /server3/usr/ports) and mount them on /usr/ports if you want to work with a particular one, I guess. You may have to have several /var/db/ports and /var/db/pkg directories for that as well, using the same methodology. Some scripting should be able to take care of the switching. Just a thought. Having said that, there are plenty of people who have just what you want done with jails. Search around on the forums.


----------



## kamikaze (May 8, 2009)

I think you just have to use *PORTSDIR* to define which tree you're using and you can use as many as you want (for make). Other tools might require a parameter to change this, e.g. [cmd=portmaster]-p[/cmd].


----------



## Mel_Flynn (May 9, 2009)

glenn said:
			
		

> Hi,
> 
> We have a main build server, where we build our packages, and push them to the rest of our servers.  Since this is a production system, we don't want to upgrade the whole ports tree, as we're concerned new ports and packages built against the tree may cause errors with our own custom packages.


Updating parts of the ports tree will lead to hard to debug problems, as *_DEPENDS may reference new library versions, non existing ports, new files installed by a new version of a port not to mention changes in port infrastructure.
You need to be very familiar with the ports system to be able to handle that.

It is far more productive to keep your ports tree up-to-date, deploy and test an upgraded port on a test machine and then trickle to production.

Look into using -K option for pkg_add(1) on your production machines, so you have "known working versions" available, in case the upgraded port has performance issues that you could not discover on your test machine.


----------



## glenn (May 13, 2009)

Thanks for the info guys.

I think I'm looking at the multiple ports trees option.  This will allow us to maintain our production level releases while testing new ports.


----------

