Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Oct 2015 15:30:35 +0000 (UTC)
From:      Brad Davis <brd@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r400469 - head/Mk
Message-ID:  <201510291530.t9TFUZ2r040359@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: brd
Date: Thu Oct 29 15:30:35 2015
New Revision: 400469
URL: https://svnweb.freebsd.org/changeset/ports/400469

Log:
  Fix a bug introduced in r399992, where creating only a user would fail
  due to $PW not being set.  This only occurred when just a user was being
  created without a group.  Solve this by setting $PW outside of the group
  creation and above both the user and group creation parts.
  
  PR:		203489
  Reviewed by:	bapt
  Approved by:	portmgr (bapt)
  Approved by:	bdrewery (mentor)

Modified:
  head/Mk/bsd.port.mk

Modified: head/Mk/bsd.port.mk
==============================================================================
--- head/Mk/bsd.port.mk	Thu Oct 29 15:29:13 2015	(r400468)
+++ head/Mk/bsd.port.mk	Thu Oct 29 15:30:35 2015	(r400469)
@@ -3679,20 +3679,20 @@ install-ldconfig-file:
 _UG_OUTPUT=	${WRKDIR}/users-groups.sh
 PKGPREINSTALL+=	${_UG_OUTPUT}
 create-users-groups:
+	@${RM} -f ${_UG_OUTPUT} || ${TRUE}
+.if ${OPSYS} != FreeBSD || ${OSVERSION} < 1002000
+	@${ECHO_CMD} "PW=${PW}" >> ${_UG_OUTPUT}
+.else
+	@${ECHO_CMD} -e "if [ -n \"\$${PKG_ROOTDIR}\" -a \"\$${PKG_ROOTDIR}\" != \"/\" ]; then PW=\"${PW} -R \$${PKG_ROOTDIR}\"; else PW=${PW}; fi" >> ${_UG_OUTPUT}
+.endif
 .if defined(GROUPS)
 .for _file in ${GID_FILES}
 .if !exists(${_file})
 	@${ECHO_CMD} "** ${_file} doesn't exist. Exiting."; exit 1
 .endif
 .endfor
-	@${RM} -f ${_UG_OUTPUT} || ${TRUE}
 	@${ECHO_MSG} "===> Creating users and/or groups."
 	@${ECHO_CMD} "echo \"===> Creating users and/or groups.\"" >> ${_UG_OUTPUT}
-.if ${OPSYS} != FreeBSD || ${OSVERSION} < 1002000
-	@${ECHO_CMD} "PW=${PW}" >> ${_UG_OUTPUT}
-.else
-	@${ECHO_CMD} -e "if [ -n \"\$${PKG_ROOTDIR}\" -a \"\$${PKG_ROOTDIR}\" != \"/\" ]; then PW=\"${PW} -R \$${PKG_ROOTDIR}\"; else PW=${PW}; fi" >> ${_UG_OUTPUT}
-.endif
 .for _group in ${GROUPS}
 # _bgpd:*:130:
 	@if ! ${GREP} -h ^${_group}: ${GID_FILES} >/dev/null 2>&1; then \



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