[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-chat
Subject:    Re: PKG-ADD suggestion
From:       SADA Kenji <sada () BSDclub ! org>
Date:       2002-11-17 14:01:38
[Download RAW message or body]

On Mon, 11 Nov 2002 18:40:15 -0500
Mike Jeays <Mike.Jeays@rogers.com> 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
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic