pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/mk/install Fix automatically adding users and groups a...
details: https://anonhg.NetBSD.org/pkgsrc/rev/6e73696d5b7e
branches: trunk
changeset: 488436:6e73696d5b7e
user: jlam <jlam%pkgsrc.org@localhost>
date: Mon Jan 31 18:41:08 2005 +0000
description:
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:
mk/install/header | 5 +----
mk/install/usergroup | 19 ++++++++++++-------
2 files changed, 13 insertions(+), 11 deletions(-)
diffs (72 lines):
diff -r beac0cb503bc -r 6e73696d5b7e mk/install/header
--- a/mk/install/header Mon Jan 31 17:42:20 2005 +0000
+++ b/mk/install/header Mon Jan 31 18:41:08 2005 +0000
@@ -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 @@
_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 -r beac0cb503bc -r 6e73696d5b7e mk/install/usergroup
--- a/mk/install/usergroup Mon Jan 31 17:42:20 2005 +0000
+++ b/mk/install/usergroup Mon Jan 31 18:41:08 2005 +0000
@@ -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 @@
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 @@
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
:
Home |
Main Index |
Thread Index |
Old Index