From owner-freebsd-ports@FreeBSD.ORG Sat Jan 26 07:51:42 2008 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2947F16A418 for ; Sat, 26 Jan 2008 07:51:42 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with SMTP id D038C13C4F7 for ; Sat, 26 Jan 2008 07:51:41 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: (qmail 20965 invoked by uid 399); 26 Jan 2008 07:51:41 -0000 Received: from localhost (HELO ?192.168.0.4?) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTP; 26 Jan 2008 07:51:41 -0000 X-Originating-IP: 127.0.0.1 Message-ID: <479AE68A.2020701@FreeBSD.org> Date: Fri, 25 Jan 2008 23:51:38 -0800 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: c.mm@gmx.net References: <20080122151037.316850@gmx.net> In-Reply-To: <20080122151037.316850@gmx.net> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-ports@freebsd.org Subject: Re: create ports from list X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2008 07:51:42 -0000 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 `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