Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Feb 2003 08:07:11 +0900
From:      Kimura Fuyuki <fuyuki@hadaly.org>
To:        seanc@FreeBSD.ORG
Cc:        ports@FreeBSD.ORG
Subject:   Re: Randomizing master sites for distfile downloads...
Message-ID:  <86smuvohuo.wl%fuyuki@hadaly.org>
In-Reply-To: <20030210021953.GT15936@perrin.int.nxad.com>
References:  <20030210021953.GT15936@perrin.int.nxad.com>

next in thread | previous in thread | raw e-mail | index | archive | help
At Sun, 9 Feb 2003 18:19:53 -0800,
Sean Chittenden <seanc@FreeBSD.ORG> wrote:
> 
> Pending a few more days of review of the updated version of random(6)
> on -audit, I'd like to see about introducing the ability to randomize
> the downloads of distfiles from the various master sites.  I think
> mirror operators who are listed in the first three or four sites would
> love the repreive as well, nevermind improving the resiliancy of the
> system.  Mark Murry posted a bit about how to randomize the sites
> without using the updated random(6), so pending any objections, I'll
> likely incorporate his suggestion for OS versions less than 500100 or
> 400800.

Isn't it enough just to leave open the possibility that the users
could define their own sites sorter/randomizer? (cf. ports/20678)

Index: bsd.port.mk
===================================================================
RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.438
diff -u -r1.438 bsd.port.mk
--- bsd.port.mk	10 Feb 2003 07:59:22 -0000	1.438
+++ bsd.port.mk	10 Feb 2003 22:49:53 -0000
@@ -1787,6 +1787,7 @@
 MASTER_SORT_AWK+=	/${srt:S|/|\\/|g}/ { good["${srt:S|\\|\\\\|g}"] = good["${srt:S|\\|\\\\|g}"] " " $$0 ; next; }
 .endfor
 MASTER_SORT_AWK+=	{ rest = rest " " $$0; } END { n=split(gl, gla); for(i=1;i<=n;i++) { print good[gla[i]]; } print rest; }
+SORT_SITES_CMD?=	${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'
 
 SORTED_MASTER_SITES_DEFAULT_CMD=	cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} master-sites-DEFAULT
 SORTED_PATCH_SITES_DEFAULT_CMD=		cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} patch-sites-DEFAULT
@@ -1805,7 +1806,7 @@
 .			if !target(master-sites-${_group})
 SORTED_MASTER_SITES_${_group}_CMD=	cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} master-sites-${_group}
 master-sites-${_group}:
-	@echo ${_MASTER_SITE_OVERRIDE} `echo '${_MASTER_SITES_${_group}}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}
+	@echo ${_MASTER_SITE_OVERRIDE} `echo '${_MASTER_SITES_${_group}}' | ${SORT_SITES_CMD}` ${_MASTER_SITE_BACKUP}
 .			endif
 .		endfor
 .	endif
@@ -1817,7 +1818,7 @@
 .			if !target(patch-sites-${_group})
 SORTED_PATCH_SITES_${_group}_CMD=	cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} patch-sites-${_group}
 patch-sites-${_group}:
-	@echo ${_MASTER_SITE_OVERRIDE} `echo '${_PATCH_SITES_${_group}}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}
+	@echo ${_MASTER_SITE_OVERRIDE} `echo '${_PATCH_SITES_${_group}}' | ${SORT_SITES_CMD}` ${_MASTER_SITE_BACKUP}
 .			endif
 .		endfor
 .	endif
@@ -1850,14 +1851,14 @@
 .endfor
 
 master-sites-ALL:
-	@echo ${_MASTER_SITE_OVERRIDE} `echo '${_MASTER_SITES_ALL}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}
+	@echo ${_MASTER_SITE_OVERRIDE} `echo '${_MASTER_SITES_ALL}' | ${SORT_SITES_CMD}` ${_MASTER_SITE_BACKUP}
 patch-sites-ALL:
-	@echo ${_MASTER_SITE_OVERRIDE} `echo '${_PATCH_SITES_ALL}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}
+	@echo ${_MASTER_SITE_OVERRIDE} `echo '${_PATCH_SITES_ALL}' | ${SORT_SITES_CMD}` ${_MASTER_SITE_BACKUP}
 # has similar effect to old targets, i.e., access only {MASTER,PATCH}_SITES, not working with the new _n variables
 master-sites-DEFAULT:
-	@echo ${_MASTER_SITE_OVERRIDE} `echo '${_MASTER_SITES_DEFAULT}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}
+	@echo ${_MASTER_SITE_OVERRIDE} `echo '${_MASTER_SITES_DEFAULT}' | ${SORT_SITES_CMD}` ${_MASTER_SITE_BACKUP}
 patch-sites-DEFAULT:
-	@echo ${_MASTER_SITE_OVERRIDE} `echo '${_PATCH_SITES_DEFAULT}' | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}
+	@echo ${_MASTER_SITE_OVERRIDE} `echo '${_PATCH_SITES_DEFAULT}' | ${SORT_SITES_CMD}` ${_MASTER_SITE_BACKUP}
 
 # synonyms, mnemonics
 master-sites-all: master-sites-ALL
@@ -2399,7 +2400,7 @@
 					fi \
 				done; \
 				___MASTER_SITES_TMP= ; \
-				SORTED_MASTER_SITES_CMD_TMP="echo ${_MASTER_SITE_OVERRIDE} `echo $${__MASTER_SITES_TMP} | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}" ; \
+				SORTED_MASTER_SITES_CMD_TMP="echo ${_MASTER_SITE_OVERRIDE} `echo $${__MASTER_SITES_TMP} | ${SORT_SITES_CMD}` ${_MASTER_SITE_BACKUP}" ; \
 			else \
 				SORTED_MASTER_SITES_CMD_TMP="${SORTED_MASTER_SITES_DEFAULT_CMD}" ; \
 			fi ; \
@@ -2444,8 +2445,7 @@
 					fi \
 				done; \
 				___PATCH_SITES_TMP= ; \
-				SORTED_PATCH_SITES_CMD_TMP="echo ${_MASTER_SITE_OVERRIDE} `echo $${__PATCH_SITES_TMP} | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}" ; \
-			else \
+				SORTED_PATCH_SITES_CMD_TMP="echo ${_MASTER_SITE_OVERRIDE} `echo $${__PATCH_SITES_TMP} | ${SORT_SITES_CMD}` ${_MASTER_SITE_BACKUP}" ; \
 				SORTED_PATCH_SITES_CMD_TMP="${SORTED_PATCH_SITES_DEFAULT_CMD}" ; \
 			fi ; \
 			for site in `eval $$SORTED_PATCH_SITES_CMD_TMP`; do \
@@ -3153,7 +3153,7 @@
 					fi \
 				done; \
 				___MASTER_SITES_TMP= ; \
-				SORTED_MASTER_SITES_CMD_TMP="echo ${_MASTER_SITE_OVERRIDE} `echo $${__MASTER_SITES_TMP} | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}" ; \
+				SORTED_MASTER_SITES_CMD_TMP="echo ${_MASTER_SITE_OVERRIDE} `echo $${__MASTER_SITES_TMP} | ${SORT_SITES_CMD}` ${_MASTER_SITE_BACKUP}" ; \
 			else \
 				SORTED_MASTER_SITES_CMD_TMP="${SORTED_MASTER_SITES_DEFAULT_CMD}" ; \
 			fi ; \
@@ -3185,7 +3185,7 @@
 					fi \
 				done; \
 				___PATCH_SITES_TMP= ; \
-				SORTED_PATCH_SITES_CMD_TMP="echo ${_MASTER_SITE_OVERRIDE} `echo $${__PATCH_SITES_TMP} | ${AWK} '${MASTER_SORT_AWK:S|\\|\\\\|g}'` ${_MASTER_SITE_BACKUP}" ; \
+				SORTED_PATCH_SITES_CMD_TMP="echo ${_MASTER_SITE_OVERRIDE} `echo $${__PATCH_SITES_TMP} | ${SORT_SITES_CMD}` ${_MASTER_SITE_BACKUP}" ; \
 			else \
 				SORTED_PATCH_SITES_CMD_TMP="${SORTED_PATCH_SITES_DEFAULT_CMD}" ; \
 			fi ; \

-- fuyuki


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86smuvohuo.wl%fuyuki>