FreeBSD Bugzilla – Attachment 120673 Details for
Bug 163511
[PATCH] bsd.port.mk: Allow existing users on system to be used by ports
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
bsd-port-mk-users-existing.diff
bsd-port-mk-users-existing.diff (text/plain), 3.08 KB, created by
Chris Rees
on 2011-12-21 19:00:25 UTC
(
hide
)
Description:
bsd-port-mk-users-existing.diff
Filename:
MIME Type:
Creator:
Chris Rees
Created:
2011-12-21 19:00:25 UTC
Size:
3.08 KB
patch
obsolete
>Index: bsd.port.mk >=================================================================== >RCS file: /home/pcvs/ports/Mk/bsd.port.mk,v >retrieving revision 1.699 >diff -u -r1.699 bsd.port.mk >--- bsd.port.mk 9 Nov 2011 08:53:12 -0000 1.699 >+++ bsd.port.mk 18 Dec 2011 15:55:27 -0000 >@@ -4102,23 +4102,28 @@ > .endif > > .if !target(create-users-groups) >+GETUSER= ${SH} -c '${GREP} -h ^$${0}: ${UID_FILES} \ >+ || (/usr/bin/getent passwd $${0} \ >+ | ${SED} "s/^\([^:]*:\)\{4\}/&:0:0:/")' >+GETGROUP= ${SH} -c '${GREP} -h ^$${0}: ${GID_FILES} \ >+ || /usr/bin/getent group $${0}' > create-users-groups: > .if defined(GROUPS) || defined(USERS) > .if defined(GROUPS) > .for _file in ${GID_FILES} > .if !exists(${_file}) >- @${ECHO_CMD} "** ${_file} doesn't exist. Exiting."; exit 1 >+ @${ECHO_MSG} "** ${_file} doesn't exist. Exiting."; exit 1 > .endif > .endfor > @${ECHO_MSG} "===> Creating users and/or groups." > @${ECHO_CMD} "@exec echo \"===> Creating users and/or groups.\"" >> ${TMPPLIST} > .for _group in ${GROUPS} > # _bgpd:*:130: >- @if ! ${GREP} -h ^${_group}: ${GID_FILES} >/dev/null 2>&1; then \ >- ${ECHO_CMD} "** Cannot find any information about group \`${_group}' in ${GID_FILES}."; \ >+ @if ! ${GETGROUP} ${_group} >/dev/null 2>&1; then \ >+ ${ECHO_MSG} "** Cannot find any information about group \`${_group}' in ${GID_FILES}."; \ > exit 1; \ > fi >- @IFS=":"; ${GREP} -h ^${_group}: ${GID_FILES} | head -n 1 | while read group foo gid members; do \ >+ @IFS=":"; ${GETGROUP} ${_group} | head -n 1 | while read group foo gid members; do \ > gid=$$(($$gid+${GID_OFFSET})); \ > if ! ${PW} groupshow $$group >/dev/null 2>&1; then \ > ${ECHO_MSG} "Creating group \`$$group' with gid \`$$gid'."; \ >@@ -4135,16 +4140,16 @@ > .if defined(USERS) > .for _file in ${UID_FILES} > .if !exists(${_file}) >- @${ECHO_CMD} "** ${_file} doesn't exist. Exiting."; exit 1 >+ @${ECHO_MSG} "** ${_file} doesn't exist. Exiting."; exit 1 > .endif > .endfor > .for _user in ${USERS} >-# _bgpd:*:130:130:BGP Daemon:/var/empty:/sbin/nologin >- @if ! ${GREP} -h ^${_user}: ${UID_FILES} >/dev/null 2>&1; then \ >- ${ECHO_CMD} "** Cannot find any information about user \`${_user}' in ${UID_FILES}."; \ >+# _bgpd:*:130:130::0:0:BGP Daemon:/var/empty:/sbin/nologin >+ @if ! ${GETUSER} ${_user} >/dev/null 2>&1; then \ >+ ${ECHO_MSG} "** Cannot find any information about user \`${_user}' in ${UID_FILES}."; \ > exit 1; \ > fi >- @IFS=":"; ${GREP} -h ^${_user}: ${UID_FILES} | head -n 1 | while read login passwd uid gid class change expire gecos homedir shell; do \ >+ @IFS=":"; ${GETUSER} ${_user} | head -n 1 | while read login passwd uid gid class change expire gecos homedir shell; do \ > uid=$$(($$uid+${UID_OFFSET})); \ > gid=$$(($$gid+${GID_OFFSET})); \ > class="$${class:+-L }$$class"; \ >@@ -4166,7 +4171,7 @@ > .if defined(GROUPS) > .for _group in ${GROUPS} > # mail:*:6:postfix,clamav >- @IFS=":"; ${GREP} -h ^${_group}: ${GID_FILES} | head -n 1 | while read group foo gid members; do \ >+ @IFS=":"; ${GETGROUP} ${_group} | head -n 1 | while read group foo gid members; do \ > gid=$$(($$gid+${GID_OFFSET})); \ > IFS=","; for _login in $$members; do \ > for _user in ${USERS}; do \
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 163511
: 120673