summaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authorasami <asami@FreeBSD.org>1995-08-29 11:57:40 +0000
committerasami <asami@FreeBSD.org>1995-08-29 11:57:40 +0000
commit1891698702fa4116b75fc7322b1b09c4965f2889 (patch)
treeb25a155b64bd958526ac74b6e61f261b12c9cefc /Mk
parent389d073fd5c8df8a20a61938a312da9fea0727f8 (diff)
downloadFreeBSD-ports-1891698702fa4116b75fc7322b1b09c4965f2889.zip
FreeBSD-ports-1891698702fa4116b75fc7322b1b09c4965f2889.tar.gz
Don't trust ncftp's exit status, they are not indicative of whether
the file is fetched or not. Apparently Jordan fixed it a long time ago but it was broken again at import of the new version of ncftp. Which means even if we fix it, it may break again and we may need to fix it again, and (imagination here, please).... Instead, move the file existence check into the for loop for MASTER_SITES/PATCH_SITES and break out with "continue 2" when the file is found. This is actually a cleaner logic than before if you ask me, because instead of assuming the file is fetched on a 0 exit status from ncftp AND checking for the existence of the file after the loop, the check is done exactly once for each iteration and nowhere else.
Diffstat (limited to 'Mk')
-rw-r--r--Mk/bsd.port.mk26
1 files changed, 12 insertions, 14 deletions
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index b6b4167..312c0a4 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -456,15 +456,14 @@ do-fetch:
${ECHO_MSG} ">> $$file doesn't seem to exist on this system."; \
for site in ${MASTER_SITES}; do \
${ECHO_MSG} ">> Attempting to fetch from $${site}"; \
- if ${NCFTP} ${NCFTPFLAGS} $${site}$${file}; then \
- break; \
+ (${NCFTP} ${NCFTPFLAGS} $${site}$${file} || true); \
+ if [ -f $$file -o -f `/usr/bin/basename $$file` ]; then \
+ continue 2; \
fi \
done; \
- if [ ! -f $$file -a ! -f `/usr/bin/basename $$file` ]; then \
- ${ECHO_MSG} ">> Couldn't fetch it - please try to retreive this";\
- ${ECHO_MSG} ">> port manually into ${DISTDIR} and try again."; \
- exit 1; \
- fi; \
+ ${ECHO_MSG} ">> Couldn't fetch it - please try to retreive this";\
+ ${ECHO_MSG} ">> port manually into ${DISTDIR} and try again."; \
+ exit 1; \
fi \
done)
.if defined(PATCHFILES)
@@ -475,15 +474,14 @@ do-fetch:
${ECHO_MSG} ">> $$file doesn't seem to exist on this system."; \
for site in ${PATCH_SITES}; do \
${ECHO_MSG} ">> Attempting to fetch from $${site}."; \
- if ${NCFTP} ${NCFTPFLAGS} $${site}$${file}; then \
- break; \
+ (${NCFTP} ${NCFTPFLAGS} $${site}$${file} || true); \
+ if [ -f $$file -o -f `/usr/bin/basename $$file` ]; then \
+ continue 2; \
fi \
done; \
- if [ ! -f $$file -a ! -f `/usr/bin/basename $$file` ]; then \
- ${ECHO_MSG} ">> Couldn't fetch it - please try to retreive this";\
- ${ECHO_MSG} ">> port manually into ${PATCHDIST} and try again."; \
- exit 1; \
- fi; \
+ ${ECHO_MSG} ">> Couldn't fetch it - please try to retreive this";\
+ ${ECHO_MSG} ">> port manually into ${PATCHDIST} and try again."; \
+ exit 1; \
fi \
done)
.endif
OpenPOWER on IntegriCloud