Date: Sun, 20 Oct 2013 02:06:41 +0000 (UTC) From: Bryan Drewery <bdrewery@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r330960 - head/Mk Message-ID: <201310200206.r9K26fd0057124@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bdrewery Date: Sun Oct 20 02:06:40 2013 New Revision: 330960 URL: http://svnweb.freebsd.org/changeset/ports/330960 Log: - Fix patch fetching so it tries the next site if one has the wrong size. Same fix as r325805 was for MASTER_SITES, but this is applied for PATCH_SITES With hat: portmgr Modified: head/Mk/bsd.port.mk Modified: head/Mk/bsd.port.mk ============================================================================== --- head/Mk/bsd.port.mk Sun Oct 20 02:03:29 2013 (r330959) +++ head/Mk/bsd.port.mk Sun Oct 20 02:06:40 2013 (r330960) @@ -3535,7 +3535,13 @@ do-fetch: else \ SORTED_PATCH_SITES_CMD_TMP="${SORTED_PATCH_SITES_DEFAULT_CMD}" ; \ fi; \ - for site in `eval $$SORTED_PATCH_SITES_CMD_TMP`; do \ + sites_remaining=0; \ + sites="`eval $$SORTED_PATCH_SITES_CMD_TMP`"; \ + for site in $${sites}; do \ + sites_remaining=$$(($${sites_remaining} + 1)); \ + done; \ + for site in $${sites}; do \ + sites_remaining=$$(($${sites_remaining} - 1)); \ ${ECHO_MSG} "=> Attempting to fetch $${site}$${file}"; \ CKSIZE=`alg=SIZE; ${DISTINFO_DATA}`; \ case $${file} in \ @@ -3544,7 +3550,16 @@ do-fetch: *) args=$${site}$${file};; \ esac; \ if ${SETENV} ${FETCH_ENV} ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${args} ${FETCH_AFTER_ARGS}; then \ - continue 2; \ + actual_size=`stat -f %z "$${file}"`; \ + if [ -n "${DISABLE_SIZE}" ] || [ -z "$${CKSIZE}" ] || [ $${actual_size} -eq $${CKSIZE} ]; then \ + continue 2; \ + else \ + ${ECHO_MSG} "=> Fetched file size mismatch (expected $${CKSIZE}, actual $${actual_size})"; \ + if [ $${sites_remaining} -gt 1 ]; then \ + ${ECHO_MSG} "=> Trying next site"; \ + ${RM} -f $${file}; \ + fi; \ + fi; \ fi; \ done; \ ${ECHO_MSG} "=> Couldn't fetch it - please try to retrieve this";\
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310200206.r9K26fd0057124>