ports/150547: Fix bsd.gcc.mk to allow for INSTALL_AS_USER when BINOWN et al are used

Gerald Pfeifer gerald at pfeifer.com
Tue Sep 14 01:00:04 UTC 2010


>Number:         150547
>Category:       ports
>Synopsis:       Fix bsd.gcc.mk to allow for INSTALL_AS_USER when BINOWN et al are used
>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:   Tue Sep 14 01:00:03 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Gerald Pfeifer
>Release:        FreeBSD 8.1-RELEASE i386
>Organization:
>Environment:
>Description:
	It turns out that some ports, notably graphics/png fail in
	the installation phase when INSTALL_AS_USER is used.  This
	is unfortunate, but at least in the case of graphics/png
	and presumably a number of others easy to fix generically.
>How-To-Repeat:
	Install graphics/png as non-root with INSTALL_AS_USER=1.
>Fix:
	Patch below.

	It might be interesting to see how two pointyhat runs that
	install as a user and INSTALL_AS_USER=1 turn out -- one prior
	to this patch, one with it.

Index: bsd.port.mk
===================================================================
RCS file: /home/pcvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.644
diff -u -r1.644 bsd.port.mk
--- bsd.port.mk	20 Aug 2010 12:15:02 -0000	1.644
+++ bsd.port.mk	14 Sep 2010 00:47:10 -0000
@@ -2385,6 +2385,7 @@
 # Determine whether or not we can use rootly owner/group functions.
 .if !defined(UID)
 UID!=	${ID} -u
+USER!=	${ID} -un
 .endif
 .if ${UID} == 0
 _BINOWNGRP=	-o ${BINOWN} -g ${BINGRP}
@@ -2394,6 +2395,8 @@
 _BINOWNGRP=
 _SHROWNGRP=
 _MANOWNGRP=
+# The following are for ports directly using them.
+MAKE_ENV+=	BINOWN=${USER} BINGRP=${USER} MANOWN=${USER} MANGRP=${USER}
 .endif
 
 # A few aliases for *-install targets
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list