Subject: Re: Different sites for different distfiles, was Re: Packages with
To: David Brownlee <abs@netbsd.org>
From: Frederick Bruckman <fredb@immanent.net>
List: tech-pkg
Date: 12/28/2001 13:48:30
On Fri, 28 Dec 2001, David Brownlee wrote:

> On Fri, 28 Dec 2001, Frederick Bruckman wrote:
>
> > On Fri, 28 Dec 2001, Jared D. McNeill wrote:
> >
> > > Why not just MASTER_SITES.${DISTFILE} ?
> >
> > Yeah, that could work! We shouldn't check ${MASTER_SITES.foo.gz} for the
> > main distfile, just for the the supplemental DISTFILES and PATCH_FILES.
>
> 	Probably worth doing for the main distfile too - would be an easy
> 	way to handle all the supplemental DISTFILES and PATCH_FILES
> 	coming from one place and the main from another?

Well, I was thinking that MASTER_SITES is already for the first
distfile, whose name is computed from ${DISTNAME}, so
MASTER_SITES.${DISTFILE} would only be for the other ${DISTFILES}, but
your idea to make it general is even better. So we could just have

${MASTER_SITES}_${DISTNAME}.${EXTRACT_SUFX}?=	${MASTER_SITES}

then in the do-fetch target, you sort each ${MASTER_SITES_${fetchfile}}
seperately. Something like

.for fetchfile in ${_DISTFILES}
SORTED_MASTER_SITES_CMD= ${ECHO} '${MASTER_SITES.${fetchfile:T}}' | ${AWK} '${MASTER_SORT_AWK}'
	${_PKG_SILENT}${_PKG_DEBUG}cd ${_DISTDIR};	\
	sortedsites=`${SORTED_MASTER_SITES_CMD}`;	\
        sites="${MASTER_SITES_OVERRIDE} $$sortedsites ${MASTER_SITE_BACKUP}";	 \

and so on, and a similar thing for PATCH_SITES. This way, once you
define MASTER_SITE_foo.gz in the package's Makefile, it will never ever
go to ${MASTER_SITES}, even once the file can no longer be found at it's
original location. Note also, that I don't sort
${MASTER_SITES_OVERRIDE}, as that's documented to be tried first, before
${MASTER_SITES} and ${MASTER_SITES_BACKUP}.

Frederick