Subject: Re: Packages with dynamic download sites
To: David Brownlee <abs@netbsd.org>
From: Frederick Bruckman <fredb@immanent.net>
List: tech-pkg
Date: 12/21/2001 10:55:45
On Fri, 21 Dec 2001, David Brownlee wrote:
> Thanks! - rather than try the getsites.sh for every package would
> it be reasonable to have a DYNAMIC_MASTER_SITES variable which
> could be set to point to the package specific 'MASTER_SITES'
> outputting script?
I was thinking something like that myself. I was leaning towards
passing the uri (${DYNAMIC_MASTER_SITES_URI}, or so) and ${DISTFILES}
to the script through it's environment, and triggering an alternative
to that whole block of shell code on `.ifdef DYNAMIC_MASTER_SITES_URI',
even though only the "sites" line is different, rather than doing the
switch within the shell code. That all still assumes that the script
gets a reserved name, like "patch-*", "distinfo" are reserved names.
> Index: mk/bsd.pkg.mk
> ===================================================================
> RCS file: /cvsroot/pkgsrc/mk/bsd.pkg.mk,v
> retrieving revision 1.882
> diff -u -B -r1.882 bsd.pkg.mk
> --- mk/bsd.pkg.mk 2001/12/19 10:29:11 1.882
> +++ mk/bsd.pkg.mk 2001/12/21 16:12:00
> @@ -1285,6 +1285,9 @@
> ${_PKG_SILENT}${_PKG_DEBUG}cd ${_DISTDIR}; \
> sortedsites=`${SORTED_MASTER_SITES_CMD}`; \
> sites="${MASTER_SITES_${fetchfile:T}} $$sortedsites"; \
> + if [ -n "${DYNAMIC_MASTER_SITES}" ] ; then \
> + sites="`${SH} ${PKGDIR}/${DYNAMIC_MASTER_SITES} ${fetchfile}` $sites"; \
> + fi; \
> file="${fetchfile}"; \
> bfile="${fetchfile:T}"; \
> ${_CHECK_DIST_PATH}; \
>
>
Frederick