Makeing fetchindex really mirror INDEX

Simon L. Nielsen simon at nitro.dk
Mon Jan 17 16:18:26 PST 2005


[Sorry for the delay]

On 2005.01.09 18:59:48 +0100, Alexander Leidinger wrote:
> On Sun, 9 Jan 2005 18:02:20 +0100
> "Simon L. Nielsen" <simon at FreeBSD.org> wrote:
> 
> > Mainly because we already have a ${INDEXFILE} target, and the two
> > would conflict, so I thought it would be simpler to keep the simple
> > target.
> > 
> > make index in your patch only works because you don't define
> > ${INDEXFILE} as ${.CURDIR}/${INDEXFILE}, which it should be since
> 
> Correct.
> 
> > there might be a object directory.  At least as I read it, I could be
> > wrong.
> 
> At the time I wrote the first implementation of "fetchindex" it was
> supposed to be run at the time as "update". So the PORTSDIR has to be
> writable (except I've overlooked something). If this hasn't changed,
> there's no need for .CURDIR.

You could (in theory) have a object directory and still use a
writeable "source" directory (ie. writeable /usr/ports).  This
scenario is rather common in src/ and would be (if it wasn't broken
:-) ) in doc/.  I now got around to looking a bit more on
ports/Makefile and found out that it has no "make obj", so it's
probably very unlikely that anybody actually has a object directory
for ports, though the normal index target is made to handle the case
anyway.

> > the right way, I just don't see a really clean way to implement it the
> > right way (well, ${INDEXFILE}.bz2) could probably be used but it would
> > still only be half way there).
> 
> Without changing the index target, I don't see a cleaner way.

The only somewhat cleaner way I can think of is:

fetchindex: ${.CURDIR}/${INDEXFILE}
.ifmake fetchindex
${.CURDIR}/${INDEXFILE}: ${INDEXFILE}.bz2
.else
${.CURDIR}/${INDEXFILE}:
# Current "real" index target
.endif

But I'm not really sure if that has other implications I can't see.

Thinking more about it, I don't really care much how "correct" the
solution is, just that it works :-).  So it's fine by me just to use
your version.

> > > BTW.: if I do it the right way (".PHONY: ${INDEXFILE}.bz2" instead of
> > > adding " .PHONY" to "${INDEXFILE}.bz2:"), it doesn't work here
> > > (6-current) as expected.
> > 
> > I would guess the problem is also related to .CURDIR, but I'm not
> > sure.
> 
> I don't see where .CURDIR is supposed to change the behavior here. We're
> talking about targets, and I've specified them the same at both places.

I guess your right, that should not really matter for this.

-- 
Simon L. Nielsen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20050118/66c845cd/attachment-0001.bin


More information about the freebsd-ports mailing list