From 4434fa54eccf4fa0896d9f01cd93c91ab718ec2c Mon Sep 17 00:00:00 2001 From: agc Date: Tue, 28 Oct 1997 12:46:37 +0000 Subject: When a package depends on an executable from another package, bsd.port.mk would always find the executable (using which), even if there wasn't an executable in the $PATH. I've modified bsd.port.mk to look for the executable directly, and simplified the shell code somewhat in the process. There may be a lurking bug in shell exit status handling here. Noted by matthew green and Chris Demetriou (PR pkg/4337) but I was too stupid to realise what was happening. That, and a copy of gmake in /usr/local/bin. --- mk/bsd.pkg.mk | 21 ++++++++++----------- mk/bsd.port.mk | 21 ++++++++++----------- 2 files changed, 20 insertions(+), 22 deletions(-) (limited to 'mk') diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk index 1840143f7f6..35f79fc49c8 100644 --- a/mk/bsd.pkg.mk +++ b/mk/bsd.pkg.mk @@ -2,7 +2,7 @@ # ex:ts=4 # # Id: bsd.port.mk,v 1.263 1997/07/17 17:47:36 markm Exp -# $NetBSD: bsd.pkg.mk,v 1.13 1997/10/18 23:33:25 hubertf Exp $ +# $NetBSD: bsd.pkg.mk,v 1.14 1997/10/28 12:46:37 agc Exp $ # # bsd.port.mk - 940820 Jordan K. Hubbard. # This file is in the public domain. @@ -1562,24 +1562,23 @@ _DEPENDS_USE: .USE else \ target=${DEPENDS_TARGET}; \ fi; \ + found=not; \ if expr "$$prog" : \\/ >/dev/null; then \ if [ -e "$$prog" ]; then \ ${ECHO_MSG} "===> ${PKGNAME} depends on file: $$prog - found"; \ - notfound=0; \ + found=""; \ else \ ${ECHO_MSG} "===> ${PKGNAME} depends on file: $$prog - not found"; \ - notfound=1; \ fi; \ else \ - if which "$$prog" > /dev/null 2>&1 ; then \ - ${ECHO_MSG} "===> ${PKGNAME} depends on executable: $$prog - found"; \ - notfound=0; \ - else \ - ${ECHO_MSG} "===> ${PKGNAME} depends on executable: $$prog - not found"; \ - notfound=1; \ - fi; \ + for d in `echo $$PATH | tr ':' ' '`; do \ + if [ -x $$d/$$prog ]; then \ + found=""; \ + fi \ + done; \ + ${ECHO_MSG} "===> ${PKGNAME} depends on executable: $$prog - $$found found"; \ fi; \ - if [ $$notfound != 0 ]; then \ + if [ X"$$found" = Xnot ]; then \ ${ECHO_MSG} "===> Verifying $$target for $$prog in $$dir"; \ if [ ! -d "$$dir" ]; then \ ${ECHO_MSG} ">> No directory for $$prog. Skipping.."; \ diff --git a/mk/bsd.port.mk b/mk/bsd.port.mk index b0020fe6b2f..9973b0a3a25 100644 --- a/mk/bsd.port.mk +++ b/mk/bsd.port.mk @@ -2,7 +2,7 @@ # ex:ts=4 # # Id: bsd.port.mk,v 1.263 1997/07/17 17:47:36 markm Exp -# $NetBSD: bsd.port.mk,v 1.13 1997/10/18 23:33:25 hubertf Exp $ +# $NetBSD: bsd.port.mk,v 1.14 1997/10/28 12:46:37 agc Exp $ # # bsd.port.mk - 940820 Jordan K. Hubbard. # This file is in the public domain. @@ -1562,24 +1562,23 @@ _DEPENDS_USE: .USE else \ target=${DEPENDS_TARGET}; \ fi; \ + found=not; \ if expr "$$prog" : \\/ >/dev/null; then \ if [ -e "$$prog" ]; then \ ${ECHO_MSG} "===> ${PKGNAME} depends on file: $$prog - found"; \ - notfound=0; \ + found=""; \ else \ ${ECHO_MSG} "===> ${PKGNAME} depends on file: $$prog - not found"; \ - notfound=1; \ fi; \ else \ - if which "$$prog" > /dev/null 2>&1 ; then \ - ${ECHO_MSG} "===> ${PKGNAME} depends on executable: $$prog - found"; \ - notfound=0; \ - else \ - ${ECHO_MSG} "===> ${PKGNAME} depends on executable: $$prog - not found"; \ - notfound=1; \ - fi; \ + for d in `echo $$PATH | tr ':' ' '`; do \ + if [ -x $$d/$$prog ]; then \ + found=""; \ + fi \ + done; \ + ${ECHO_MSG} "===> ${PKGNAME} depends on executable: $$prog - $$found found"; \ fi; \ - if [ $$notfound != 0 ]; then \ + if [ X"$$found" = Xnot ]; then \ ${ECHO_MSG} "===> Verifying $$target for $$prog in $$dir"; \ if [ ! -d "$$dir" ]; then \ ${ECHO_MSG} ">> No directory for $$prog. Skipping.."; \ -- cgit v1.2.3