summaryrefslogtreecommitdiff
path: root/mk/install/deinstall
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2001-11-26 20:37:38 +0000
committerjlam <jlam@pkgsrc.org>2001-11-26 20:37:38 +0000
commit22d02d6b3ee441bb598f813d6f7a5421dca6335f (patch)
tree14c0d9f381d74ca492c950829a9e8cced859770c /mk/install/deinstall
parent4353c85a3caedb327da560d18f335992fe6b6591 (diff)
downloadpkgsrc-22d02d6b3ee441bb598f813d6f7a5421dca6335f.tar.gz
Replace PKG_{USER,GROUP} with PKG_USERS and PKG_GROUPS:
PKG_USERS represents the users to create for the package. It is a space-separated list of elements of the form user:group[:[userid][:[descr][:[home][:shell]]]] Only the user and group are required; everything else is optional, but the colons must be in the right places when specifying optional bits. Note that if the description contains spaces, then spaces should be double backslash-escaped, e.g. foo:foogrp::The\\ Foomister PKG_GROUPS represents the groups to create for the package. It is a space-separated list of elements of the form group[:groupid] Only the group is required; the groupid is optional. This solves the problem of what to do when there is more than one user or group needed for a package, e.g. qmail. Also add a bit more error-checking to the INSTALL/DEINSTALL scripts.
Diffstat (limited to 'mk/install/deinstall')
-rw-r--r--mk/install/deinstall67
1 files changed, 50 insertions, 17 deletions
diff --git a/mk/install/deinstall b/mk/install/deinstall
index 2a67aa13128..d022f432a51 100644
--- a/mk/install/deinstall
+++ b/mk/install/deinstall
@@ -1,6 +1,27 @@
# start of deinstall
#
-# $NetBSD: deinstall,v 1.7 2001/11/26 14:48:53 jlam Exp $
+# $NetBSD: deinstall,v 1.8 2001/11/26 20:37:39 jlam Exp $
+
+eval set -- ${PKG_USERS}
+for userset
+do
+ user=`
+ IFS=":"
+ set -- ${userset}
+ ${ECHO} "$1"
+ `
+ ALL_USERS="${ALL_USERS} \"${user}\""
+done
+eval set -- ${PKG_GROUPS}
+for groupset
+do
+ group=`
+ IFS=":"
+ set -- ${groupset}
+ ${ECHO} "$1"
+ `
+ ALL_GROUPS="${ALL_GROUPS} \"${group}\""
+done
eval set -- ${CONF_FILES} ${SUPPORT_FILES}
for file
@@ -48,11 +69,11 @@ do
ALL_DIRS="${ALL_DIRS} \"${dir}\""
done
ALL_DIRS=`
- ( eval set -- ${ALL_DIRS}
- for dir
- do
- ${ECHO} "\"${dir}\""
- done
+ ( eval set -- ${ALL_DIRS}
+ for dir
+ do
+ ${ECHO} "\"${dir}\""
+ done
) | ${SORT} -r
`
@@ -117,26 +138,38 @@ POST-DEINSTALL)
fi
done
- if [ -n "${PKG_USER}" -o -n "${PKG_GROUP}" -o \
+ if [ -n "${ALL_USERS}" -o -n "${ALL_GROUPS}" -o \
-n "${modified_files}" -o -n "${existing_dirs}" ]
then
${CAT} << EOF
===========================================================================
If you won't be using ${PKGNAME} any longer, you may want to remove
EOF
- if [ -n "${PKG_USER}" ]
+ if [ -n "${ALL_USERS}" ]
then
- ${CAT} << EOF
-
- * the \`${PKG_USER}' user
-EOF
+ ${ECHO} ""
+ ${ECHO} -n " * the following users"
+ sep=": "
+ eval set -- ${ALL_USERS}
+ for user
+ do
+ ${ECHO} -n "${sep}${user}"
+ sep=", "
+ done
+ ${ECHO} ""
fi
- if [ -n "${PKG_GROUP}" ]
+ if [ -n "${ALL_GROUPS}" ]
then
- ${CAT} << EOF
-
- * the \`${PKG_GROUP}' group
-EOF
+ ${ECHO} ""
+ ${ECHO} -n " * the following groups"
+ sep=": "
+ eval set -- ${ALL_GROUPS}
+ for group
+ do
+ ${ECHO} -n "${sep}${group}"
+ sep=", "
+ done
+ ${ECHO} ""
fi
if [ -n "${modified_files}" ]
then