Subject: Package Pain Prevention Procedure
To: None <>
From: Bernhard Riedel <>
List: tech-pkg
Date: 09/06/2004 01:41:49
Hi folks!

I build packages from source, on my main box I have ~470 packages.
Every now and then, I do a cvs update on my pkgsrc tree.
After finding out which packages were updated ("pkg_chk -c" or
 "cd /usr/pkgsrc ; make show-downlevel") I did "make update"
 in each one of the affected package directories.
Often I ended up rebuilding gimp, mozilla or other elephants many
 times in a row.
One weekend, I rebuilt gimp 7 times. This was painful, my hardware
 isn't particularly fast;)
After years of suffering, I found an easy improvement.

1) Select a small "loner package" L so that
   a) L doesn't depend on any other package
   b) no other package depends on L
   Here I will use sysutils/socket.

2) Make sure that L is installed.
   # cd .../pkgsrc/sysutils/socket
   # make update

3) Make a list of outdated packages, one on each line.
   If you use pkg_chk, you could do this:
   # pkg_chk -c | sed -ne '/^.*: version mismatch - /s///p' >/tmp/blah.lst

4) Trick pkgsrc into believing that all these packages depend on our loner.
   # cp /tmp/blah.lst /var/db/pkg/socket-1.1/+REQUIRED_BY

5) Now the fun starts. *drum roll*.
   # cd .../pkgsrc/sysutils/socket
   # make update
   pkgsrc will automagically update all obsolete packages in the list
   and all packages that depend on them.
   pkgsrc won't record dependencies on our fake package.
   It will even detect that our +REQUIRED_BY was a fake, so
   /var/db/pkg/socket-1.1/+REQUIRED_BY will disappear.

6) Clean up.
   # cd .../pkgsrc
   # make clean

It is kind of a hack... but it seems to work nicely for me.

Cheers, Burnhard.