From owner-freebsd-questions@FreeBSD.ORG Wed Aug 27 03:16:05 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E47BE106564A for ; Wed, 27 Aug 2008 03:16:05 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) by mx1.freebsd.org (Postfix) with ESMTP id 5F4D78FC1E for ; Wed, 27 Aug 2008 03:16:05 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r55.edvax.de (port-92-195-48-195.dynamic.qsc.de [92.195.48.195]) by mx01.qsc.de (Postfix) with ESMTP id 00A9A50AC4; Wed, 27 Aug 2008 05:16:03 +0200 (CEST) Received: from r55.edvax.de (localhost [127.0.0.1]) by r55.edvax.de (8.14.2/8.14.2) with SMTP id m7R3G2Vg002075; Wed, 27 Aug 2008 05:16:03 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Wed, 27 Aug 2008 05:16:02 +0200 From: Polytropon To: Manolis Kiagias Message-Id: <20080827051602.d26c784d.freebsd@edvax.de> In-Reply-To: <48AB4B0A.7090900@gmail.com> References: <20080819181714.fb9d5ea1.freebsd@edvax.de> <48AB2051.2020303@gmail.com> <20080819235050.7341a5f3.freebsd@edvax.de> <48AB4B0A.7090900@gmail.com> Organization: EDVAX X-Mailer: Sylpheed 2.4.7 (GTK+ 2.12.1; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: "freebsd-questions@freebsd.org" Subject: Re: Fetching precompiled packages for external install X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Aug 2008 03:16:06 -0000 I'm not sure if I've given a reply, so this might be a double post. :-) On Wed, 20 Aug 2008 01:36:58 +0300, Manolis Kiagias wrote: > It doesn't have to be done through ports, you can still get the packages > using pkg_add -r and then recreate them using pkg_create -Rb. Side > effect is the packages will be installed on the download machine, and > that may not be what you want. Exactly. If I would have wanted that, my choice would be the tradidtional way to use portinstall with its -p option, similar to "make package" from a port's directory. > But you could probably use a jail to > avoid this. That sounds complicated... But many thanks for your ideas, I found a way to achieve my goad. As you will see, the solution is VERY ugly, but it seems to work. It's a simple script that first downloads the requested package, then the dependencies it needs are filtered out of the -v messages of pkg_add. Afterwards, the script is called recursively on these packages, to do exactly the same as with the requested package. Here it is: #!/bin/sh # # getpkg.sh 2008-08-19 # # fetch a precompiled package as well as it dependencies # for further installation if [ "$1" = "" ]; then echo "$0 " exit 1 fi echo -n "fetching $1 ... " if [ -f $1.tbz ]; then echo "$1.tbz already there" exit 1 fi pkg_add -fKnrv $1 > $1.txt 2>&1 echo "done" for DEP in `cat $1.txt | grep $1 | grep "depends on" | cut -d "'" -f 6 | cut -d "/" -f 2`; do echo "dependency for $1 is ${DEP}" $0 ${DEP} done rm $1.txt exit 0 One problem that might occur: Do the depencency packages need to include version numbering? The downloaded packages do not have a version in their name. I will check if it works, or if the versions need to be in the package file name. -- Polytropon >From Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...