Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Nov 1996 23:57:49 -0800 (PST)
From:      asami@freebsd.org (Satoshi Asami)
To:        adam@veda.is
Cc:        freebsd-ports@freebsd.org
Subject:   Re: for review: bsd.port.mk refetch
Message-ID:  <199611150757.XAA15053@silvia.HIP.Berkeley.EDU>
In-Reply-To: <199611140320.DAA00763@veda.is> (message from Adam David on Thu, 14 Nov 1996 03:20:20 %2B0000 (GMT))

next in thread | previous in thread | raw e-mail | index | archive | help
 * Did anyone have any objections to the refetch patch I submitted on Sept.11?
 * One person volunteered for testing, but unfortunately I forget who it was
 * because of lost email... Perhaps some other people have also been using this
 * or a variant, please speak up.

Sorry, I finally got around to test it.  Didn't work for root. :)

 * My original patch is archived, found below this URL...

I modified one hunk (the first one, it failed) and attached one that
can be applied to the -current bsd.port.mk.

 * It would also be an idea to implement a refetch: target (for
 * instance, as a copy of fetch: with the -r flag enforced).

That's a good idea, but FETCH_BEFORE_ARGS can be used in ports, with
different FETCH_CMDs.  Maybe we should use something like

.if defined(REFETCH)
FETCH_CMD?=		/usr/bin/fetch -r
.else
FETCH_CMD?=		/usr/bin/fetch
.endif

(this is ?= defined so is overridable by the user or port Makefile).

Anyway, I think this is interesting, I suggest people test it.  I'm
not sure if fetch returns the error status correctly (I've seen fetch
claim to have transmitted the entire file when only half has been
fetched) though.  Also need to do something about Mr. Root.  Is there
some way to test the permission bits themselves, not readability?

Satoshi
-------
Index: bsd.port.mk
===================================================================
RCS file: /usr/cvs/src/share/mk/bsd.port.mk,v
retrieving revision 1.231
diff -u -r1.231 bsd.port.mk
--- bsd.port.mk	1996/11/14 11:45:42	1.231
+++ bsd.port.mk	1996/11/15 07:19:25
@@ -412,6 +412,7 @@
 
 ECHO?=		/bin/echo
 CAT?=		/bin/cat
+CHMOD?=		/bin/chmod
 CP?=		/bin/cp
 SETENV?=	/usr/bin/env
 RM?=		/bin/rm
@@ -680,7 +681,7 @@
 	@if [ ! -d ${DISTDIR} ]; then ${MKDIR} ${DISTDIR}; fi
 	@(cd ${DISTDIR}; \
 	 for file in ${DISTFILES}; do \
-		if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \
+		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?"; \
@@ -691,7 +692,10 @@
 			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";\
@@ -703,7 +707,7 @@
 	@if [ ! -d ${DISTDIR} ]; then ${MKDIR} ${DISTDIR}; fi
 	@(cd ${DISTDIR}; \
 	 for file in ${PATCHFILES}; do \
-		if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \
+		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?"; \
@@ -714,7 +718,10 @@
 			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?199611150757.XAA15053>