ports/91086: Don't fetch ${INDEXFILE}.bz2 if not neccessary + respect FETCH_ENV
Alexander Leidinger
netchild at FreeBSD.org
Fri Dec 30 11:40:04 UTC 2005
>Number: 91086
>Category: ports
>Synopsis: Don't fetch ${INDEXFILE}.bz2 if not neccessary + respect FETCH_ENV
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: update
>Submitter-Id: current-users
>Arrival-Date: Fri Dec 30 11:40:02 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator: Alexander Leidinger
>Release: current
>Organization:
FreeBSD
>Environment:
>Description:
The current implementation of fetchindex removes the bz2 file when it generates the INDEXFILE. This defeats the purpose of -m flag (mirror mode) for fetch.
The included implementation separates the fetch from the unpacking. The unpacking is done in a way which doesn't remove the bz2 file. This way multiple fetchindex runs without any change to the master INDEXFILE on the website doesn't result in downloads. This should reduce the traffic and the time needed for the user.
Additionally this also respects FETCH_ENV for the FETCHINDEX command.
>How-To-Repeat:
>Fix:
Index: Makefile
===================================================================
RCS file: /big/FreeBSD-CVS/ports/Makefile,v
retrieving revision 1.92
diff -u -u -r1.92 Makefile
--- Makefile 24 Dec 2005 07:04:15 -0000 1.92
+++ Makefile 24 Dec 2005 10:57:08 -0000
@@ -70,11 +70,17 @@
@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
+FETCHINDEX?= ${FETCH_ENV} fetch -am
INDEX_JOBS?= 2
.if !defined(INDEX_VERBOSE)
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list