Bug 173892 - Mk/bsd.port.mk: make COPYTREE_SHARE handle symbolic links
Summary: Mk/bsd.port.mk: make COPYTREE_SHARE handle symbolic links
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Bryan Drewery
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-24 16:50 UTC by Thierry Thomas
Modified: 2013-10-28 13:10 UTC (History)
1 user (show)

See Also:


Attachments
bsd.port.mk.diff (824 bytes, patch)
2012-11-24 16:50 UTC, Thierry Thomas
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thierry Thomas freebsd_committer freebsd_triage 2012-11-24 16:50:00 UTC
	Weekly run output alerted me that lang/cfortran installs several links
	with a bad ownership:

$ find /usr/local/share/examples/cfortran -type l -ls | head
3442403        0 lrwxrwxrwx    1 8290             1300                    5 15 déc  1995 /usr/local/share/examples/cfortran/abc/abc.C -> abc.c
3442405        0 lrwxrwxrwx    1 8290             1300                    6 15 déc  1995 /usr/local/share/examples/cfortran/cf14/cf14.C -> cf14.c
3442407        0 lrwxrwxrwx    1 8290             1300                   16 15 déc  1995 /usr/local/share/examples/cfortran/e2/e2_f.f -> ../easy/easy_f.f
3442408        0 lrwxrwxrwx    1 8290             1300                    4 15 déc  1995 /usr/local/share/examples/cfortran/e2/e2.C -> e2.c
3442410        0 lrwxrwxrwx    1 8290             1300                    6 15 déc  1995 /usr/local/share/examples/cfortran/easy/easy.C -> easy.c
3442412        0 lrwxrwxrwx    1 8290             1300                    4 15 déc  1995 /usr/local/share/examples/cfortran/eq/eq.C -> eq.c
3442414        0 lrwxrwxrwx    1 8290             1300                    4 15 déc  1995 /usr/local/share/examples/cfortran/f0/f0.C -> f0.c
3442416        0 lrwxrwxrwx    1 8290             1300                    5 23 oct  1996 /usr/local/share/examples/cfortran/f20/f20.C -> f20.c
3442418        0 lrwxrwxrwx    1 8290             1300                    5 29 jul  1998 /usr/local/share/examples/cfortran/f27/f27.C -> f27.c
3442420        0 lrwxrwxrwx    1 8290             1300                    4 15 déc  1995 /usr/local/share/examples/cfortran/fa/fa.C -> fa.c

Fix: Add -h to chown, so that COPYTREE_SHARE will handle symbolic
	links.

	I have no example of this bug for COPYTREE_BIN, but guess it
	should be handled in the same way.

	Note: gahr@ is Cc:'ed because if this patch get committed, at
	least PORTREVISION of lang/cfortran should be bumped.
How-To-Repeat: 
	- Install lang/cfortran
	- find /usr/local/share/examples/cfortran -type l -ls
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2012-11-24 16:50:07 UTC
Responsible Changed
From-To: freebsd-ports-bugs->portmgr

bsd.port.mk is portmgr territory (via the GNATS Auto Assign Tool)
Comment 2 Bryan Drewery freebsd_committer freebsd_triage 2013-10-27 13:44:31 UTC
Responsible Changed
From-To: portmgr->bdrewery

take for exp-run
Comment 3 dfilter service freebsd_committer freebsd_triage 2013-10-28 13:08:27 UTC
Author: bdrewery
Date: Mon Oct 28 13:08:14 2013
New Revision: 331851
URL: http://svnweb.freebsd.org/changeset/ports/331851

Log:
  - Fix COPYTREE_BIN and COPYTREE_SHARE so that installed symlinks
    have proper permissions set.
  
  PR:		ports/173892
  Submitted by:	thierry
  With hat:	portmgr

Modified:
  head/Mk/bsd.port.mk

Modified: head/Mk/bsd.port.mk
==============================================================================
--- head/Mk/bsd.port.mk	Mon Oct 28 13:06:43 2013	(r331850)
+++ head/Mk/bsd.port.mk	Mon Oct 28 13:08:14 2013	(r331851)
@@ -2334,12 +2334,12 @@ SCRIPTS_ENV+=	${INSTALL_MACROS}
 .if ${UID} == 0
 COPYTREE_BIN=	${SH} -c '(${FIND} -d $$0 $$2 | ${CPIO} -dumpl $$1 >/dev/null \
 					2>&1) && \
-					${CHOWN} -R ${BINOWN}:${BINGRP} $$1 && \
+					${CHOWN} -Rh ${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 \
 					2>&1) && \
-					${CHOWN} -R ${SHAREOWN}:${SHAREGRP} $$1 && \
+					${CHOWN} -Rh ${SHAREOWN}:${SHAREGRP} $$1 && \
 					${FIND} -d $$0 $$2 -type d -exec chmod 755 $$1/{} \; && \
 					${FIND} -d $$0 $$2 -type f -exec chmod ${SHAREMODE} $$1/{} \;' --
 .else
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 4 Bryan Drewery freebsd_committer freebsd_triage 2013-10-28 13:08:40 UTC
Heads up, this is now committed if some portrevision bumps were wanted.
-- 
Regards,
Bryan Drewery
Comment 5 Bryan Drewery freebsd_committer freebsd_triage 2013-10-28 13:08:52 UTC
State Changed
From-To: open->closed

Committed. Thanks!