Subject: Re: Packages with dynamic download sites
To: Frederick Bruckman <fredb@immanent.net>
From: David Brownlee <abs@netbsd.org>
List: tech-pkg
Date: 02/04/2002 17:41:19
	Now the fetch logic has been reworked I have an updated patch to
	handle dynamic master sites

	It calls ${FILESDIR}/getsites.sh with the name of the file wanted,
	and expects it to output the url base at which to find that file.

	Does it seem reasonable?

Index: bsd.pkg.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/bsd.pkg.mk,v
retrieving revision 1.920
diff -u -B -r1.920 bsd.pkg.mk
--- bsd.pkg.mk	2002/01/29 15:07:55	1.920
+++ bsd.pkg.mk	2002/02/04 17:34:15
@@ -1280,13 +1280,22 @@
 _FETCH_ALLFILES= ${TEST} -d ${_DISTDIR} || ${MKDIR} ${_DISTDIR};
 _FETCH_ALLFILES+= cd ${_DISTDIR};
 .    for fetchfile in ${_ALLFILES}
+.      if defined(DYNAMIC_MASTER_SITES)
 _FETCH_ALLFILES+= 							\
+	file="${fetchfile}";						\
+	bfile="${fetchfile:T}";						\
+	sites=`sh ${FILESDIR}/getsites.sh $${file}`; 			\
+	${_CHECK_DIST_PATH};						\
+	${_FETCH_FILE};
+.      else
+_FETCH_ALLFILES+= 							\
 	unsorted_sites="${SITES_${fetchfile:T}} ${_MASTER_SITE_BACKUP}"; \
 	sites="${ORDERED_SITES}";					\
 	file="${fetchfile}";						\
 	bfile="${fetchfile:T}";						\
 	${_CHECK_DIST_PATH};						\
 	${_FETCH_FILE};
+.      endif
 .    endfor
 .  endif
 _FETCH_ALLFILES?= ${DO_NADA}

-- 
		David/absolute		-- www.netbsd.org: No hype required --