diff options
author | agc <agc@pkgsrc.org> | 1997-10-28 12:46:37 +0000 |
---|---|---|
committer | agc <agc@pkgsrc.org> | 1997-10-28 12:46:37 +0000 |
commit | 4434fa54eccf4fa0896d9f01cd93c91ab718ec2c (patch) | |
tree | 6c0c9fff24578f0b89abfa3427292a19684dad15 /mk | |
parent | c20852e7a7602ef4890c0754f2a7dbdb309fda48 (diff) | |
download | pkgsrc-4434fa54eccf4fa0896d9f01cd93c91ab718ec2c.tar.gz |
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 <mrg@madrugada.eterna.com.au> and Chris
Demetriou <cgd@netbsd.org> (PR pkg/4337) but I was too stupid to
realise what was happening. That, and a copy of gmake in
/usr/local/bin.
Diffstat (limited to 'mk')
-rw-r--r-- | mk/bsd.pkg.mk | 21 | ||||
-rw-r--r-- | mk/bsd.port.mk | 21 |
2 files changed, 20 insertions, 22 deletions
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.."; \ |