diff options
author | jlam <jlam@pkgsrc.org> | 2005-01-31 18:41:08 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2005-01-31 18:41:08 +0000 |
commit | d621d74579f9da32bc46a6ae09d4f66fd3ae2aef (patch) | |
tree | cb92483791fe5cb71aba9f0f6b7e0fa2a5f05f23 /mk/install | |
parent | 7bb70d34b24f4a15e50fa2cc84727209e5bb3325 (diff) | |
download | pkgsrc-d621d74579f9da32bc46a6ae09d4f66fd3ae2aef.tar.gz |
Fix automatically adding users and groups after the {GROUP,USER}ADD
definitions were removed from mk/install/headers. The checks for
whether {GROUP,USER}ADD are defined are now moved to the usergroup
script.
Diffstat (limited to 'mk/install')
-rw-r--r-- | mk/install/header | 5 | ||||
-rw-r--r-- | mk/install/usergroup | 19 |
2 files changed, 13 insertions, 11 deletions
diff --git a/mk/install/header b/mk/install/header index d82a96ae8b3..d2812955ee0 100644 --- a/mk/install/header +++ b/mk/install/header @@ -2,7 +2,7 @@ # # start of header # -# $NetBSD: header,v 1.30 2005/01/28 18:05:34 jlam Exp $ +# $NetBSD: header,v 1.31 2005/01/31 18:41:08 jlam Exp $ PKGNAME=$1 STAGE=$2 @@ -100,9 +100,6 @@ case "${PKG_CREATE_USERGROUP:-@PKG_CREATE_USERGROUP@}" in _PKG_CREATE_USERGROUP=NO ;; esac -if [ -z "${USERADD}" -o -z "${GROUPADD}" ]; then - _PKG_CREATE_USERGROUP=NO -fi case "${PKG_CONFIG:-@PKG_CONFIG@}" in [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) diff --git a/mk/install/usergroup b/mk/install/usergroup index 0b8b17f692c..249a5ca2743 100644 --- a/mk/install/usergroup +++ b/mk/install/usergroup @@ -1,6 +1,6 @@ #!@SH@ # -# $NetBSD: usergroup,v 1.4 2005/01/31 17:42:20 jlam Exp $ +# $NetBSD: usergroup,v 1.5 2005/01/31 18:41:08 jlam Exp $ # # +USERGROUP - users and groups management script # @@ -137,12 +137,15 @@ ADD) group_exists $group && ${ECHO} "${PKGNAME}" > $preexist fi - group_exists $group || - { ${ECHO} "Creating group: $group"; + if group_exists $group; then + : + elif ${TEST} -n "${GROUPADD}" -a -x "${GROUPADD}"; then + ${ECHO} "Creating group: $group"; case $groupid in "") ${GROUPADD} $group ;; *) ${GROUPADD} -g $groupid $group ;; - esac; } + esac + fi if ${TEST} -f "$token" && \ ${GREP} "^${PKG_METADATA_DIR}$" $token >/dev/null; then : @@ -171,14 +174,16 @@ ADD) user_exists $user && ${ECHO} "${PKGNAME}" > $preexist fi - { user_exists $user && group_exists $group; } || - { ${ECHO} "Creating user: $user"; + if user_exists $user && group_exists $group; then + : + elif ${TEST} -n "${USERADD}" -a -x "${USERADD}"; then + ${ECHO} "Creating user: $user"; case $userid in "") ${USERADD} -c "$descr" -d "$home" -s "$shell" \ -g $group $user ;; *) ${USERADD} -c "$descr" -d "$home" -s "$shell" \ -g $group -u $userid $user ;; - esac; } + esac if ${TEST} -f "$token" && \ ${GREP} "^${PKG_METADATA_DIR}$" $token >/dev/null; then : |