On Tue, Dec 12, 2006 at 07:29:45PM +0100, fv wrote: > >pkg_add -ui does what you want to do. (No, it doesn't go to ports, but > >you shouldn't, especially not if you must ask how to do this.) > > I just would like to maintain a local up-to-date package database > compiled from ports so i can dot periodicaly: > PKG_PATH=/usr/ports/packages/sparc64/All/ > pkg_add -ui > > It's like a bulk build, but only for packages installed on my box. > I don't why i should not do this as it's what is done on the openbsd > main site but for all packages...
Hmm, you're on a sparc. That changes things somewhat, as - IIRC - package updates are rather sporadic there. As to solutions and/or interesting options: - PKG_CACHE (pkg_add(8)) and FETCH_PACKAGES (bsd.port.mk(5)) - `make update' (ISTR that it was intended that this could be done in /usr/ports, but that it didn't actually work yet) - pkg_add via SSH - pkg_add via NFS For a simple scripted solution, something like for i in `pkg_info | sed -e 's/-[0-9].*//'`; do ...; done comes to mind. To do all hosts at once, use #/bin/sh TMP=`mktemp` || exit 1 ( for i in $HOSTS; do ssh $i pkg_info | sed -e 's/-[0-9].*//'`; done ) | sort | uniq > $TMP for i in `cat $TMP`; do cd /usr/ports/*/$i && make package; done Or a similar version with better error handling, possibly using something like tentakel or clusterit, and so on. (And remove the subshell if you are certain it isn't necessary; it isn't on ksh, but I'm not sure this extends to all Bourne shells.) Joachim