Date: Wed, 15 Jan 1997 00:18:34 -0800 (PST) From: asami@vader.cs.berkeley.edu (Satoshi Asami) To: ports@freebsd.org, jkh@freebsd.org Subject: please test (+REQUIRED_BY support) Message-ID: <199701150818.AAA04539@silvia.HIP.Berkeley.EDU>
next in thread | raw e-mail | index | archive | help
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"; \
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199701150818.AAA04539>