diff options
author | Baptiste Daroussin <bapt@FreeBSD.org> | 2011-09-09 08:10:29 +0000 |
---|---|---|
committer | Baptiste Daroussin <bapt@FreeBSD.org> | 2011-09-09 08:10:29 +0000 |
commit | 7626bb39cb6bb5dfff1ccb14b58f7208d89f050d (patch) | |
tree | ce69d4d4b7739e23ea1fa77683b974fac7413cf1 /Mk/bsd.port.mk | |
parent | 8c75fec4091d5d00adb4830f7d929c410c703030 (diff) | |
download | ports-7626bb39cb6bb5dfff1ccb14b58f7208d89f050d.tar.gz ports-7626bb39cb6bb5dfff1ccb14b58f7208d89f050d.zip |
Notes
Diffstat (limited to 'Mk/bsd.port.mk')
-rw-r--r-- | Mk/bsd.port.mk | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk index 4f8974289b29..435cec57693a 100644 --- a/Mk/bsd.port.mk +++ b/Mk/bsd.port.mk @@ -4147,14 +4147,13 @@ create-users-groups: IFS=","; for _login in $$members; do \ for _user in ${USERS}; do \ if [ "x$${_user}" = "x$${_login}" ]; then \ - list=`${PW} usershow $${_login} -P | ${SED} -ne 's/.*Groups: //p'`; \ - ${ECHO_MSG} "Setting \`$${_login}' groups to \`$$list$${list:+,}${_group}'."; \ - ${PW} usermod $${_login} -G $$list$${list:+,}${_group}; \ - ${ECHO_CMD} "@exec list=\`${PW} usershow $${_login} -P | ${SED} -ne 's/.*Groups: //p'\`; \ - echo \"Setting '$${_login}' groups to '$$list$${list:+,}${_group}'.\"; \ - ${PW} usermod $${_login} -G $${list},${_group}" >> ${TMPPLIST}; \ - else \ - ${ECHO_MSG} "==> DEBUG skip login $${_login} => not defined in USERS \"( ${USERS} )\""; \ + if ! ${PW} groupshow ${_group} | ${GREP} -qw $${_login}; then \ + ${ECHO_MSG} "Adding user \`$${_login}' to group \`${_group}'."; \ + ${PW} groupmod ${_group} -m $${_login}; \ + fi; \ + ${ECHO_CMD} "@exec if ! ${PW} groupshow ${_group} | ${GREP} -qw $${_login}; then \ + echo \"Adding user '$${_login}' to group '${_group}'.\"; \ + ${PW} groupmod ${_group} -m $${_login}; fi" >> ${TMPPLIST}; \ fi; \ done; \ done; \ |