Today I had a port which installed its docs into /usr/local/share/docs/blaat. At least, that was the expected behaviour. What the port did not do was creating that directory first, and thus was copying the files over the file /usr/local/share/docs/blaat each time. All with all very annoying, and I was surprised that the ports framework didn't alert me about it while running "make deinstall". When looking at add-plist-docs, it only adds the files in PORTDOCS which it can find (although find(1) gives a warning it is /dev/nulled). At the end of it only adds the DOCSDIR if it is a directory. Although it is a discussion issue to start with, it is my opinion that the variables set in the ports Makefile have to be correct. And if they are not, bsd.port.mk should warn us about them being wrong (USE_LIBTOOL_VER=14 is a nice example) instead of being Mr Nice Guy and fix it behind our backs. Fix: This will make bsd.port.mk / add-plist-docs less tolerant to mistakes. How-To-Repeat: Checkout ports/dns/sqldjbdns/Makefile revision 1.1, and wonder why an install / deinstall you have a file called /usr/local/share/docs/sqldjbdns leftover.
Responsible Changed From-To: freebsd-ports-bugs->portmgr involves bsd.port.mk.
> +.for x in ${PORTDOCS} > + # Create a file for every file which is defined but does not exist > + # so that pkg_delete(1)/pkg_create(1) complains about missing files. > + if [ ! -e ${DOCSDIR}/${x} ]; then \ > + ${ECHO_CMD} ${DOCSDIR}/${x} | \ > + ${SED} -e 's,^${PREFIX}/,,' >> ${TMPPLIST}; \ > + fi > +.endfor > @${FIND} -P ${PORTDOCS:S/^/${DOCSDIR}\//} ! -type d 2>/dev/null | \ > ${SED} -ne 's,^${PREFIX}/,,p' >> ${TMPPLIST} > @${FIND} -P -d ${PORTDOCS:S/^/${DOCSDIR}\//} -type d 2>/dev/null | \ > ${SED} -ne 's,^${PREFIX}/,@dirrm ,p' >> ${TMPPLIST} > - @if [ -d "${DOCSDIR}" ]; then \ > - ${ECHO_CMD} "@unexec rmdir %D/${DOCSDIR:S,^${PREFIX}/,,} 2>/dev/null || true" >> ${TMPPLIST}; \ > - fi > + ${ECHO_CMD} "@dirrm ${DOCSDIR:S,^${PREFIX}/,,}" >> ${TMPPLIST} > .else > @${DO_NADA} JFYI: I removed the comments and added '@' to 'if' and ${ECHO_CMD} to supress the superfluous output. -Kirill
State Changed From-To: open->closed Committed, thanks!