1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-11 07:22:22 +00:00

- 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
This commit is contained in:
Bryan Drewery 2013-10-20 02:06:40 +00:00
parent cfb2a7f0ca
commit 3235c42422
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=330960

View File

@ -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";\