ports/178807: [patch] bsd.port.mk: let PORTDATA deal with empty directories

Tijl Coosemans tijl at FreeBSD.org
Tue May 21 11:10:00 UTC 2013


>Number:         178807
>Category:       ports
>Synopsis:       [patch] bsd.port.mk: let PORTDATA deal with empty directories
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue May 21 11:10:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Tijl Coosemans
>Release:        FreeBSD 10.0-CURRENT i386
>Organization:
>Environment:
>Description:
I'm working on an update for lang/sdcc and would like to simplify
its pkg-plist in the process because at 1000+ lines and many
possible combinations of options it's a lot of work to maintain
compared to just having PORTDATA=* in the Makefile.

The problem however is that depending on options some of the
PORTDATA directories installed may be empty. Rather than dealing
with this in the port it would be nice if bsd.port.mk could handle
that automatically.

The attached patch accomplishes that for PORTDATA, PORTDOCS and
PORTEXAMPLES. The added commands are based on the ones for @dirrm.
>How-To-Repeat:
>Fix:

--- bsd.port.mk.emptydir.patch begins here ---
Index: bsd.port.mk
===================================================================
--- bsd.port.mk	(revision 318580)
+++ bsd.port.mk	(working copy)
@@ -5699,6 +5699,8 @@ add-plist-docs:
 .endfor
 	@${FIND} -P ${PORTDOCS:S/^/${DOCSDIR}\//} ! -type d 2>/dev/null | \
 		${SED} -ne 's,^${PREFIX}/,,p' >> ${TMPPLIST}
+	@${FIND} -P ${PORTDOCS:S/^/${DOCSDIR}\//} -type d -empty 2>/dev/null | \
+		${SED} -ne 's,^${PREFIX}/, at exec ${MKDIR} %D/,p' >> ${TMPPLIST}
 	@${FIND} -P -d ${PORTDOCS:S/^/${DOCSDIR}\//} -type d 2>/dev/null | \
 		${SED} -ne 's,^${PREFIX}/, at dirrm ,p' >> ${TMPPLIST}
 	@${ECHO_CMD} "@dirrm ${DOCSDIR_REL}" >> ${TMPPLIST}
@@ -5723,6 +5725,8 @@ add-plist-examples:
 .endfor
 	@${FIND} -P ${PORTEXAMPLES:S/^/${EXAMPLESDIR}\//} ! -type d 2>/dev/null | \
 		${SED} -ne 's,^${PREFIX}/,,p' >> ${TMPPLIST}
+	@${FIND} -P ${PORTEXAMPLES:S/^/${EXAMPLESDIR}\//} -type d -empty 2>/dev/null | \
+		${SED} -ne 's,^${PREFIX}/, at exec ${MKDIR} %D/,p' >> ${TMPPLIST}
 	@${FIND} -P -d ${PORTEXAMPLES:S/^/${EXAMPLESDIR}\//} -type d 2>/dev/null | \
 		${SED} -ne 's,^${PREFIX}/, at dirrm ,p' >> ${TMPPLIST}
 	@${ECHO_CMD} "@dirrm ${EXAMPLESDIR:S,^${PREFIX}/,,}" >> ${TMPPLIST}
@@ -5747,6 +5751,8 @@ add-plist-data:
 .endfor
 	@${FIND} -P ${PORTDATA:S/^/${DATADIR}\//} ! -type d 2>/dev/null | \
 		${SED} -ne 's,^${PREFIX}/,,p' >> ${TMPPLIST}
+	@${FIND} -P ${PORTDATA:S/^/${DATADIR}\//} -type d -empty 2>/dev/null | \
+		${SED} -ne 's,^${PREFIX}/, at exec ${MKDIR} %D/,p' >> ${TMPPLIST}
 	@${FIND} -P -d ${PORTDATA:S/^/${DATADIR}\//} -type d 2>/dev/null | \
 		${SED} -ne 's,^${PREFIX}/, at dirrm ,p' >> ${TMPPLIST}
 	@${ECHO_CMD} "@dirrm ${DATADIR:S,^${PREFIX}/,,}" >> ${TMPPLIST}
--- bsd.port.mk.emptydir.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-ports-bugs mailing list