From owner-freebsd-ports Wed Nov 22 04:53:22 1995 Return-Path: owner-ports Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id EAA06721 for ports-outgoing; Wed, 22 Nov 1995 04:53:22 -0800 Received: from silvia.HIP.Berkeley.EDU (silvia.HIP.Berkeley.EDU [136.152.64.181]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id EAA06709 for ; Wed, 22 Nov 1995 04:53:18 -0800 Received: (from asami@localhost) by silvia.HIP.Berkeley.EDU (8.6.12/8.6.9) id EAA04903; Wed, 22 Nov 1995 04:53:15 -0800 Date: Wed, 22 Nov 1995 04:53:15 -0800 Message-Id: <199511221253.EAA04903@silvia.HIP.Berkeley.EDU> To: ports@freebsd.org Subject: Proposal 3 first cut -- depending on non-executables From: asami@cs.berkeley.edu (Satoshi Asami) Sender: owner-ports@freebsd.org Precedence: bulk Please try the following patch (relative to -current). Now you should be able to depend on a non-executable in {FETCH,BUILD,RUN}_DEPENDS. Just specify the full pathname (you can use ${PREFIX} and such) instead of the command name. bsd.port.mk will detect the "/" at the beginning and use a "test -e" instead of "which -s". You can even depend on a directory name (although the message still says "file"). The side effect of this is that if you really depend on an executable which is in a non-standard place (thus you need a full pathname), and the file is there but without the execute permission, it will (erroneously) think everything's fine and the build will fail. But I don't think we have to worry about such a pathological case. ;) Satoshi ------- Index: bsd.port.mk =================================================================== RCS file: /usr/cvs/src/share/mk/bsd.port.mk,v retrieving revision 1.187 diff -u -r1.187 bsd.port.mk --- bsd.port.mk 1995/11/17 16:49:40 1.187 +++ bsd.port.mk 1995/11/22 12:41:31 @@ -1005,16 +1005,34 @@ @for i in ${DEPENDS_TMP}; do \ prog=`/bin/echo $$i | /usr/bin/sed -e 's/:.*//'`; \ dir=`/bin/echo $$i | /usr/bin/sed -e 's/.*://'`; \ - ${ECHO_MSG} "===> ${PKGNAME} depends on executable: $$prog ($$dir)"; \ + if expr "$$prog" : \\/ >/dev/null; then \ + ${ECHO_MSG} "===> ${PKGNAME} depends on file: $$prog ($$dir)"; \ + else \ + ${ECHO_MSG} "===> ${PKGNAME} depends on executable: $$prog ($$dir)"; \ + fi; \ done .else @for i in ${DEPENDS_TMP}; do \ prog=`/bin/echo $$i | /usr/bin/sed -e 's/:.*//'`; \ dir=`/bin/echo $$i | /usr/bin/sed -e 's/.*://'`; \ - if which -s "$$prog"; then \ - ${ECHO_MSG} "===> ${PKGNAME} depends on executable: $$prog - found"; \ + if expr "$$prog" : \\/ >/dev/null; then \ + if [ -e "$$prog" ]; then \ + ${ECHO_MSG} "===> ${PKGNAME} depends on file: $$prog - found"; \ + notfound=0; \ + else \ + ${ECHO_MSG} "===> ${PKGNAME} depends on file: $$prog - not found"; \ + notfound=1; \ + fi; \ else \ - ${ECHO_MSG} "===> ${PKGNAME} depends on executable: $$prog - not found"; \ + if which -s "$$prog"; then \ + ${ECHO_MSG} "===> ${PKGNAME} depends on executable: $$prog - found"; \ + notfound=0; \ + else \ + ${ECHO_MSG} "===> ${PKGNAME} depends on executable: $$prog - not found"; \ + notfound=1; \ + fi; \ + fi; \ + if [ $$notfound != 0 ]; then \ ${ECHO_MSG} "===> Verifying build for $$prog in $$dir"; \ if [ ! -d "$$dir" ]; then \ ${ECHO_MSG} ">> No directory for $$prog. Skipping.."; \