summaryrefslogtreecommitdiff
path: root/mk/fetch/fetch.mk
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2006-07-27 15:16:44 +0000
committerjlam <jlam@pkgsrc.org>2006-07-27 15:16:44 +0000
commite7af7b2e05a05619d928f4bb3855ebca2c58f684 (patch)
tree3529dbe2fb2a983115d50f591b6a7a2501a1d59c /mk/fetch/fetch.mk
parenta5163ad93efe3955028881dd69253ff3a5809704 (diff)
downloadpkgsrc-e7af7b2e05a05619d928f4bb3855ebca2c58f684.tar.gz
Apply the "convention over configuration" principle:
If ${FILESDIR}/getsite.sh exists, then use it to determine the fetch URL for each of the distfiles for the package. Otherwise, use SITE_<file> and MASTER_SITES, in order, to determine the URL for each distfile. If the script path differs from ${FILESDIR}/getsite.sh, then set DYNAMIC_SITE_SCRIPT to the full path to that script. Remove the need to set DYNAMIC_MASTER_SITES explicitly in the package Makefile for: graphics/ns-cult3d wm/sawfish-themes www/apache-tomcat55 www/jakarta-tomcat4 www/jakarta-tomcat5
Diffstat (limited to 'mk/fetch/fetch.mk')
-rw-r--r--mk/fetch/fetch.mk8
1 files changed, 5 insertions, 3 deletions
diff --git a/mk/fetch/fetch.mk b/mk/fetch/fetch.mk
index 6300bb8a296..25c27371784 100644
--- a/mk/fetch/fetch.mk
+++ b/mk/fetch/fetch.mk
@@ -1,4 +1,4 @@
-# $NetBSD: fetch.mk,v 1.17 2006/07/27 07:41:40 rillig Exp $
+# $NetBSD: fetch.mk,v 1.18 2006/07/27 15:16:44 jlam Exp $
_MASTER_SITE_BACKUP= ${MASTER_SITE_BACKUP:=${DIST_SUBDIR}${DIST_SUBDIR:D/}}
_MASTER_SITE_OVERRIDE= ${MASTER_SITE_OVERRIDE:=${DIST_SUBDIR}${DIST_SUBDIR:D/}}
@@ -54,9 +54,11 @@ _ORDERED_SITES= ${_MASTER_SITE_OVERRIDE} $$unsorted_sites
#
# Associate each file to fetch with the correct site(s).
#
-.if defined(DYNAMIC_MASTER_SITES)
+DYNAMIC_SITE_SCRIPT?= ${FILESDIR}/getsite.sh
+DYNAMIC_SITE_CMD?= ${SETENV} PATH=${PATH:Q} ${SH} ${DYNAMIC_SITE_SCRIPT}
+.if exists(${DYNAMIC_SITE_SCRIPT})
. for fetchfile in ${_ALLFILES}
-SITES_${fetchfile:T:S/=/--/}?= `${SH} ${FILESDIR}/getsite.sh ${fetchfile:T}`
+SITES_${fetchfile:T:S/=/--/}?= `${DYNAMIC_SITE_CMD} ${fetchfile:T}`
SITES.${fetchfile:T:S/=/--/}?= ${SITES_${fetchfile:T:S/=/--/}}
. endfor
.endif