From owner-freebsd-ports Tue Feb 13 03:16:14 1996 Return-Path: owner-ports Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id DAA01259 for ports-outgoing; Tue, 13 Feb 1996 03:16:14 -0800 (PST) Received: from silvia.HIP.Berkeley.EDU (silvia.HIP.Berkeley.EDU [136.152.64.181]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id DAA01252 for ; Tue, 13 Feb 1996 03:16:11 -0800 (PST) Received: (from asami@localhost) by silvia.HIP.Berkeley.EDU (8.7.3/8.6.9) id DAA02928; Tue, 13 Feb 1996 03:16:03 -0800 (PST) Date: Tue, 13 Feb 1996 03:16:03 -0800 (PST) Message-Id: <199602131116.DAA02928@silvia.HIP.Berkeley.EDU> To: jkh@time.cdrom.com CC: ports@freebsd.org In-reply-to: <3283.824117406@time.cdrom.com> (jkh@time.cdrom.com) Subject: Re: A tiny tale, told too often. From: asami@cs.berkeley.edu (Satoshi Asami) Sender: owner-ports@freebsd.org Precedence: bulk * 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}."; \