Makeing fetchindex really mirror INDEX

Simon L. Nielsen simon at FreeBSD.org
Sun Jan 9 09:02:22 PST 2005


On 2005.01.09 17:49:45 +0100, Alexander Leidinger wrote:
> On Sun, 9 Jan 2005 15:39:04 +0100
> "Simon L. Nielsen" <simon at freebsd.org> wrote:
> 
> >  fetchindex:
> > -	@cd ${.CURDIR} && ${FETCHINDEX} ${MASTER_SITE_INDEX}/${INDEXFILE}.bz2 && bunzip2 -f ${INDEXFILE}.bz2 && chmod a+r ${INDEXFILE}
> > +	@${FETCHINDEX} -o ${.CURDIR}/${INDEXFILE}.bz2 \
> > +		${MASTER_SITE_INDEX}${INDEXFILE}.bz2
> > +	@cd ${.CURDIR} && if [ ${INDEXFILE}.bz2 -nt ${INDEXFILE} ]; then \
> > +		bunzip2 < ${INDEXFILE}.bz2 > ${INDEXFILE}; \
> > +		chmod a+r ${INDEXFILE}; \
> > +	fi
> 
> Why do you do the work "make" is supposed to do?
>
> The following does what you want (and "make index" works too):

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
there might be a object directory.  At least as I read it, I could be
wrong.

In general I agree my way is slight silly, because it's certainly not
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).

> ---snip---
> Index: Makefile
> ===================================================================
> RCS file: /big/FreeBSD-CVS/ports/Makefile,v
> retrieving revision 1.90
> diff -u -u -r1.90 Makefile
> --- Makefile    17 Dec 2004 11:23:22 -0000      1.90
> +++ Makefile    9 Jan 2005 16:45:36 -0000
> @@ -69,8 +69,14 @@
>         @rm -f ${.CURDIR}/${INDEXFILE}
>         @cd ${.CURDIR} && make ${.CURDIR}/${INDEXFILE}
>  
> -fetchindex:
> -       @cd ${.CURDIR} && ${FETCHINDEX} ${MASTER_SITE_INDEX}/${INDEXFILE}.bz2 && bunzip2 -f ${INDEXFILE}.bz2 && chmod a+r ${INDEXFILE}
> +${INDEXFILE}.bz2: .PHONY
> +       @${FETCHINDEX} ${MASTER_SITE_INDEX}${INDEXFILE}.bz2
> +
> +${INDEXFILE}: ${INDEXFILE}.bz2 
> +       @bunzip2 <${INDEXFILE}.bz2 >${INDEXFILE}
> +       @chmod a+r ${INDEXFILE}
> +
> +fetchindex: ${INDEXFILE}
>  
>  MASTER_SITE_INDEX?=    http://www.FreeBSD.org/ports/
>  FETCHINDEX?=   fetch -am
> ---snip---
> 
> 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.

-- 
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/20050109/1d165799/attachment.bin


More information about the freebsd-ports mailing list