Hi Dorian,

Dorian Buettner wrote on Sun, Feb 01, 2009 at 02:01:03PM +0100:

> 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?

Commands like 

  schwa...@gini $ uname -a
  OpenBSD gini.usta.de 4.4 GENERIC#107 i386
  schwa...@gini $ pkg_info -S ftp://ftp.fu-berlin.de/unix/ \
    OpenBSD/4.2/packages/alpha/mozilla-firefox-2.0.0.6.tgz

  [...]
  Signature: mozilla-firefox-2.0.0.6,X11.10.0,Xau.9.0,Xcursor.4.0,
    Xdmcp.9.0,Xext.10.0,Xfixes.5.0,Xft.7.0,Xi.10.0,Xinerama.5.0,
    Xrandr.6.0,Xrender.5.0,Xt.10.0,atk-1.0.1809.1,c.41.0,cairo.7.0,
    esound-0.2.34p0v0,expat.8.0,fontconfig.5.1,freetype.14.0,
    gdk-x11-2.0.1000.13,gdk_pixbuf-2.0.1000.13,gettext-0.14.6p0,
    glib-2.0.1200.12,glitz.2.0,gmodule-2.0.1200.12,gobject-2.0.1200.12,
    gtk+2-2.10.13,gtk-x11-2.0.1000.13,iconv.4.0,intl.3.0,jpeg.62.0,
    libiconv-1.9.2p3,m.2.3,nspr-4.6.7,nspr4.19.0,nss-3.11.7,nss3.20.0,
    pango-1.0.1300.1,pangocairo-1.0.1300.1,pangoft2-1.0.1300.1,
    pangox-1.0.1300.1,plc4.19.0,plds4.19.0,png.5.2,pthread.8.0,
    smime3.20.0,softokn3.20.0,ssl3.20.0,stdc++.42.0,z.4.1

often happen to work cross-platform and cross-release.
>From the signature, you can extract the dependencies
in order to fetch them via ftp.
This is easily scriptable; when parsing the signature,
split at commas and discard everything not containing a dash.

That way,
 - The machine having net access need not be the same arch as the target.
 - The machine having net access need not be the same release as the target.
 - You need not install any ports tree anywhere.
 - You get all (recursive) deps with one command.
 - For finding the dependencies, pkg_info does not even need to
   download full packages, but just the beginning of the package.

Of course, caching with pkg_add -n would be even more convenient.
In fact, i'm currently running a patched version of pkg_add allowing
pkg_add -nn with roughly the following semantics:
 - like pkg_add -n, don't change the system
 - do resolve dependencies, download and cache all required packages
 - but do not attempt even a fake extract and install stage

This sounds easier to implement than it is, being somewhat at odds
with the general logic of Marc's pkg tools.  Consequently, my patches
are very ugly and definitely need a lot of cleaning up before showing
them to anybody.  Besides, i didn't look at cross-arch download yet.

Yours,
  Ingo

P.S.
What the heck are you going to do with firefox on a box lacking
network access?

Reply via email to