From owner-freebsd-ports Wed Jan 15 00:19:14 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id AAA16364 for ports-outgoing; Wed, 15 Jan 1997 00:19:14 -0800 (PST) Received: from dfw-ix10.ix.netcom.com (dfw-ix10.ix.netcom.com [206.214.98.10]) by freefall.freebsd.org (8.8.4/8.8.4) with SMTP id AAA16359; Wed, 15 Jan 1997 00:19:10 -0800 (PST) Received: from silvia.HIP.Berkeley.EDU (wck-ca5-19.ix.netcom.com [199.35.213.179]) by dfw-ix10.ix.netcom.com (8.6.13/8.6.12) with ESMTP id AAA17992; Wed, 15 Jan 1997 00:18:36 -0800 Received: (from asami@localhost) by silvia.HIP.Berkeley.EDU (8.8.4/8.6.9) id AAA04539; Wed, 15 Jan 1997 00:18:34 -0800 (PST) Date: Wed, 15 Jan 1997 00:18:34 -0800 (PST) Message-Id: <199701150818.AAA04539@silvia.HIP.Berkeley.EDU> To: ports@freebsd.org, jkh@freebsd.org Subject: please test (+REQUIRED_BY support) From: asami@vader.cs.berkeley.edu (Satoshi Asami) Sender: owner-ports@freebsd.org X-Loop: FreeBSD.org Precedence: bulk The following patch adds support for the +REQUIRED_BY file in /var/db/pkg. If you make install port A, and then port B that depends on port B, you will no longer see the "can't open +REQUIRED_BY" when you do a pkg_delete on B. (And more importantly, pkg_delete will complain if you try to remove port A.) It will check for the existence of the directory of the depended port, then see if the line already exists (note grep will return false if the file doesn't exist or the line doesn't exist) and adds it if it doesn't. It will not create a directory or the depended port if it doesn't exist. I will be back on Saturday, so please test it before then. Satoshi ------- Index: bsd.port.mk =================================================================== RCS file: /usr/cvs/src/share/mk/bsd.port.mk,v retrieving revision 1.247 diff -u -r1.247 bsd.port.mk --- bsd.port.mk 1997/01/14 06:33:27 1.247 +++ bsd.port.mk 1997/01/15 05:52:01 @@ -1598,6 +1598,14 @@ if [ -f ${PKGDIR}/REQ ]; then \ ${CP} ${PKGDIR}/REQ ${PKG_DBDIR}/${PKGNAME}/+REQ; \ fi; \ + for dep in `make package-depends | sort -u`; do \ + if [ -d ${PKG_DBDIR}/$$dep ]; then \ + if ! ${GREP} ^${PKGNAME}$$ ${PKG_DBDIR}/$$dep/+REQUIRED_BY \ + >/dev/null 2>&1; then \ + ${ECHO} ${PKGNAME} >> ${PKG_DBDIR}/$$dep/+REQUIRED_BY; \ + fi; \ + fi; \ + done; \ else \ ${ECHO_MSG} "===> ${PKGNAME} is already installed - perhaps an older version?"; \ ${ECHO_MSG} " If so, you may wish to \`\`pkg_delete ${PKGNAME}'' and install"; \