From owner-svn-ports-head@FreeBSD.ORG Sun Oct 20 02:06:41 2013 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 99E786C0; Sun, 20 Oct 2013 02:06:41 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 870772E17; Sun, 20 Oct 2013 02:06:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9K26fFt057133; Sun, 20 Oct 2013 02:06:41 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9K26fd0057124; Sun, 20 Oct 2013 02:06:41 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201310200206.r9K26fd0057124@svn.freebsd.org> From: Bryan Drewery Date: Sun, 20 Oct 2013 02:06:41 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r330960 - head/Mk X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Oct 2013 02:06:41 -0000 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";\