Subject: Re: minor improvements in bulk build
To: Jan Schaumann <jschauma@netmeister.org>
From: Roland Illig <rillig@NetBSD.org>
List: tech-pkg
Date: 11/20/2006 00:01:24
Jan Schaumann wrote:
> Hi,
> 
> Does that look ok?  I haven't completed a bulk-build with this patch
> yet, but I do have one running, and it hasn't bailed out yet. ;-)
> 
> ... ${FIND} . -type f -newer ... -name ./work -or ...

You should write

     find ! \( -name "work*" -or ... \)

instead. The ''name'' is only the basename, so it won't ever include a 
slash. Also, on my machine, the working directory is called work.bacc, 
not work alone.

> nnewfiles="`echo ${newfiles} | ${WC} -w`"

You can easily support white-space in filenames by writing

     nnewfiles=`${ECHO} "$$newfiles" | ${WC} -w`

1. There are implicit double quotes in shell variable assignments.
2. I used $$newfiles instead of ${newfiles}, as you probably
    meant the shell variable, not the make(1) variable.

> ${FIND} ${PKG_DBDIR} -maxdepth 1 -type d ! -name '.' -print

This won't work on IRIX and some other platforms:

$ /usr/bin/find . -maxdepth 3
-maxdepth: bad option
Usage: find path-list predicate-list

Roland