Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Jan 2008 23:51:38 -0800
From:      Doug Barton <dougb@FreeBSD.org>
To:        c.mm@gmx.net
Cc:        freebsd-ports@freebsd.org
Subject:   Re: create ports from list
Message-ID:  <479AE68A.2020701@FreeBSD.org>
In-Reply-To: <20080122151037.316850@gmx.net>
References:  <20080122151037.316850@gmx.net>

next in thread | previous in thread | raw e-mail | index | archive | help
c.mm@gmx.net wrote:
> Hello,
> 
> I have a server with round about 200 installed Ports. I need
> to setup a second server with the same, but slightly newer,
> ports recompiled from source.
> 
> Is there an easy way to crate a port list with compile options
> and feed a build command on the second server with it?

You've had a few responses to this already, but I think each missed a 
piece of the puzzle. The suggestion to use portmaster -l to generate a 
list is a good one, but I'm biased of course. :) So, install 
ports-mgmt/portmaster, then do 'portmaster -l > ~/port-list'. Then edit 
that file to remove the headers, and the trunk and branch ports.

Now for the key step. On the new server, assuming that it has no ports 
installed at all, you'll need to know what port directories to install 
from, not the names of the installed ports from the first server. So, 
you'll want to do something like this:

while read port; do
grep ' ORIGIN' /var/db/$port/+CONTENTS | cut -f 2 -d ':'
done > ~/port-origin-list

Then if it were me on the new server I would download all the distfiles 
first (copy over any current ones from the old server, then):
while read orig; do
portmaster -F $orig
done < port-origin-list

This would have the additional benefit of running through the OPTIONS 
dialogs so that you can choose the options you want. Then:

while read orig; do
portmaster -Dt $orig
done < port-origin-list

You could also concatenate the list of ports onto one long line, 
separated by spaces, and do 'portmaster <options> `cat list` which would 
use one parent process to run all the configs, then all the builds, so 
you could do it (hopefully) "unattended" after it starts building. 
(Where "unattended" assumes that no builds fail.) This has the benefit 
of caching all the dependency data, so once something is up to date it 
doesn't have to be checked again.

As for the configure options, you can copy /var/db/ports and 
/etc/make.conf (and/or /usr/local/etc/ports.conf if it exists) from the 
existing server to the new one. That way portmaster will only prompt you 
during the 'make config' phase if there are new options to choose.

Now, all that said, if the two systems have similar architectures you 
could just do 'portmaster -a' on the first one, and then do:

for pkg in /var/db/pkg/*; do
pkg_create -b $pkg
done

and install all your shiny new packages on the new system.

hope this helps,

Doug

-- 

     This .signature sanitized for your protection



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?479AE68A.2020701>