ports/121681: bsd.port.mk unnecessary touches two files in ${PREFIX} during every install

Maxim Sobolev sobomax at FreeBSD.org
Thu Mar 13 22:40:02 UTC 2008


>Number:         121681
>Category:       ports
>Synopsis:       bsd.port.mk unnecessary touches two files in ${PREFIX} during every install
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 13 22:40:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Maxim Sobolev
>Release:        6.3-RELEASE
>Organization:
Sippy Software, Inc.
>Environment:
FreeBSD pioneer.sippysoft.com 6.3-RELEASE FreeBSD 6.3-RELEASE #1: Tue Jan 15 12:54:53 PST 2008     root at pioneer.sippysoft.com:/usr/obj/usr/src/sys/PIONEER  amd64
>Description:
The bsd.port.mk is unconditionally removes and creates again two symbolic links in ${PREFIX} when doing install of the port. This is annoying behaviour, since when preparing upgrade to a port maintainers like myself often use `find -cmin' to locate any files that are not in the packaging list, and those two links pop up every time.

Attached patch fixes that behaviour, by only creating those links when necessary.

It should not have any other effects.

-Maxim
>How-To-Repeat:
cd /usr/ports/foo/bar; sudo make all install deinstall; sudo find /usr/local -cmin -5
>Fix:


Patch attached with submission follows:

--- Mk/bsd.port.mk	2008/03/13 22:13:05	1.1
+++ Mk/bsd.port.mk	2008/03/13 22:19:24
@@ -2243,6 +2243,8 @@
 MTREE_CMD?=	/usr/sbin/mtree
 MTREE_ARGS?=	-U ${MTREE_FOLLOWS_SYMLINKS} -f ${MTREE_FILE} -d -e -p
 
+READLINK_CMD?=	/usr/bin/readlink
+
 # Determine whether or not we can use rootly owner/group functions.
 .if !defined(UID)
 UID!=	${ID} -u
@@ -3854,8 +3856,13 @@
 			${MTREE_CMD} ${MTREE_ARGS} ${PREFIX}/ >/dev/null; \
 			if [ ${PREFIX} = ${LOCALBASE} ]; then \
 				cd ${PREFIX}/share/nls; \
-				${LN} -shf C POSIX; \
-				${LN} -shf C en_US.US-ASCII; \
+				for link in POSIX en_US.US-ASCII; \
+				do \
+					if [ x"`${READLINK_CMD} $${link}`" != x"C" ]; \
+					then \
+						${LN} -shf C $${link}; \
+					fi; \
+				done; \
 			fi; \
 		fi; \
 	else \


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



More information about the freebsd-ports-bugs mailing list