On Tue, Feb 03, 2009 at 05:57:39PM +0100, Hannah Schroeter wrote:
> Hi!
> 
> On Mon, Feb 02, 2009 at 08:00:21PM +0100, Marc Espie wrote:
> >On Mon, Feb 02, 2009 at 02:02:59PM +0100, Hannah Schroeter wrote:
> >> On Sun, Feb 01, 2009 at 02:01:03PM +0100, Dorian B|ttner wrote:
> >> >is there an easy way to fetch a package along with it's recursive 
> >> >dependencies? Scenario is:
> >> >eee904ha does not have network access at all right now. In order to 
> >> >proceed installing useful things, let's say firefox, I'd like to suck 
> >> >packages onto a usb stick and installl from there.
> >> >I thought I could go to the soekris box, which unfortunately isn't that 
> >> >-current, and do something like pkg_add -n mozilla -firefox,  but the 
> >> >output is totally garbled with libc mismatches and things like that.
> 
> >> >Any idea?
> 
> >> I'd think using a net connected box, setting PKG_CACHE and PKG_PATH and
> >> then pkg_add -n <package_you_want>. The required packages should end up
> >> in the PKG_CACHE directory. From there you should be able to transfer
> >> them over to the eeepc. If the soekris isn't current, you could try this
> >> in a chroot environment or a virtual machine (e.g. qemu) setup.
> 
> >Yep, that's the intent.
> >PKG_CACHE + pkg_add -n will do it.
> 
> There's perhaps one thing we've missed: If some dependency package is
> already installed (and current enough) on the "source" host, pkg_add -n
> will probably not refetch it, so it will end up missing in the PKG_CACHE,
> i.e. on the "destination" host. The playing with the signature trick
> will avoid that, probably. Or perhaps one would need another option to
> pkg_add (or a different, pkg_fetch or similar, frontend to the pkg_*
> toolchain) to fetch *all* dependency packages.
Nope, you can easily tell pkg_add to look elsewhere for installed packages,
first starting with a pseudo-virgin install: use PKG_DBDIR.

The "simple use case" is the one where you install one box on the net,
then want to duplicate: you simply set PKG_CACHE before the install,
and then... it works.

With -current, you can also use pkg_create after the installation to recreate
all the binary packages from the installed files (older pkg_add did not keep
DEINSTALL scripts, this is no longer an issue at all).

Something like
for i in /var/db/pkg/*/+CONTENTS
do
    pkg_create -f $i
done
should recreate all your installed packages.

Reply via email to