Subject: Re: pkgsrc update packages?
To: Jan Danielsson <jan.danielsson@gmail.com>
From: Christopher W. Richardson <cwr@nexthop.com>
List: netbsd-users
Date: 10/03/2005 18:13:11
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

"Jan Danielsson" <jan.danielsson@gmail.com> writes:

>    I'd like to write a script that automatically updates
> packages which are out of date. First part is easy, I just run
> "lintpkgsrc -i" to get a list of outdated packages, and
> possibly correlate it with the vuln.  list. Then I want to run
> "make update" for the affected packages.
>
>    The only step I don't know how to do is to convert the
> package name to a pkgsrc directory. I'd like to be able to do
> something like this:
>
> $ pkglookup openttd
> /home/pkgsrc/pkgsrc/games/openttd

I've been looking at this problem for quite a while, and there
are many, many issues with automatically updating packages with
make update (though it's still wonderfully useful in the one-off
case).  After suggestions from many people on the list, I've got
a functional script which I use in weekly.local to rebuild all
out-of-date packages (once per week, obviously).  In short, it
does

	linkpkgsrc -i
        pkgdepgraph -R
	{parse output of pkdepgraph into pkg_comp/default.conf}
        pkg_comp auto

Then all I have to do is issue a pkg_add -u -u for any packages
which I wish to update (which I suppose you could also automate,
but that scares me too much).  I've got it working quite smoothly
now, and if you'd like I'd be happy to paste the entire script
somewhere.

Cheers,
Chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (NetBSD)
Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/>

iD8DBQFDQazWP65RBOOHTzERAjYmAJ4iCXDXPku/HedwTv5ZQO1wOmXQpQCgpm5A
6DFrREJi2WzrDKJKOOwStrQ=
=WRGA
-----END PGP SIGNATURE-----