Subject: Re: make: only read first makefile found via path
To: Simon J. Gerraty <sjg@crufty.net>
From: James Chacon <jmc@netbsd.org>
List: tech-toolchain
Date: 04/12/2006 12:11:34
On Tue, Apr 11, 2006 at 11:17:27AM -0700, Simon J. Gerraty wrote:
> Ok the following behavior has existed since rev 1.1 in our repository.
>
> ln = Lst_Find(sysMkPath, (ClientData)NULL, ReadMakefile);
>
> uses Lst_FindFrom to call ReadMakefile to tell it when it has found
> the correct node - ReadMakefile is treated as a compare function and
> is expected to return 0 on a match.
>
> Yet ReadMakefile returns TRUE if it successfully reads the makefile.
>
> This means that if there are several dirs in MAKESYSPATH that each
> contain a sys.mk, then each one will be read by our make.
> Normally this is just a waste of effort, but it apparently causes
> grief for pkgsrc.
>
> I can't find any indication that the above is more than a simple
> miss-match of expectations, that simply goes unnoticed in normal
> usage.
>
> The patch below makes ReadMakefile return 0 on success and -1 on
> failure, to better match the expectations of Lst_Find.
> It also now matches its prototype ;-)
Looks sane to me. Commit
James