Subject: Re: import/export of pkgsrc db for pkg_chk??
To: Greg Troxel <gdt@ir.bbn.com>
From: David Brownlee <abs@NetBSD.org>
List: tech-pkg
Date: 07/27/2004 11:07:29
On Mon, 26 Jul 2004, Greg Troxel wrote:

> I'd like to use pkg_chk to create and install binary packages on a lot
> of machines, and suspect I must be missing something.

 	What I tend to do:

 	Build binary packages on one machine, use
 	    'pkg_chk -l -U `hostname -s` -D $DESTHOST'
 	to build a complete list of desired destination packages,
 	copy them to the destination box and reinstall all.

 	Something like:

     if [ -x /usr/pkg/bin/bmake ] ; then
 	MAKE=bmake
     else
 	MAKE=make
     fi
     cd /pkgsrc/pkgtools/pkg_chk
     PKGBINDIR=$(${MAKE} show-var VARNAME=PACKAGES)/All
     cd $PKGBINDIR
     HOST=$(hostname -s)
     for h; do
         echo -n "$h: (determine list)"
         PKGLIST=$(pkg_chk -l -U $HOST -D $h)
         echo -n " (transfer)"
         pax -w $PKGLIST | ssh $h 'rm -rf pkg_update_packages && \
                         mkdir -p pkg_update_packages && \
                         cd pkg_update_packages && pax -r -pe && \
                         pkg_delete -r \* ; pkg_add * && \
                         cd .. && rm -rf pkg_update_packages && echo " Done"'
     done
     exit


-- 
 		David/absolute       -- www.NetBSD.org: No hype required --