From owner-freebsd-chat Sun Nov 17 6: 1:50 2002 Delivered-To: freebsd-chat@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B441537B401 for ; Sun, 17 Nov 2002 06:01:48 -0800 (PST) Received: from vcksi2.nw.wakwak.com (vcksi2.nw.wakwak.com [211.132.128.145]) by mx1.FreeBSD.org (Postfix) with SMTP id 4A2A543E4A for ; Sun, 17 Nov 2002 06:01:47 -0800 (PST) (envelope-from sada@BSDclub.org) Received: from bf.wakwak.com (bf.wakwak.com [211.132.128.101:25]) by vcksi2.nw.wakwak.com (Postfix) with ESMTP id AB8C34000A; Sun, 17 Nov 2002 23:01:40 +0900 (JST) Received: from BSDclub.org (sada.as.wakwak.ne.jp [61.115.78.20]) by bf.wakwak.com (8.12.6/8.12.6/2002-09-12) with SMTP id gAHE1csX094446; Sun, 17 Nov 2002 23:01:40 +0900 (JST) (envelope-from sada@BSDclub.org) Date: Sun, 17 Nov 2002 23:01:38 +0900 From: SADA Kenji To: Mike Jeays Cc: sada@BSDclub.org, freebsd-chat@FreeBSD.ORG Subject: Re: PKG-ADD suggestion Message-Id: <20021117230138.1c1e987d.sada@BSDclub.org> In-Reply-To: <3DD03FDF.5020302@rogers.com> References: <3DD03FDF.5020302@rogers.com> Organization: Private X-Mailer: Sylpheed version 0.8.5 (GTK+ 1.2.10; i386-portbld-freebsd4.7) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Mon, 11 Nov 2002 18:40:15 -0500 Mike Jeays wrote: > It would be useful if pkg_add had an option that made it store a > copy of the tarball on the local machine whenever it had to > fetch it with FTP. FYI: I wrote a simple script to fetch packages with dependencies. -- #!/bin/sh # ex:ts=4 FETCH_CMD=${FETCH_CMD:-fetch} if [ $# -eq 0 ]; then echo "usage: ${0##*/} URL_of_a_package [..]" exit 0; fi a_pkg () { base=${1%/*/*} pkg=${1##*/} if [ ! -e $pkg ]; then $FETCH_CMD $base/All/$pkg fi if [ -e $pkg ]; then for p in `tar xzfO ${pkg} '+CONTENTS'|grep '^@pkgdep'|awk '{printf("%s ",$2)}'`; do if [ ! -e $p.tgz ]; then a_pkg $base/All/$p.tgz fi done else echo "(XX) $pkg: couldn't be fetched." fi } for p in $*; do a_pkg $p done -- SADA Kenji To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-chat" in the body of the message