ports/165450: [patch] Mk/bsd.port.mk: COPYTREE_* macro enhancements
Mel Flynn
rflynn at acsalaska.net
Fri Feb 24 14:00:30 UTC 2012
>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 at 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:
More information about the freebsd-ports-bugs
mailing list