On 2010/09/04 04:55, Tobias Ulmer wrote:
> On Fri, Sep 03, 2010 at 09:23:48PM -0400, as...@spamcop.net wrote:
> > I notice that port executables seem to get significantly stale
> > quicker than I thought.  At least stuff stops fully working and
> > maybe I should try to rebuild the executables.
> > 
> > Now I do not know of a way for me to automatically rebuild ports
> > that I have previously installed and only those ports.  And I am not
> > inclined to do a true bulk build.
> > 
> > Now I tend to favor python and it would seem there is enough
> > information to write a program that would support that kind of
> > limited automatic rebuild.  Sort of thinking I might be able to look
> > at port tree make files and see where the executable would have gone
> > and see if the executable is actually there.  Keep it simple and
> > generate a script with a lot cd's and make's in it and then execute
> > it.

Trying to parse the Makefiles in anything other than make is going
to be, at best, fragile. The actual ports tools use make(1) to handle
the Makefiles and where necessary, dump output in a convenient
format (in particular "make dump-vars" is used often).

It would really make sense to use Perl so you can use the existing
functions to handle things where possible..

> > Does this seem like it would be of use to more than just myself?
> > Any thoughts about the right design and algorithm?  Or is there
> > already an obvious to a non-luser way to do this?
> 
> Usual disclaimer: Use packages, not ports.
> 
> 
> You probably want to look into the (poorly documented)
> SUBDIRLIST feature.
> 
> From memory:
> L=$(mktemp)
> pkg_info -a -P -q > $L
> make FORCE_UPDATE=Yes FETCH_PACKAGES=Yes SUBDIRLIST=$L update

Instead of this make line, you can try the line below, which will
run jobs in parallel, making better use of CPUs on multi-processor
machines.

/usr/ports/infrastructure/bin/dpb -u -P $L

In dpb's display, failed builds are listed under "E", there will be
an accompanying file in /usr/ports/logs/$ARCH/locks to clean if you
want to attempt building those again. See the manual for more; you'll
find it in /usr/ports/infrastructure/man, you can edit man.conf to
have it searched by default:

-_default       /usr/{share,X11R6,local}/man/
+_default       /usr/{share,X11R6,local,ports/infrastructure}/man/

> It sometimes blows up and you have to fix things manually, but hey...

Yes, some things won't build if an older version is installed,
deleting existing packages before building improves chances.
Or you can just try it, see what breaks and pkg_delete as needed.

Reply via email to