patch: ports/Mk/bsd.port.mk:add-plist-docs

Brandon D. Valentine brandon at dvalentine.com
Thu Feb 12 01:11:18 PST 2004


I have seen many ports use a construct similar to this in the do-install
target:

    .if !defined(NOPORTDOCS)
            @${MKDIR} ${DOCSDIR}
            @${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}
    .endif

Now, all of the ports I've seen do this have a corresponding:

    %%PORTDOCS%%@rmdir %%DOCSDIR%%

or similiar in their pkg-plist.  If NOPORTDOCS is defined, then a
deinstall of these ports will complain about not being able to remove
DOCSDIR due to that line in the pkg-plist.  That line shouldn't exist in
the PLIST if NOPORTDOCS is defined, which means it should be added to
the TMPPLIST at install time rather than hardcoded in the pkg-plist
file.

The current add-plist-docs target does this if and only if PORTDOCS is
set.  It should do it in all cases.  I have attached a patch to fix
this.  The patch is untested as my only test machine is undergoing a
massive portupgrade at the moment.

I'd appreciate some feedback on this.

Thanks,

Brandon D. Valentine
-- 
brandon at dvalentine.com                           http://www.geekpunk.net
Pseudo-Random Googlism:  february is "kindness" month at hillendale
-------------- next part --------------
Index: ports/Mk/bsd.port.mk
===================================================================
RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.484
diff -u -r1.484 bsd.port.mk
--- ports/Mk/bsd.port.mk	4 Feb 2004 04:27:04 -0000	1.484
+++ ports/Mk/bsd.port.mk	12 Feb 2004 09:07:42 -0000
@@ -4896,12 +4896,12 @@
 		${SED} -ne 's,^${PREFIX}/,,p' >> ${TMPPLIST}
 	@${FIND} -P -d ${PORTDOCS:S/^/${DOCSDIR}\//} -type d 2>/dev/null | \
 		${SED} -ne 's,^${PREFIX}/, at dirrm ,p' >> ${TMPPLIST}
-	@if [ -d "${DOCSDIR}" ]; then \
-		${ECHO_CMD} "@unexec rmdir %D/${DOCSDIR:S,^${PREFIX}/,,} 2>/dev/null || true" >> ${TMPPLIST}; \
-	fi
 .else
 	@${DO_NADA}
 .endif
+	@if [ -d "${DOCSDIR}" ]; then \
+		${ECHO_CMD} "@unexec rmdir %D/${DOCSDIR:S,^${PREFIX}/,,} 2>/dev/null || true" >> ${TMPPLIST}; \
+	fi
 .endif
 
 add-plist-info:


More information about the freebsd-ports mailing list