From owner-freebsd-ports-bugs@FreeBSD.ORG Tue May 21 11:10:00 2013 Return-Path: Delivered-To: freebsd-ports-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A62B61C7 for ; Tue, 21 May 2013 11:10:00 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 88F14916 for ; Tue, 21 May 2013 11:10:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r4LBA0sG084826 for ; Tue, 21 May 2013 11:10:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r4LBA04W084825; Tue, 21 May 2013 11:10:00 GMT (envelope-from gnats) Resent-Date: Tue, 21 May 2013 11:10:00 GMT Resent-Message-Id: <201305211110.r4LBA04W084825@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Tijl Coosemans Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 85A031AB for ; Tue, 21 May 2013 11:09:04 +0000 (UTC) (envelope-from tijl@coosemans.org) Received: from mailrelay004.isp.belgacom.be (mailrelay004.isp.belgacom.be [195.238.6.170]) by mx1.freebsd.org (Postfix) with ESMTP id 2713090B for ; Tue, 21 May 2013 11:09:03 +0000 (UTC) Received: from 250.97-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.97.250]) by relay.skynet.be with ESMTP; 21 May 2013 13:07:52 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.7/8.14.7) with ESMTP id r4LB7pX4002431 for ; Tue, 21 May 2013 13:07:51 +0200 (CEST) (envelope-from tijl@kalimero.tijl.coosemans.org) Received: (from tijl@localhost) by kalimero.tijl.coosemans.org (8.14.7/8.14.7/Submit) id r4LB7pmZ002430; Tue, 21 May 2013 13:07:51 +0200 (CEST) (envelope-from tijl) Message-Id: <201305211107.r4LB7pmZ002430@kalimero.tijl.coosemans.org> Date: Tue, 21 May 2013 13:07:51 +0200 (CEST) From: Tijl Coosemans To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.114 Subject: ports/178807: [patch] bsd.port.mk: let PORTDATA deal with empty directories X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Tijl Coosemans List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 May 2013 11:10:00 -0000 >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}/,@exec ${MKDIR} %D/,p' >> ${TMPPLIST} @${FIND} -P -d ${PORTDOCS:S/^/${DOCSDIR}\//} -type d 2>/dev/null | \ ${SED} -ne 's,^${PREFIX}/,@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}/,@exec ${MKDIR} %D/,p' >> ${TMPPLIST} @${FIND} -P -d ${PORTEXAMPLES:S/^/${EXAMPLESDIR}\//} -type d 2>/dev/null | \ ${SED} -ne 's,^${PREFIX}/,@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}/,@exec ${MKDIR} %D/,p' >> ${TMPPLIST} @${FIND} -P -d ${PORTDATA:S/^/${DATADIR}\//} -type d 2>/dev/null | \ ${SED} -ne 's,^${PREFIX}/,@dirrm ,p' >> ${TMPPLIST} @${ECHO_CMD} "@dirrm ${DATADIR:S,^${PREFIX}/,,}" >> ${TMPPLIST} --- bsd.port.mk.emptydir.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: