pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk/install Use a better default user comment if none i...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/e7d2864a7a0f
branches:  trunk
changeset: 511958:e7d2864a7a0f
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Thu Apr 27 22:44:09 2006 +0000

description:
Use a better default user comment if none is specified -- if the username
matches ${PKGBASE}, then use "${PKGBASE} user", otherwise we use
"${PKGBASE} $user user".

diffstat:

 mk/install/usergroupfuncs           |  8 ++++++--
 mk/install/usergroupfuncs.DragonFly |  8 ++++++--
 mk/install/usergroupfuncs.FreeBSD   |  8 ++++++--
 3 files changed, 18 insertions(+), 6 deletions(-)

diffs (66 lines):

diff -r 6f6ec489bca4 -r e7d2864a7a0f mk/install/usergroupfuncs
--- a/mk/install/usergroupfuncs Thu Apr 27 21:39:28 2006 +0000
+++ b/mk/install/usergroupfuncs Thu Apr 27 22:44:09 2006 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: usergroupfuncs,v 1.6 2006/04/24 23:44:18 jlam Exp $
+# $NetBSD: usergroupfuncs,v 1.7 2006/04/27 22:44:09 jlam Exp $
 #
 # Default implementations of user_exists() and group_exists() shell
 # functions for checking the existence of users and groups, and of
@@ -96,7 +96,11 @@
 
        USERADD="@USERADD@"
 
-       : ${descr:="${PKGNAME%-[0-9]*} $user user"}
+       case $user in
+       ${PKGNAME%-[0-9]*})     descr_dflt="$user user" ;;
+       *)                      descr_dflt="${PKGNAME%-[0-9]*} $user user" ;;
+       esac
+       : ${descr:="$descr_dflt"}
        : ${home:="@PKG_USER_HOME@"}
        : ${shell:="@PKG_USER_SHELL@"}
 
diff -r 6f6ec489bca4 -r e7d2864a7a0f mk/install/usergroupfuncs.DragonFly
--- a/mk/install/usergroupfuncs.DragonFly       Thu Apr 27 21:39:28 2006 +0000
+++ b/mk/install/usergroupfuncs.DragonFly       Thu Apr 27 22:44:09 2006 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: usergroupfuncs.DragonFly,v 1.4 2006/04/24 23:44:18 jlam Exp $
+# $NetBSD: usergroupfuncs.DragonFly,v 1.5 2006/04/27 22:44:09 jlam Exp $
 #
 # Platform-specific adduser and addgroup functionality
 # on top of pw(8).
@@ -88,7 +88,11 @@
 
        PW="@PW@"
 
-       : ${descr:="${PKGNAME%-[0-9]*} $user user"}
+       case $user in
+       ${PKGNAME%-[0-9]*})     descr_dflt="$user user" ;;
+       *)                      descr_dflt="${PKGNAME%-[0-9]*} $user user" ;;
+       esac
+       : ${descr:="$descr_dflt"}
        : ${home:="@PKG_USER_HOME@"}
        : ${shell:="@PKG_USER_SHELL@"}
 
diff -r 6f6ec489bca4 -r e7d2864a7a0f mk/install/usergroupfuncs.FreeBSD
--- a/mk/install/usergroupfuncs.FreeBSD Thu Apr 27 21:39:28 2006 +0000
+++ b/mk/install/usergroupfuncs.FreeBSD Thu Apr 27 22:44:09 2006 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: usergroupfuncs.FreeBSD,v 1.4 2006/04/24 23:44:18 jlam Exp $
+# $NetBSD: usergroupfuncs.FreeBSD,v 1.5 2006/04/27 22:44:09 jlam Exp $
 #
 # Platform-specific adduser and addgroup functionality
 # on top of pw(8).
@@ -88,7 +88,11 @@
 
        PW="@PW@"
 
-       : ${descr:="${PKGNAME%-[0-9]*} $user user"}
+       case $user in
+       ${PKGNAME%-[0-9]*})     descr_dflt="$user user" ;;
+       *)                      descr_dflt="${PKGNAME%-[0-9]*} $user user" ;;
+       esac
+       : ${descr:="$descr_dflt"}
        : ${home:="@PKG_USER_HOME@"}
        : ${shell:="@PKG_USER_SHELL@"}
 



Home | Main Index | Thread Index | Old Index