Hello,

Is there a way to do multiple queries at once using pkg_info?
Something like:

pkg_info -Q query1 query2 ...

The best I've found so far is to do something like:

for q in query1 query2 ...; do pkg_info -Q $q; done

which is slow when the list of queries is long (my network bandwidth is not
what I would like it to be...)


Background: I'm running 6.5-release and would like to upgrade to
6.6-release by doing an offline upgrade, downloading the base system and
packages in advance at work to do the upgrade offline later at home (where
my network bandwidth is even worse than at work).  So for packages I would
like to do something like this, in a script (with the hope that package
dependencies have not changed too much between 6.5 and 6.6):

export PKG_PATH=.../6.6/packages/...
pkg_info -z | xargs pkg_info -q -Q | while read p; do wget $PKG_PATH/$p.tgz; 
done

(or even better: pkg_info -z | pkg_info -q -Q | while ...)


Note: I also tried to combine pkg_info with pkg_add:

export PKG_PATH=.../6.6/packages/...
export PKG_CACHE=...
pkg_info -mz > pkglist
pkg_add -n -l pkglist

but:
1) pkg_add only downloads into $PKG_CACHE the packages listed in the
pkglist file, not the dependencies;
2) pkg_add deletes each package it downloads after the download is
finished.

Is there some magic combination of options that I can use with pkg_add to
make it download and keep all the packages listed in the pkglist file, plus
all the required dependencies?

(being able to do: pkg_info -mz | pkg_add -n -l
would be nice too!)

Thanks,

Philippe


Reply via email to