Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 May 2017 21:15:05 +0000 (UTC)
From:      Eric van Gyzen <vangyzen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r319356 - stable/11/share/mk
Message-ID:  <201705312115.v4VLF5iF048386@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: vangyzen
Date: Wed May 31 21:15:05 2017
New Revision: 319356
URL: https://svnweb.freebsd.org/changeset/base/319356

Log:
  MFC r319020
  
  Fix INSTALL_AS_USER
  
  Move INSTALL_AS_USER into bsd.init.mk to maximize the chance that
  it has final authority over fooOWN and fooGRP.
  
  Reviewed by:	sjg
  Sponsored by:	Dell EMC
  Differential Revision:	https://reviews.freebsd.org/D10810

Modified:
  stable/11/share/mk/bsd.init.mk
  stable/11/share/mk/bsd.own.mk
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/mk/bsd.init.mk
==============================================================================
--- stable/11/share/mk/bsd.init.mk	Wed May 31 21:05:24 2017	(r319355)
+++ stable/11/share/mk/bsd.init.mk	Wed May 31 21:15:05 2017	(r319356)
@@ -16,6 +16,33 @@ __<bsd.init.mk>__:
 .include <bsd.own.mk>
 .MAIN: all
 
+# Handle INSTALL_AS_USER here to maximize the chance that
+# it has final authority over fooOWN and fooGRP.
+.if ${MK_INSTALL_AS_USER} != "no"
+.if !defined(_uid)
+_uid!=	id -u
+.export _uid
+.endif
+.if ${_uid} != 0
+.if !defined(USER)
+# Avoid exporting USER
+.if !defined(_USER)
+_USER!=	id -un
+.export _USER
+.endif
+USER=	${_USER}
+.endif
+.if !defined(_gid)
+_gid!=	id -g
+.export _gid
+.endif
+.for x in BIN CONF DOC DTB INFO KMOD LIB MAN NLS SHARE
+$xOWN=	${USER}
+$xGRP=	${_gid}
+.endfor
+.endif
+.endif
+
 # Some targets need to know when something may build.  This is used to
 # optimize targets that are only needed when building something, such as
 # (not) reading in depend files.  For DIRDEPS_BUILD, it will only calculate

Modified: stable/11/share/mk/bsd.own.mk
==============================================================================
--- stable/11/share/mk/bsd.own.mk	Wed May 31 21:05:24 2017	(r319355)
+++ stable/11/share/mk/bsd.own.mk	Wed May 31 21:15:05 2017	(r319356)
@@ -135,31 +135,6 @@ CTFCONVERT_CMD=
 CTFCONVERT_CMD=	@:
 .endif 
 
-.if ${MK_INSTALL_AS_USER} != "no"
-.if !defined(_uid)
-_uid!=	id -u
-.export _uid
-.endif
-.if ${_uid} != 0
-.if !defined(USER)
-# Avoid exporting USER
-.if !defined(_USER)
-_USER!=	id -un
-.export _USER
-.endif
-USER=	${_USER}
-.endif
-.if !defined(_gid)
-_gid!=	id -g
-.export _gid
-.endif
-.for x in BIN CONF DOC DTB INFO KMOD LIB MAN NLS SHARE
-$xOWN=	${USER}
-$xGRP=	${_gid}
-.endfor
-.endif
-.endif
-
 .endif # !_WITHOUT_SRCCONF
 
 # Binaries



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