Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Jan 2005 17:49:45 +0100
From:      Alexander Leidinger <Alexander@Leidinger.net>
To:        "Simon L. Nielsen" <simon@freebsd.org>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: Makeing fetchindex really mirror INDEX
Message-ID:  <20050109174945.7f0353e4@Magellan.Leidinger.net>
In-Reply-To: <20050109143903.GC1187@zaphod.nitro.dk>
References:  <20050109143903.GC1187@zaphod.nitro.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 9 Jan 2005 15:39:04 +0100
"Simon L. Nielsen" <simon@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):
---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.

Bye,
Alexander.

-- 
         The computer revolution is over. The computers won.

http://www.Leidinger.net                       Alexander @ Leidinger.net
  GPG fingerprint = C518 BC70 E67F 143F BE91  3365 79E2 9C60 B006 3FE7



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050109174945.7f0353e4>