Subject: Re: More Update All
To: John Refling <>
From: Frederick Bruckman <>
List: tech-pkg
Date: 03/26/2000 00:06:20
On Sat, 25 Mar 2000, John Refling wrote:

> Why can't a few new targets be added to mk.bsd.pkg called
> something like "make tag_for_update" which will simply
> store the current package's directory (eg, print/tex) into
> a data base.  You would run this from any package which you
> want updated in the future.  You wouldn't want this flag
> recursively carried into the build of dependent packages,
> since dependancies for a package may change in the future.

The information's already in the database. Here's a way to get a list
of directories for all installed packages...

pkg_info -a | cut -f "1" -d " " | xargs pkg_info -b | grep Makefile |
cut -f "-2" -d "/" | sort

> Then, when you download a new pkgsrc.tar.gz from current,
> you would go to its root dir, and type
> "make update_all_tagged_for_update" which would simply enter
> each directory stored in the data base made above, and do a
> "make update" or whatever is appropriate.

You don't really want to update every single package every time you
update pkgsrc, do you? I'd typically only do that after I've upgraded
the system. Here's a way to get a list of directories for only
out-of-date packages:

lintpkgsrc -i | cut -f "3" -d " " | xargs pkg_info -b | grep Makefile |
cut -f "-2" -d "/" | sort
The only problem with this plan (and yours), is that some of the
original directories may no longer exist, as -current, -socks, -x11,
and etc. variations are eliminated, or if they exist, may not be the
desired ones. So you have to edit the list by hand before running the
update script over it.

Here's my latest bin/ script...

echo "---> $1"
cd /usr/pkgsrc/$1 && make update NOCLEAN= && \
rm -f work.`uname -p`/.DDIR work.`uname -p`/.DLIST

which is invoked simply with "cat LIST | xargs -n1 ~/bin/".
The "update" target takes care of the dependencies, sort of. You won't
go wrong as long as you manually put all the library packages at the
head of the LIST. It's more foolproof without the NOCLEAN, at the
expense of rebuilding some packages numerous times.