Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Feb 2012 04:58:29 -0900 (AKST)
From:      Mel Flynn <rflynn@acsalaska.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        portmgr@FreeBSD.org
Subject:   ports/165450: [patch] Mk/bsd.port.mk: COPYTREE_* macro enhancements
Message-ID:  <201202241358.q1ODwTw0073105@datakitty.lan.rachie.is-a-geek.net>
Resent-Message-ID: <201202241400.q1OE0TS5039566@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         165450
>Category:       ports
>Synopsis:       [patch] Mk/bsd.port.mk: COPYTREE_* macro enhancements
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Feb 24 14:00:28 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Mel Flynn
>Release:        FreeBSD 8.2-STABLE amd64
>Organization:
>Environment:
System: FreeBSD datakitty.lan.rachie.is-a-geek.net 8.2-STABLE FreeBSD 8.2-STABLE #6 r230977: Sun Feb 5 06:20:11 AKST 2012 mel@datakitty.lan.rachie.is-a-geek.net:/data/obj/data/RELENG_8/src/sys/GENERIC amd64


>Description:
The COPYTREE_ macros use depth-first traversal, which makes -prune not
useable. Additionally it does not use the + terminator for the -exec
primary and does not silence stdout on the mode changes, which generates
a lot of output when -print is used as a find primary.

>How-To-Repeat:
Use the following in a port:
do-install:
	@cd ${WRKSRC} && ${COPYTREE_SHARE} . ${WWWDIR} \
		'-name somedir -prune -o -print'
>Fix:

--- copytree_share.patch begins here ---
Index: Mk/bsd.port.mk
===================================================================
RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.706
diff -u -r1.706 bsd.port.mk
--- Mk/bsd.port.mk	22 Feb 2012 17:34:47 -0000	1.706
+++ Mk/bsd.port.mk	24 Feb 2012 13:36:07 -0000
@@ -2372,25 +2372,33 @@
 
 # Macro for copying entire directory tree with correct permissions
 .if ${UID} == 0
-COPYTREE_BIN=	${SH} -c '(${FIND} -d $$0 $$2 | ${CPIO} -dumpl $$1 >/dev/null \
+COPYTREE_BIN=	${SH} -c '(${FIND} $$0 $$2 | ${CPIO} -dumpl $$1 >/dev/null \
 					2>&1) && \
 					${CHOWN} -R ${BINOWN}:${BINGRP} $$1 && \
-					${FIND} -d $$0 $$2 -type d -exec chmod 755 $$1/{} \; && \
-					${FIND} -d $$0 $$2 -type f -exec chmod ${BINMODE} $$1/{} \;' --
-COPYTREE_SHARE=	${SH} -c '(${FIND} -d $$0 $$2 | ${CPIO} -dumpl $$1 >/dev/null \
+					${FIND} $$0 $$2 -type d -exec chmod 755 $$1/{} + \
+					>/dev/null && \
+					${FIND} $$0 $$2 -type f -exec chmod ${BINMODE} $$1/{} + \
+					>/dev/null ' --
+COPYTREE_SHARE=	${SH} -c '(${FIND} $$0 $$2 | ${CPIO} -dumpl $$1 >/dev/null \
 					2>&1) && \
 					${CHOWN} -R ${SHAREOWN}:${SHAREGRP} $$1 && \
-					${FIND} -d $$0 $$2 -type d -exec chmod 755 $$1/{} \; && \
-					${FIND} -d $$0 $$2 -type f -exec chmod ${SHAREMODE} $$1/{} \;' --
+					${FIND} $$0 $$2 -type d -exec chmod 755 $$1/{} + \
+					>/dev/null && \
+					${FIND} $$0 $$2 -type f -exec chmod ${SHAREMODE} $$1/{} + \
+					>/dev/null' --
 .else
-COPYTREE_BIN=	${SH} -c '(${FIND} -d $$0 $$2 | ${CPIO} -dumpl $$1 >/dev/null \
+COPYTREE_BIN=	${SH} -c '(${FIND} $$0 $$2 | ${CPIO} -dumpl $$1 >/dev/null \
 					2>&1) && \
-					${FIND} -d $$0 $$2 -type d -exec chmod 755 $$1/{} \; && \
-					${FIND} -d $$0 $$2 -type f -exec chmod ${BINMODE} $$1/{} \;' --
-COPYTREE_SHARE=	${SH} -c '(${FIND} -d $$0 $$2 | ${CPIO} -dumpl $$1 >/dev/null \
+					${FIND} $$0 $$2 -type d -exec chmod 755 $$1/{} + \
+				   	>/dev/null && \
+					${FIND} $$0 $$2 -type f -exec chmod ${BINMODE} $$1/{} + \
+					>/dev/null' --
+COPYTREE_SHARE=	${SH} -c '(${FIND} $$0 $$2 | ${CPIO} -dumpl $$1 >/dev/null \
 					2>&1) && \
-					${FIND} -d $$0 $$2 -type d -exec chmod 755 $$1/{} \; && \
-					${FIND} -d $$0 $$2 -type f -exec chmod ${SHAREMODE} $$1/{} \;' --
+					${FIND} $$0 $$2 -type d -exec chmod 755 $$1/{} + \
+					>/dev/null && \
+					${FIND} $$0 $$2 -type f -exec chmod ${SHAREMODE} $$1/{} + \
+					>/dev/null' --
 .endif
 
 # The user can override the NO_PACKAGE by specifying this from
--- copytree_share.patch ends here ---

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201202241358.q1ODwTw0073105>