From owner-freebsd-ports Mon Feb 10 15: 7:18 2003 Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AAA2D37B401; Mon, 10 Feb 2003 15:07:14 -0800 (PST) Received: from t-mta1.odn.ne.jp (mfep1.odn.ne.jp [143.90.131.179]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6ED1543F75; Mon, 10 Feb 2003 15:07:13 -0800 (PST) (envelope-from fuyuki@hadaly.org) Received: from hadaly.dyndns.org ([218.218.122.239]) by t-mta1.odn.ne.jp with ESMTP id <20030210230712697.PHDW.4459.t-mta1.odn.ne.jp@mta1.odn.ne.jp>; Tue, 11 Feb 2003 08:07:12 +0900 Received: from hadaly.dyndns.org (localhost [127.0.0.1]) by hadaly.dyndns.org (Postfix) with ESMTP id 2887C5496; Tue, 11 Feb 2003 08:07:12 +0900 (JST) Date: Tue, 11 Feb 2003 08:07:11 +0900 Message-ID: <86smuvohuo.wl%fuyuki@hadaly.org> From: Kimura Fuyuki To: seanc@FreeBSD.ORG Cc: ports@FreeBSD.ORG Subject: Re: Randomizing master sites for distfile downloads... In-Reply-To: <20030210021953.GT15936@perrin.int.nxad.com> References: <20030210021953.GT15936@perrin.int.nxad.com> User-Agent: Wanderlust/2.10.0 (Venus) Emacs/21.2 Mule/5.0 (SAKAKI) X-Public-Key: http://www.hadaly.org/fuyuki.key X-Fingerprint: 8D68 1138 1A85 8556 C6A9 274B 2C72 2E56 3AF7 3D89 MIME-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org At Sun, 9 Feb 2003 18:19:53 -0800, Sean Chittenden 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