Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Sep 1996 01:39:40 +0000 (GMT)
From:      Adam David <adam@veda.is>
To:        asami@freebsd.org
Cc:        committers@freebsd.org, ports@freebsd.org
Subject:   for review: bsd.port.mk refetch
Message-ID:  <199609110139.BAA21187@veda.is>

next in thread | raw e-mail | index | archive | help
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 <adam@veda.is>


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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199609110139.BAA21187>