From owner-freebsd-ports Tue Sep 10 18:39:56 1996 Return-Path: owner-ports Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id SAA29462 for ports-outgoing; Tue, 10 Sep 1996 18:39:56 -0700 (PDT) Received: from veda.is (ubiq.veda.is [193.4.230.60]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id SAA29436; Tue, 10 Sep 1996 18:39:47 -0700 (PDT) Received: (from adam@localhost) by veda.is (8.7.5/8.7.3) id BAA21187; Wed, 11 Sep 1996 01:39:42 GMT From: Adam David Message-Id: <199609110139.BAA21187@veda.is> Subject: for review: bsd.port.mk refetch To: asami@freebsd.org Date: Wed, 11 Sep 1996 01:39:40 +0000 (GMT) Cc: committers@freebsd.org, ports@freebsd.org X-Mailer: ELM [version 2.4ME+ PL22 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-ports@freebsd.org X-Loop: FreeBSD.org Precedence: bulk This patch enables partially fetched sources to be fetched completely in multiple attempts by defining FETCH_BEFORE_ARGS=-r Incompletely fetched files are marked unreadable by chmod, and sensible modes are set again on successful completion. It is assumed that the same file is being fetched, whichever master site it comes from. This will break in rare or unusual circumstances, such as when master sites get out of synch with each other and if the filename has not changed between versions. This could be improved on by comparing the checksum, but this can be implemented in a separate step later if it proves worthwhile. Adam David *** share/mk/bsd.port.mk.old Mon Aug 26 12:12:01 1996 --- share/mk/bsd.port.mk Wed Sep 11 00:59:03 1996 *************** *** 394,399 **** --- 394,400 ---- CAT?= /bin/cat GREP?= /usr/bin/grep AWK?= /usr/bin/awk + CHMOD?= /bin/chmod # Used to print all the '===>' style prompts - override this to turn them off. ECHO_MSG?= ${ECHO} *************** *** 596,602 **** @if [ ! -d ${DISTDIR} ]; then ${MKDIR} -p ${DISTDIR}; fi @(cd ${DISTDIR}; \ for file in ${DISTFILES}; do \ ! if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \ if [ -h $$file -o -h `${BASENAME} $$file` ]; then \ ${ECHO_MSG} ">> ${DISTDIR}/$$file is a broken symlink."; \ ${ECHO_MSG} ">> Perhaps a filesystem (most likely a CD) isn't mounted?"; \ --- 597,603 ---- @if [ ! -d ${DISTDIR} ]; then ${MKDIR} -p ${DISTDIR}; fi @(cd ${DISTDIR}; \ for file in ${DISTFILES}; do \ ! if [ ! -r $$file -a ! -r `${BASENAME} $$file` ]; then \ if [ -h $$file -o -h `${BASENAME} $$file` ]; then \ ${ECHO_MSG} ">> ${DISTDIR}/$$file is a broken symlink."; \ ${ECHO_MSG} ">> Perhaps a filesystem (most likely a CD) isn't mounted?"; \ *************** *** 607,613 **** --- 608,617 ---- for site in ${MASTER_SITES}; do \ ${ECHO_MSG} ">> Attempting to fetch from $${site}."; \ if ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} ${FETCH_AFTER_ARGS}; then \ + ${CHMOD} =rw $${file}; \ continue 2; \ + else \ + ${CHMOD} a-r $${file}; \ fi \ done; \ ${ECHO_MSG} ">> Couldn't fetch it - please try to retrieve this";\ *************** *** 619,625 **** @if [ ! -d ${DISTDIR} ]; then ${MKDIR} -p ${DISTDIR}; fi @(cd ${DISTDIR}; \ for file in ${PATCHFILES}; do \ ! if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \ if [ -h $$file -o -h `${BASENAME} $$file` ]; then \ ${ECHO_MSG} ">> ${DISTDIR}/$$file is a broken symlink."; \ ${ECHO_MSG} ">> Perhaps a filesystem (most likely a CD) isn't mounted?"; \ --- 623,629 ---- @if [ ! -d ${DISTDIR} ]; then ${MKDIR} -p ${DISTDIR}; fi @(cd ${DISTDIR}; \ for file in ${PATCHFILES}; do \ ! if [ ! -r $$file -a ! -r `${BASENAME} $$file` ]; then \ if [ -h $$file -o -h `${BASENAME} $$file` ]; then \ ${ECHO_MSG} ">> ${DISTDIR}/$$file is a broken symlink."; \ ${ECHO_MSG} ">> Perhaps a filesystem (most likely a CD) isn't mounted?"; \ *************** *** 630,636 **** --- 634,643 ---- for site in ${PATCH_SITES}; do \ ${ECHO_MSG} ">> Attempting to fetch from $${site}."; \ if ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} ${FETCH_AFTER_ARGS}; then \ + ${CHMOD} =rw $${file}; \ continue 2; \ + else \ + ${CHMOD} a-r $${file}; \ fi \ done; \ ${ECHO_MSG} ">> Couldn't fetch it - please try to retrieve this";\