Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Feb 1996 03:16:03 -0800 (PST)
From:      asami@cs.berkeley.edu (Satoshi Asami)
To:        jkh@time.cdrom.com
Cc:        ports@freebsd.org
Subject:   Re: A tiny tale, told too often.
Message-ID:  <199602131116.DAA02928@silvia.HIP.Berkeley.EDU>
In-Reply-To: <3283.824117406@time.cdrom.com> (jkh@time.cdrom.com)

next in thread | previous in thread | raw e-mail | index | archive | help
 * Yep, some of you are no doubt nodding your heads - *that* stupid
 * problem!  Make a link tree to /cdrom/ports to save space and it works
 * just spiffy for most of them, that is until the CDROM gets umounted
 * somehow and your link now points into space.

Yup.

 * To something a bit more intelligent which detects when the file is
 * a broken link.  I've tried adding a:
 * 
 * 
 * 	if [ -h `/usr/bin/basename $$file` -o -h $$file ]; then
 * 		.. bitch ..
 * 		exit
 * 	fi
 * 
 * clause to the above in the obvious place, but it doesn't seem to work!
 * Any ideas?

I don't know, you didn't tell me where the "obvious place" is. :>
Anyway, the following seems to work for me....

Satoshi
=======
--- /usr/src/share/mk/bsd.port.mk	Fri Feb  9 05:40:39 1996
+++ bsd.port.mk	Tue Feb 13 03:13:26 1996
@@ -488,6 +488,12 @@
 	@(cd ${DISTDIR}; \
 	 for file in ${DISTFILES}; do \
 		if [ ! -f $$file -a ! -f `/usr/bin/basename $$file` ]; then \
+			if [ -h $$file -o -h `/usr/bin/basename $$file` ]; then \
+				${ECHO_MSG} ">> ${DISTDIR}/$$file is an unresolved symbolic link."; \
+				${ECHO_MSG} ">> If you are sure you want to fetch it over the network,"; \
+				${ECHO_MSG} ">> please manually delete the link before proceeding."; \
+				exit 1; \
+			fi; \
 			${ECHO_MSG} ">> $$file doesn't seem to exist on this system."; \
 			for site in ${MASTER_SITES}; do \
 			    ${ECHO_MSG} ">> Attempting to fetch from $${site}."; \
@@ -506,6 +512,12 @@
 	@(cd ${PATCHDIST}; \
 	 for file in ${PATCHFILES}; do \
 		if [ ! -f $$file -a ! -f `/usr/bin/basename $$file` ]; then \
+			if [ -h $$file -o -h `/usr/bin/basename $$file` ]; then \
+				${ECHO_MSG} ">> ${DISTDIR}/$$file is an unresolved symbolic link."; \
+				${ECHO_MSG} ">> If you are sure you want to fetch it over the network,"; \
+				${ECHO_MSG} ">> please manually delete the link before proceeding."; \
+				exit 1; \
+			fi; \
 			${ECHO_MSG} ">> $$file doesn't seem to exist on this system."; \
 			for site in ${PATCH_SITES}; do \
 			    ${ECHO_MSG} ">> Attempting to fetch from $${site}."; \



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