script for recursively force-installing netbsd packages

what?

a perl script which installs a netbsd package, automatically blowing away any older/conflicting packages that might be in the way, and optionally (with -r option) recursively descending through any dependencies which might themselves first need to be upgraded.

why?

i tried to upgrade gnome on my netbsd box, and got mired in tons of recursively-dependent and conflicting packages. amazingly, there is no "pkg_upgrade" program in netbsd. augh. a script was called for. this script upgraded gnome from the netbsd 1.5.1 distribution to the 1.6 distribution in about 20 minutes.

status

  • alpha. it works for me. in fact, even though this uses perl, i used it to upgrade perl itself, and, the script just worked. i find that amazing... but scary. more testing needed.

    to install:

  • download the script
  • be root (duh)
  • make a complete system backup (double duh)
  • make sure your PKG_PATH is set, and that you have all the packages you'll need in one big directory, and that you've changed to that working directory. you could probably do this with the package cd-rom's, but i found it easier to just copy all the packages from the cd images, into one big directory on a large file server, and then nfs-mount it from my netbsd box. YMMV.
  • try forceupgrade.pl with the -dv option, which just shows you what it WOULD do in great detail, without actually doing it. note that -r and -d aren't a good combination.
  • take a deep breath and go for it, without the -d option. note that the -r option will handle recursive dependencies: for a huge suite of packages with a vast web of dependencies-- like gnome--, this is what you want.
  • you might need to go in there and manually upgrade a few things later on. i didn't, but it's possible if for example the package maintainer missed something. for gnome, i didn't have any post-install problems: everything just worked.

    bugs

  • hey, it ain't apt-get, but it's as close as i'm gonna get on netbsd ;-)
  • i have no idea if there already is a tool in netbsd to do what i wanted. however, i looked, didn't find anything, and this worked for me.

    to do

  • clean up its output
  • hack the actual pkg_add c sourcecode itself, and add this algorithm in there. (yeah, right)

    licensing

    BSD-style license