public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in eclass: user.eclass
@ 2011-10-27  7:26 Mike Frysinger (vapier)
  0 siblings, 0 replies; 12+ messages in thread
From: Mike Frysinger (vapier) @ 2011-10-27  7:26 UTC (permalink / raw
  To: gentoo-commits

vapier      11/10/27 07:26:55

  Modified:             user.eclass
  Log:
  unify/update EBUILD_PHASE checks, and simplify egethome/egetshell/is-login-disabled funcs a bit

Revision  Changes    Path
1.2                  eclass/user.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/user.eclass?rev=1.2&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/user.eclass?rev=1.2&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/user.eclass?r1=1.1&r2=1.2

Index: user.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/user.eclass,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- user.eclass	27 Oct 2011 07:16:08 -0000	1.1
+++ user.eclass	27 Oct 2011 07:26:55 -0000	1.2
@@ -1,6 +1,6 @@
 # Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/user.eclass,v 1.1 2011/10/27 07:16:08 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/user.eclass,v 1.2 2011/10/27 07:26:55 vapier Exp $
 
 # @ECLASS: user.eclass
 # @MAINTAINER:
@@ -13,6 +13,18 @@
 # The user eclass contains a suite of functions that allow ebuilds
 # to quickly make sure users in the installed system are sane.
 
+# @FUNCTION: _assert_pkg_ebuild_phase
+# @INTERNAL
+# @USAGE: <calling func name>
+_assert_pkg_ebuild_phase() {
+	case ${EBUILD_PHASE} in
+	unpack|prepare|configure|compile|test|install)
+		eerror "'$1()' called from '${EBUILD_PHASE}()' which is not a pkg_* function."
+		eerror "Package fails at QA and at life.  Please file a bug."
+		die "Bad package!  $1 is only for use in pkg_* functions!"
+	esac
+}
+
 # @FUNCTION: egetent
 # @USAGE: <database> <key>
 # @DESCRIPTION:
@@ -75,12 +87,7 @@
 # /bin/false, default homedir is /dev/null, there are no default groups,
 # and default params sets the comment as 'added by portage for ${PN}'.
 enewuser() {
-	case ${EBUILD_PHASE} in
-		unpack|compile|test|install)
-		eerror "'enewuser()' called from '${EBUILD_PHASE}()' which is not a pkg_* function."
-		eerror "Package fails at QA and at life.  Please file a bug."
-		die "Bad package!  enewuser is only for use in pkg_* functions!"
-	esac
+	_assert_pkg_ebuild_phase enewuser
 
 	# get the username
 	local euser=$1; shift
@@ -282,12 +289,7 @@
 # do the rest.  You may specify the gid for the group or allow the group to
 # allocate the next available one.
 enewgroup() {
-	case ${EBUILD_PHASE} in
-		unpack|compile|test|install)
-		eerror "'enewgroup()' called from '${EBUILD_PHASE}()' which is not a pkg_* function."
-		eerror "Package fails at QA and at life.  Please file a bug."
-		die "Bad package!  enewgroup is only for use in pkg_* functions!"
-	esac
+	_assert_pkg_ebuild_phase enewgroup
 
 	# get the group
 	local egroup="$1"; shift
@@ -393,18 +395,18 @@
 #
 # To use that, inherit eutils, not portability!
 egethome() {
-	ent=$(egetent passwd $1)
+	local pos
 
 	case ${CHOST} in
 	*-darwin*|*-freebsd*|*-dragonfly*)
-		# Darwin, OSX, FreeBSD and DragonFly use position 9 to store homedir
-		echo ${ent} | cut -d: -f9
+		pos=9
 		;;
-	*)
-		# Linux, NetBSD and OpenBSD use position 6 instead
-		echo ${ent} | cut -d: -f6
+	*)	# Linux, NetBSD, OpenBSD, etc...
+		pos=6
 		;;
 	esac
+
+	egetent passwd $1 | cut -d: -f${pos}
 }
 
 # Gets the shell for the specified user
@@ -413,26 +415,25 @@
 #
 # To use that, inherit eutils, not portability!
 egetshell() {
-	ent=$(egetent passwd "$1")
+	local pos
 
 	case ${CHOST} in
 	*-darwin*|*-freebsd*|*-dragonfly*)
-		# Darwin, OSX, FreeBSD and DragonFly use position 9 to store homedir
-		echo ${ent} | cut -d: -f10
+		pos=10
 		;;
-	*)
-		# Linux, NetBSD and OpenBSD use position 6 instead
-		echo ${ent} cut -d: -f7
+	*)	# Linux, NetBSD, OpenBSD, etc...
+		pos=7
 		;;
 	esac
+
+	egetent passwd "$1" | cut -d: -f${pos}
 }
 
 # Returns true if specified user has a shell that precludes logins
 # on whichever operating system.
 is-login-disabled() {
-	shell=$(egetshell "$1")
 
-	case ${shell} in
+	case $(egetshell "$1") in
 		/bin/false|/usr/bin/false|/sbin/nologin|/usr/sbin/nologin)
 			return 0 ;;
 		*)






^ permalink raw reply	[flat|nested] 12+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: user.eclass
@ 2011-10-27  7:49 Mike Frysinger (vapier)
  0 siblings, 0 replies; 12+ messages in thread
From: Mike Frysinger (vapier) @ 2011-10-27  7:49 UTC (permalink / raw
  To: gentoo-commits

vapier      11/10/27 07:49:53

  Modified:             user.eclass
  Log:
  send nscd output to /dev/null so we don't dump ugly warnings when running as non-root

Revision  Changes    Path
1.3                  eclass/user.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/user.eclass?rev=1.3&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/user.eclass?rev=1.3&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/user.eclass?r1=1.2&r2=1.3

Index: user.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/user.eclass,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- user.eclass	27 Oct 2011 07:26:55 -0000	1.2
+++ user.eclass	27 Oct 2011 07:49:53 -0000	1.3
@@ -1,6 +1,6 @@
 # Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/user.eclass,v 1.2 2011/10/27 07:26:55 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/user.eclass,v 1.3 2011/10/27 07:49:53 vapier Exp $
 
 # @ECLASS: user.eclass
 # @MAINTAINER:
@@ -72,7 +72,8 @@
 		grep "$2:\*:" /etc/$1
 		;;
 	*)
-		type -p nscd >& /dev/null && nscd -i "$1"
+		# ignore output if nscd doesn't exist, or we're not running as root
+		nscd -i "$1" 2>/dev/null
 		getent "$1" "$2"
 		;;
 	esac






^ permalink raw reply	[flat|nested] 12+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: user.eclass
@ 2011-11-03  0:24 Mike Frysinger (vapier)
  0 siblings, 0 replies; 12+ messages in thread
From: Mike Frysinger (vapier) @ 2011-11-03  0:24 UTC (permalink / raw
  To: gentoo-commits

vapier      11/11/03 00:24:19

  Modified:             user.eclass
  Log:
  clean up egetent style to make it clear how it works

Revision  Changes    Path
1.5                  eclass/user.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/user.eclass?rev=1.5&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/user.eclass?rev=1.5&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/user.eclass?r1=1.4&r2=1.5

Index: user.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/user.eclass,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- user.eclass	31 Oct 2011 17:39:52 -0000	1.4
+++ user.eclass	3 Nov 2011 00:24:19 -0000	1.5
@@ -1,6 +1,6 @@
 # Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/user.eclass,v 1.4 2011/10/31 17:39:52 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/user.eclass,v 1.5 2011/11/03 00:24:19 vapier Exp $
 
 # @ECLASS: user.eclass
 # @MAINTAINER:
@@ -30,51 +30,66 @@
 # @DESCRIPTION:
 # Small wrapper for getent (Linux), nidump (< Mac OS X 10.5),
 # dscl (Mac OS X 10.5), and pw (FreeBSD) used in enewuser()/enewgroup().
+#
+# Supported databases: group passwd
 egetent() {
+	local db=$1 key=$2
+
+	[[ $# -ge 3 ]] && die "usage: egetent <database> <key>"
+
+	case ${db} in
+	passwd|group) ;;
+	*) die "sorry, database '${db}' not yet supported; file a bug" ;;
+	esac
+
 	case ${CHOST} in
 	*-darwin[678])
-		case "$2" in
+		case ${key} in
 		*[!0-9]*) # Non numeric
-			nidump $1 . | awk -F":" "{ if (\$1 ~ /^$2\$/) {print \$0;exit;} }"
+			nidump ${db} . | awk -F: "(\$1 ~ /^${key}\$/) {print;exit;}"
 			;;
 		*)	# Numeric
-			nidump $1 . | awk -F":" "{ if (\$3 == $2) {print \$0;exit;} }"
+			nidump ${db} . | awk -F: "(\$3 == ${key}) {print;exit;}"
 			;;
 		esac
 		;;
 	*-darwin*)
-		local mytype=$1
-		[[ "passwd" == $mytype ]] && mytype="Users"
-		[[ "group" == $mytype ]] && mytype="Groups"
-		case "$2" in
+		local mykey
+		case ${db} in
+		passwd) db="Users"  mykey="UniqueID" ;;
+		group)  db="Groups" mykey="PrimaryGroupID" ;;
+		esac
+
+		case ${key} in
 		*[!0-9]*) # Non numeric
-			dscl . -read /$mytype/$2 2>/dev/null |grep RecordName
+			dscl . -read /${db}/${key} 2>/dev/null |grep RecordName
 			;;
 		*)	# Numeric
-			local mykey="UniqueID"
-			[[ $mytype == "Groups" ]] && mykey="PrimaryGroupID"
-			dscl . -search /$mytype $mykey $2 2>/dev/null
+			dscl . -search /${db} ${mykey} ${key} 2>/dev/null
 			;;
 		esac
 		;;
 	*-freebsd*|*-dragonfly*)
-		local opts action="user"
-		[[ $1 == "passwd" ]] || action="group"
+		case ${db} in
+		passwd) db="user" ;;
+		*) ;;
+		esac
 
 		# lookup by uid/gid
-		if [[ $2 == [[:digit:]]* ]] ; then
+		local opts
+		if [[ ${key} == [[:digit:]]* ]] ; then
 			[[ ${action} == "user" ]] && opts="-u" || opts="-g"
 		fi
 
-		pw show ${action} ${opts} "$2" -q
+		pw show ${action} ${opts} "${key}" -q
 		;;
 	*-netbsd*|*-openbsd*)
-		grep "$2:\*:" /etc/$1
+		grep "${key}:\*:" /etc/${db}
 		;;
 	*)
 		# ignore output if nscd doesn't exist, or we're not running as root
-		nscd -i "$1" 2>/dev/null
-		getent "$1" "$2"
+		nscd -i "${db}" 2>/dev/null
+		getent "${db}" "${key}"
 		;;
 	esac
 }






^ permalink raw reply	[flat|nested] 12+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: user.eclass
@ 2011-11-03  0:35 Mike Frysinger (vapier)
  0 siblings, 0 replies; 12+ messages in thread
From: Mike Frysinger (vapier) @ 2011-11-03  0:35 UTC (permalink / raw
  To: gentoo-commits

vapier      11/11/03 00:35:07

  Modified:             user.eclass
  Log:
  egethome: check arguments to verify correct usage

Revision  Changes    Path
1.7                  eclass/user.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/user.eclass?rev=1.7&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/user.eclass?rev=1.7&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/user.eclass?r1=1.6&r2=1.7

Index: user.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/user.eclass,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- user.eclass	3 Nov 2011 00:26:17 -0000	1.6
+++ user.eclass	3 Nov 2011 00:35:07 -0000	1.7
@@ -1,6 +1,6 @@
 # Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/user.eclass,v 1.6 2011/11/03 00:26:17 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/user.eclass,v 1.7 2011/11/03 00:35:07 vapier Exp $
 
 # @ECLASS: user.eclass
 # @MAINTAINER:
@@ -412,6 +412,8 @@
 egethome() {
 	local pos
 
+	[[ $# -eq 1 ]] || die "usage: egethome <user>"
+
 	case ${CHOST} in
 	*-darwin*|*-freebsd*|*-dragonfly*)
 		pos=9






^ permalink raw reply	[flat|nested] 12+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: user.eclass
@ 2011-11-03 15:29 Mike Frysinger (vapier)
  0 siblings, 0 replies; 12+ messages in thread
From: Mike Frysinger (vapier) @ 2011-11-03 15:29 UTC (permalink / raw
  To: gentoo-commits

vapier      11/11/03 15:29:39

  Modified:             user.eclass
  Log:
  clean up enew{user,group} and drop the [extra] argument as no one is using it

Revision  Changes    Path
1.9                  eclass/user.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/user.eclass?rev=1.9&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/user.eclass?rev=1.9&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/user.eclass?r1=1.8&r2=1.9

Index: user.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/user.eclass,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- user.eclass	3 Nov 2011 00:59:16 -0000	1.8
+++ user.eclass	3 Nov 2011 15:29:39 -0000	1.9
@@ -1,6 +1,6 @@
 # Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/user.eclass,v 1.8 2011/11/03 00:59:16 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/user.eclass,v 1.9 2011/11/03 15:29:39 vapier Exp $
 
 # @ECLASS: user.eclass
 # @MAINTAINER:
@@ -95,13 +95,12 @@
 }
 
 # @FUNCTION: enewuser
-# @USAGE: <user> [uid] [shell] [homedir] [groups] [params]
+# @USAGE: <user> [uid] [shell] [homedir] [groups]
 # @DESCRIPTION:
 # Same as enewgroup, you are not required to understand how to properly add
 # a user to the system.  The only required parameter is the username.
 # Default uid is (pass -1 for this) next available, default shell is
-# /bin/false, default homedir is /dev/null, there are no default groups,
-# and default params sets the comment as 'added by portage for ${PN}'.
+# /bin/false, default homedir is /dev/null, and there are no default groups.
 enewuser() {
 	_assert_pkg_ebuild_phase enewuser
 
@@ -140,7 +139,7 @@
 			[[ -z $(egetent passwd ${euid}) ]] && break
 		done
 	fi
-	opts="${opts} -u ${euid}"
+	opts+=" -u ${euid}"
 	einfo " - Userid: ${euid}"
 
 	# handle shell
@@ -172,7 +171,7 @@
 		eshell=${shell}
 	fi
 	einfo " - Shell: ${eshell}"
-	opts="${opts} -s ${eshell}"
+	opts+=" -s ${eshell}"
 
 	# handle homedir
 	local ehome=$1; shift
@@ -180,7 +179,7 @@
 		ehome="/dev/null"
 	fi
 	einfo " - Home: ${ehome}"
-	opts="${opts} -d ${ehome}"
+	opts+=" -d ${ehome}"
 
 	# handle groups
 	local egroups=$1; shift
@@ -204,86 +203,58 @@
 		done
 		export IFS=${oldifs}
 
-		opts="${opts} -g ${defgroup}"
+		opts+=" -g ${defgroup}"
 		if [[ ! -z ${exgroups} ]] ; then
-			opts="${opts} -G ${exgroups:1}"
+			opts+=" -G ${exgroups:1}"
 		fi
 	else
 		egroups="(none)"
 	fi
 	einfo " - Groups: ${egroups}"
 
-	# handle extra and add the user
+	# handle extra args
+	if [[ $# -gt 0 ]] ; then
+		die "extra arguments no longer supported; please file a bug"
+	else
+		set -- -c "added by portage for ${PN}"
+		einfo " - Extra: $@"
+	fi
+
+	# add the user
 	local oldsandbox=${SANDBOX_ON}
 	export SANDBOX_ON="0"
 	case ${CHOST} in
 	*-darwin*)
 		### Make the user
-		if [[ -z $@ ]] ; then
-			dscl . create /users/${euser} uid ${euid}
-			dscl . create /users/${euser} shell ${eshell}
-			dscl . create /users/${euser} home ${ehome}
-			dscl . create /users/${euser} realname "added by portage for ${PN}"
-			### Add the user to the groups specified
-			local oldifs=${IFS}
-			export IFS=","
-			for g in ${egroups} ; do
-				dscl . merge /groups/${g} users ${euser}
-			done
-			export IFS=${oldifs}
-		else
-			einfo "Extra options are not supported on Darwin yet"
-			einfo "Please report the ebuild along with the info below"
-			einfo "eextra: $@"
-			die "Required function missing"
-		fi
+		dscl . create /users/${euser} uid ${euid}
+		dscl . create /users/${euser} shell ${eshell}
+		dscl . create /users/${euser} home ${ehome}
+		dscl . create /users/${euser} realname "added by portage for ${PN}"
+		### Add the user to the groups specified
+		local oldifs=${IFS}
+		export IFS=","
+		for g in ${egroups} ; do
+			dscl . merge /groups/${g} users ${euser}
+		done
+		export IFS=${oldifs}
 		;;
+
 	*-freebsd*|*-dragonfly*)
-		if [[ -z $@ ]] ; then
-			pw useradd ${euser} ${opts} \
-				-c "added by portage for ${PN}" \
-				die "enewuser failed"
-		else
-			einfo " - Extra: $@"
-			pw useradd ${euser} ${opts} \
-				"$@" || die "enewuser failed"
-		fi
+		pw useradd ${euser} ${opts} "$@" || die
 		;;
 
 	*-netbsd*)
-		if [[ -z $@ ]] ; then
-			useradd ${opts} ${euser} || die "enewuser failed"
-		else
-			einfo " - Extra: $@"
-			useradd ${opts} ${euser} "$@" || die "enewuser failed"
-		fi
+		useradd ${opts} ${euser} "$@" || die
 		;;
 
 	*-openbsd*)
-		if [[ -z $@ ]] ; then
-			useradd -u ${euid} -s ${eshell} \
-				-d ${ehome} -c "Added by portage for ${PN}" \
-				-g ${egroups} ${euser} || die "enewuser failed"
-		else
-			einfo " - Extra: $@"
-			useradd -u ${euid} -s ${eshell} \
-				-d ${ehome} -c "Added by portage for ${PN}" \
-				-g ${egroups} ${euser} "$@" || die "enewuser failed"
-		fi
+		# all ops the same, except the -g vs -g/-G ...
+		useradd -u ${euid} -s ${eshell} \
+			-d ${ehome} -g ${egroups} "$@" ${euser} || die
 		;;
 
 	*)
-		if [[ -z $@ ]] ; then
-			useradd -r ${opts} \
-				-c "added by portage for ${PN}" \
-				${euser} \
-				|| die "enewuser failed"
-		else
-			einfo " - Extra: $@"
-			useradd -r ${opts} "$@" \
-				${euser} \
-				|| die "enewuser failed"
-		fi
+		useradd -r ${opts} "$@" ${euser} || die
 		;;
 	esac
 
@@ -333,9 +304,9 @@
 			if [ -z "`egetent group ${egid}`" ]
 			then
 				if [[ "${CHOST}" == *-darwin* ]]; then
-					opts="${opts} ${egid}"
+					opts+=" ${egid}"
 				else
-					opts="${opts} -g ${egid}"
+					opts+=" -g ${egid}"
 				fi
 			else
 				egid="next available; requested gid taken"
@@ -350,22 +321,15 @@
 	einfo " - Groupid: ${egid}"
 
 	# handle extra
-	local eextra="$@"
-	opts="${opts} ${eextra}"
+	if [ $# -gt 0 ] ; then
+		die "extra arguments no longer supported; please file a bug"
+	fi
 
 	# add the group
 	local oldsandbox="${SANDBOX_ON}"
 	export SANDBOX_ON="0"
 	case ${CHOST} in
 	*-darwin*)
-		if [ ! -z "${eextra}" ];
-		then
-			einfo "Extra options are not supported on Darwin/OS X yet"
-			einfo "Please report the ebuild along with the info below"
-			einfo "eextra: ${eextra}"
-			die "Required function missing"
-		fi
-
 		# If we need the next available
 		case ${egid} in
 		*[!0-9]*) # Non numeric
@@ -384,7 +348,7 @@
 					[[ -z $(egetent group ${egid}) ]] && break
 				done
 		esac
-		pw groupadd ${egroup} -g ${egid} || die "enewgroup failed"
+		pw groupadd ${egroup} -g ${egid} || die
 		;;
 
 	*-netbsd*)
@@ -394,12 +358,12 @@
 				[[ -z $(egetent group ${egid}) ]] && break
 			done
 		esac
-		groupadd -g ${egid} ${egroup} || die "enewgroup failed"
+		groupadd -g ${egid} ${egroup} || die
 		;;
 
 	*)
 		# We specify -r so that we get a GID in the system range from login.defs
-		groupadd -r ${opts} ${egroup} || die "enewgroup failed"
+		groupadd -r ${opts} ${egroup} || die
 		;;
 	esac
 	export SANDBOX_ON="${oldsandbox}"






^ permalink raw reply	[flat|nested] 12+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: user.eclass
@ 2011-11-26  6:42 Mike Frysinger (vapier)
  0 siblings, 0 replies; 12+ messages in thread
From: Mike Frysinger (vapier) @ 2011-11-26  6:42 UTC (permalink / raw
  To: gentoo-commits

vapier      11/11/26 06:42:07

  Modified:             user.eclass
  Log:
  restrict enew{user,group} to pkg_{setup,preinst,postinst}

Revision  Changes    Path
1.11                 eclass/user.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/user.eclass?rev=1.11&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/user.eclass?rev=1.11&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/user.eclass?r1=1.10&r2=1.11

Index: user.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/user.eclass,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- user.eclass	4 Nov 2011 13:08:23 -0000	1.10
+++ user.eclass	26 Nov 2011 06:42:07 -0000	1.11
@@ -1,6 +1,6 @@
 # Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/user.eclass,v 1.10 2011/11/04 13:08:23 naota Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/user.eclass,v 1.11 2011/11/26 06:42:07 vapier Exp $
 
 # @ECLASS: user.eclass
 # @MAINTAINER:
@@ -18,7 +18,8 @@
 # @USAGE: <calling func name>
 _assert_pkg_ebuild_phase() {
 	case ${EBUILD_PHASE} in
-	unpack|prepare|configure|compile|test|install)
+	setup|preinst|postinst) ;;
+	*)
 		eerror "'$1()' called from '${EBUILD_PHASE}()' which is not a pkg_* function."
 		eerror "Package fails at QA and at life.  Please file a bug."
 		die "Bad package!  $1 is only for use in pkg_* functions!"






^ permalink raw reply	[flat|nested] 12+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: user.eclass
@ 2011-11-26  6:45 Mike Frysinger (vapier)
  0 siblings, 0 replies; 12+ messages in thread
From: Mike Frysinger (vapier) @ 2011-11-26  6:45 UTC (permalink / raw
  To: gentoo-commits

vapier      11/11/26 06:45:38

  Modified:             user.eclass
  Log:
  do not touch sandbox settings since we only run in pkg_* funcs (where sandbox is disabled)

Revision  Changes    Path
1.12                 eclass/user.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/user.eclass?rev=1.12&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/user.eclass?rev=1.12&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/user.eclass?r1=1.11&r2=1.12

Index: user.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/user.eclass,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- user.eclass	26 Nov 2011 06:42:07 -0000	1.11
+++ user.eclass	26 Nov 2011 06:45:38 -0000	1.12
@@ -1,6 +1,6 @@
 # Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/user.eclass,v 1.11 2011/11/26 06:42:07 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/user.eclass,v 1.12 2011/11/26 06:45:38 vapier Exp $
 
 # @ECLASS: user.eclass
 # @MAINTAINER:
@@ -222,8 +222,6 @@
 	fi
 
 	# add the user
-	local oldsandbox=${SANDBOX_ON}
-	export SANDBOX_ON="0"
 	case ${CHOST} in
 	*-darwin*)
 		### Make the user
@@ -265,8 +263,6 @@
 		chown ${euser} "${ROOT}/${ehome}"
 		chmod 755 "${ROOT}/${ehome}"
 	fi
-
-	export SANDBOX_ON=${oldsandbox}
 }
 
 # @FUNCTION: enewgroup
@@ -327,8 +323,6 @@
 	fi
 
 	# add the group
-	local oldsandbox="${SANDBOX_ON}"
-	export SANDBOX_ON="0"
 	case ${CHOST} in
 	*-darwin*)
 		# If we need the next available
@@ -367,7 +361,6 @@
 		groupadd -r ${opts} ${egroup} || die
 		;;
 	esac
-	export SANDBOX_ON="${oldsandbox}"
 }
 
 # @FUNCTION: egethome






^ permalink raw reply	[flat|nested] 12+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: user.eclass
@ 2011-11-26  6:50 Mike Frysinger (vapier)
  0 siblings, 0 replies; 12+ messages in thread
From: Mike Frysinger (vapier) @ 2011-11-26  6:50 UTC (permalink / raw
  To: gentoo-commits

vapier      11/11/26 06:50:27

  Modified:             user.eclass
  Log:
  re-use "eshell" when searching for a shell to avoid missing "local shell" decl pointed out by Brian Harring

Revision  Changes    Path
1.13                 eclass/user.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/user.eclass?rev=1.13&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/user.eclass?rev=1.13&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/user.eclass?r1=1.12&r2=1.13

Index: user.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/user.eclass,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- user.eclass	26 Nov 2011 06:45:38 -0000	1.12
+++ user.eclass	26 Nov 2011 06:50:27 -0000	1.13
@@ -1,6 +1,6 @@
 # Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/user.eclass,v 1.12 2011/11/26 06:45:38 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/user.eclass,v 1.13 2011/11/26 06:50:27 vapier Exp $
 
 # @ECLASS: user.eclass
 # @MAINTAINER:
@@ -155,21 +155,19 @@
 			die "Pass '-1' as the shell parameter"
 		fi
 	else
-		for shell in /sbin/nologin /usr/sbin/nologin /bin/false /usr/bin/false /dev/null ; do
-			[[ -x ${ROOT}${shell} ]] && break
+		for eshell in /sbin/nologin /usr/sbin/nologin /bin/false /usr/bin/false /dev/null ; do
+			[[ -x ${ROOT}${eshell} ]] && break
 		done
 
-		if [[ ${shell} == "/dev/null" ]] ; then
+		if [[ ${eshell} == "/dev/null" ]] ; then
 			eerror "Unable to identify the shell to use, proceeding with userland default."
 			case ${USERLAND} in
-				GNU) shell="/bin/false" ;;
-				BSD) shell="/sbin/nologin" ;;
-				Darwin) shell="/usr/sbin/nologin" ;;
+				GNU)    eshell="/bin/false" ;;
+				BSD)    eshell="/sbin/nologin" ;;
+				Darwin) eshell="/usr/sbin/nologin" ;;
 				*) die "Unable to identify the default shell for userland ${USERLAND}"
 			esac
 		fi
-
-		eshell=${shell}
 	fi
 	einfo " - Shell: ${eshell}"
 	opts+=" -s ${eshell}"






^ permalink raw reply	[flat|nested] 12+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: user.eclass
@ 2011-11-26  7:20 Mike Frysinger (vapier)
  0 siblings, 0 replies; 12+ messages in thread
From: Mike Frysinger (vapier) @ 2011-11-26  7:20 UTC (permalink / raw
  To: gentoo-commits

vapier      11/11/26 07:20:31

  Modified:             user.eclass
  Log:
  rewrite a bit of code to quote all user/group/shell/home strings

Revision  Changes    Path
1.14                 eclass/user.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/user.eclass?rev=1.14&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/user.eclass?rev=1.14&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/user.eclass?r1=1.13&r2=1.14

Index: user.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/user.eclass,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- user.eclass	26 Nov 2011 06:50:27 -0000	1.13
+++ user.eclass	26 Nov 2011 07:20:31 -0000	1.14
@@ -1,6 +1,6 @@
 # Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/user.eclass,v 1.13 2011/11/26 06:50:27 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/user.eclass,v 1.14 2011/11/26 07:20:31 vapier Exp $
 
 # @ECLASS: user.eclass
 # @MAINTAINER:
@@ -119,7 +119,7 @@
 	einfo "Adding user '${euser}' to your system ..."
 
 	# options to pass to useradd
-	local opts=
+	local opts=()
 
 	# handle uid
 	local euid=$1; shift
@@ -140,7 +140,7 @@
 			[[ -z $(egetent passwd ${euid}) ]] && break
 		done
 	fi
-	opts+=" -u ${euid}"
+	opts+=( -u ${euid} )
 	einfo " - Userid: ${euid}"
 
 	# handle shell
@@ -170,7 +170,7 @@
 		fi
 	fi
 	einfo " - Shell: ${eshell}"
-	opts+=" -s ${eshell}"
+	opts+=( -s "${eshell}" )
 
 	# handle homedir
 	local ehome=$1; shift
@@ -178,7 +178,7 @@
 		ehome="/dev/null"
 	fi
 	einfo " - Home: ${ehome}"
-	opts+=" -d ${ehome}"
+	opts+=( -d "${ehome}" )
 
 	# handle groups
 	local egroups=$1; shift
@@ -202,9 +202,9 @@
 		done
 		export IFS=${oldifs}
 
-		opts+=" -g ${defgroup}"
+		opts+=( -g "${defgroup}" )
 		if [[ ! -z ${exgroups} ]] ; then
-			opts+=" -G ${exgroups:1}"
+			opts+=( -G "${exgroups:1}" )
 		fi
 	else
 		egroups="(none)"
@@ -215,50 +215,51 @@
 	if [[ $# -gt 0 ]] ; then
 		die "extra arguments no longer supported; please file a bug"
 	else
-		set -- -c "added by portage for ${PN}"
-		einfo " - Extra: $@"
+		local comment="added by portage for ${PN}"
+		opts+=( -c "${comment}" )
+		einfo " - GECOS: ${comment}"
 	fi
 
 	# add the user
 	case ${CHOST} in
 	*-darwin*)
 		### Make the user
-		dscl . create /users/${euser} uid ${euid}
-		dscl . create /users/${euser} shell ${eshell}
-		dscl . create /users/${euser} home ${ehome}
-		dscl . create /users/${euser} realname "added by portage for ${PN}"
+		dscl . create "/users/${euser}" uid ${euid}
+		dscl . create "/users/${euser}" shell "${eshell}"
+		dscl . create "/users/${euser}" home "${ehome}"
+		dscl . create "/users/${euser}" realname "added by portage for ${PN}"
 		### Add the user to the groups specified
-		local oldifs=${IFS}
+		local g oldifs=${IFS}
 		export IFS=","
 		for g in ${egroups} ; do
-			dscl . merge /groups/${g} users ${euser}
+			dscl . merge "/groups/${g}" users "${euser}"
 		done
 		export IFS=${oldifs}
 		;;
 
 	*-freebsd*|*-dragonfly*)
-		pw useradd ${euser} ${opts} "$@" || die
+		pw useradd "${euser}" "${opts[@]}" || die
 		;;
 
 	*-netbsd*)
-		useradd ${opts} ${euser} "$@" || die
+		useradd "${opts[@]}" "${euser}" || die
 		;;
 
 	*-openbsd*)
 		# all ops the same, except the -g vs -g/-G ...
-		useradd -u ${euid} -s ${eshell} \
-			-d ${ehome} -g ${egroups} "$@" ${euser} || die
+		useradd -u ${euid} -s "${eshell}" \
+			-d "${ehome}" -g "${egroups}" "${euser}" || die
 		;;
 
 	*)
-		useradd -r ${opts} "$@" ${euser} || die
+		useradd -r "${opts[@]}" "${euser}" || die
 		;;
 	esac
 
 	if [[ ! -e ${ROOT}/${ehome} ]] ; then
 		einfo " - Creating ${ehome} in ${ROOT}"
 		mkdir -p "${ROOT}/${ehome}"
-		chown ${euser} "${ROOT}/${ehome}"
+		chown "${euser}" "${ROOT}/${ehome}"
 		chmod 755 "${ROOT}/${ehome}"
 	fi
 }
@@ -274,36 +275,23 @@
 	_assert_pkg_ebuild_phase enewgroup
 
 	# get the group
-	local egroup="$1"; shift
-	if [ -z "${egroup}" ]
-	then
+	local egroup=$1; shift
+	if [[ -z ${egroup} ]] ; then
 		eerror "No group specified !"
 		die "Cannot call enewgroup without a group"
 	fi
 
 	# see if group already exists
-	if [[ -n $(egetent group "${egroup}") ]]; then
+	if [[ -n $(egetent group "${egroup}") ]] ; then
 		return 0
 	fi
 	einfo "Adding group '${egroup}' to your system ..."
 
-	# options to pass to useradd
-	local opts=
-
 	# handle gid
-	local egid="$1"; shift
-	if [ ! -z "${egid}" ]
-	then
-		if [ "${egid}" -gt 0 ]
-		then
-			if [ -z "`egetent group ${egid}`" ]
-			then
-				if [[ "${CHOST}" == *-darwin* ]]; then
-					opts+=" ${egid}"
-				else
-					opts+=" -g ${egid}"
-				fi
-			else
+	local egid=$1; shift
+	if [[ ! -z ${egid} ]] ; then
+		if [[ ${egid} -gt 0 ]] ; then
+			if [[ -n $(egetent group ${egid}) ]] ; then
 				egid="next available; requested gid taken"
 			fi
 		else
@@ -316,47 +304,48 @@
 	einfo " - Groupid: ${egid}"
 
 	# handle extra
-	if [ $# -gt 0 ] ; then
+	if [[ $# -gt 0 ]] ; then
 		die "extra arguments no longer supported; please file a bug"
 	fi
 
+	# Some targets need to find the next available GID manually
+	_enewgroup_next_gid() {
+		if [[ ${egid} == *[!0-9]* ]] ; then
+			 # Non numeric
+			for ((egid = 101; egid <= 999; egid++)) ; do
+				[[ -z $(egetent group ${egid}) ]] && break
+			done
+		fi
+	}
+
 	# add the group
 	case ${CHOST} in
 	*-darwin*)
-		# If we need the next available
-		case ${egid} in
-		*[!0-9]*) # Non numeric
-			for ((egid = 101; egid <= 999; egid++)); do
-				[[ -z $(egetent group ${egid}) ]] && break
-			done
-		esac
-		dscl . create /groups/${egroup} gid ${egid}
-		dscl . create /groups/${egroup} passwd '*'
+		_enewgroup_next_gid
+		dscl . create "/groups/${egroup}" gid ${egid}
+		dscl . create "/groups/${egroup}" passwd '*'
 		;;
 
 	*-freebsd*|*-dragonfly*)
-		case ${egid} in
-			*[!0-9]*) # Non numeric
-				for ((egid = 101; egid <= 999; egid++)); do
-					[[ -z $(egetent group ${egid}) ]] && break
-				done
-		esac
-		pw groupadd ${egroup} -g ${egid} || die
+		_enewgroup_next_gid
+		pw groupadd "${egroup}" -g ${egid} || die
 		;;
 
 	*-netbsd*)
-		case ${egid} in
-		*[!0-9]*) # Non numeric
-			for ((egid = 101; egid <= 999; egid++)); do
-				[[ -z $(egetent group ${egid}) ]] && break
-			done
-		esac
-		groupadd -g ${egid} ${egroup} || die
+		_enewgroup_next_gid
+		groupadd -g ${egid} "${egroup}" || die
 		;;
 
 	*)
+		local opts
+		if [[ ${egid} == *[!0-9]* ]] ; then
+			 # Non numeric; let groupadd figure out a GID for us
+			opts=""
+		else
+			opts="-g ${egid}"
+		fi
 		# We specify -r so that we get a GID in the system range from login.defs
-		groupadd -r ${opts} ${egroup} || die
+		groupadd -r ${opts} "${egroup}" || die
 		;;
 	esac
 }
@@ -379,7 +368,7 @@
 		;;
 	esac
 
-	egetent passwd $1 | cut -d: -f${pos}
+	egetent passwd "$1" | cut -d: -f${pos}
 }
 
 # @FUNCTION: egetshell






^ permalink raw reply	[flat|nested] 12+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: user.eclass
@ 2011-11-29 19:01 Mike Frysinger (vapier)
  0 siblings, 0 replies; 12+ messages in thread
From: Mike Frysinger (vapier) @ 2011-11-29 19:01 UTC (permalink / raw
  To: gentoo-commits

vapier      11/11/29 19:01:28

  Modified:             user.eclass
  Log:
  tweak failure message as pointed out by David James

Revision  Changes    Path
1.15                 eclass/user.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/user.eclass?rev=1.15&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/user.eclass?rev=1.15&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/user.eclass?r1=1.14&r2=1.15

Index: user.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/user.eclass,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- user.eclass	26 Nov 2011 07:20:31 -0000	1.14
+++ user.eclass	29 Nov 2011 19:01:28 -0000	1.15
@@ -1,6 +1,6 @@
 # Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/user.eclass,v 1.14 2011/11/26 07:20:31 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/user.eclass,v 1.15 2011/11/29 19:01:28 vapier Exp $
 
 # @ECLASS: user.eclass
 # @MAINTAINER:
@@ -20,9 +20,10 @@
 	case ${EBUILD_PHASE} in
 	setup|preinst|postinst) ;;
 	*)
-		eerror "'$1()' called from '${EBUILD_PHASE}()' which is not a pkg_* function."
+		eerror "'$1()' called from '${EBUILD_PHASE}' phase which is not OK:"
+		eerror "You may only call from pkg_{setup,preinst,postinst} functions."
 		eerror "Package fails at QA and at life.  Please file a bug."
-		die "Bad package!  $1 is only for use in pkg_* functions!"
+		die "Bad package!  $1 is only for use in some pkg_* functions!"
 	esac
 }
 
@@ -103,7 +104,7 @@
 # Default uid is (pass -1 for this) next available, default shell is
 # /bin/false, default homedir is /dev/null, and there are no default groups.
 enewuser() {
-	_assert_pkg_ebuild_phase enewuser
+	_assert_pkg_ebuild_phase ${FUNCNAME}
 
 	# get the username
 	local euser=$1; shift
@@ -272,7 +273,7 @@
 # do the rest.  You may specify the gid for the group or allow the group to
 # allocate the next available one.
 enewgroup() {
-	_assert_pkg_ebuild_phase enewgroup
+	_assert_pkg_ebuild_phase ${FUNCNAME}
 
 	# get the group
 	local egroup=$1; shift






^ permalink raw reply	[flat|nested] 12+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: user.eclass
@ 2011-11-29 19:31 Mike Frysinger (vapier)
  0 siblings, 0 replies; 12+ messages in thread
From: Mike Frysinger (vapier) @ 2011-11-29 19:31 UTC (permalink / raw
  To: gentoo-commits

vapier      11/11/29 19:31:20

  Modified:             user.eclass
  Log:
  avoid IFS abuse by using `IFS=, read -a` to have bash create an array for us as pointed out by David James

Revision  Changes    Path
1.16                 eclass/user.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/user.eclass?rev=1.16&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/user.eclass?rev=1.16&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/user.eclass?r1=1.15&r2=1.16

Index: user.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/user.eclass,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- user.eclass	29 Nov 2011 19:01:28 -0000	1.15
+++ user.eclass	29 Nov 2011 19:31:20 -0000	1.16
@@ -1,6 +1,6 @@
 # Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/user.eclass,v 1.15 2011/11/29 19:01:28 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/user.eclass,v 1.16 2011/11/29 19:31:20 vapier Exp $
 
 # @ECLASS: user.eclass
 # @MAINTAINER:
@@ -183,13 +183,12 @@
 
 	# handle groups
 	local egroups=$1; shift
-	if [[ ! -z ${egroups} ]] ; then
-		local oldifs=${IFS}
-		local defgroup="" exgroups=""
-
-		export IFS=","
-		for g in ${egroups} ; do
-			export IFS=${oldifs}
+	local g egroups_arr
+	IFS="," read -r -a egroups_arr <<<"${egroups}"
+	shift
+	if [[ ${#egroups_arr[@]} -gt 0 ]] ; then
+		local defgroup exgroups
+		for g in "${egroups_arr[@]}" ; do
 			if [[ -z $(egetent group "${g}") ]] ; then
 				eerror "You must add group ${g} to the system first"
 				die "${g} is not a valid GID"
@@ -197,20 +196,15 @@
 			if [[ -z ${defgroup} ]] ; then
 				defgroup=${g}
 			else
-				exgroups="${exgroups},${g}"
+				exgroups+=",${g}"
 			fi
-			export IFS=","
 		done
-		export IFS=${oldifs}
-
 		opts+=( -g "${defgroup}" )
 		if [[ ! -z ${exgroups} ]] ; then
 			opts+=( -G "${exgroups:1}" )
 		fi
-	else
-		egroups="(none)"
 	fi
-	einfo " - Groups: ${egroups}"
+	einfo " - Groups: ${egroups:-(none)}"
 
 	# handle extra args
 	if [[ $# -gt 0 ]] ; then
@@ -230,12 +224,9 @@
 		dscl . create "/users/${euser}" home "${ehome}"
 		dscl . create "/users/${euser}" realname "added by portage for ${PN}"
 		### Add the user to the groups specified
-		local g oldifs=${IFS}
-		export IFS=","
-		for g in ${egroups} ; do
+		for g in "${egroups_arr[@]}" ; do
 			dscl . merge "/groups/${g}" users "${euser}"
 		done
-		export IFS=${oldifs}
 		;;
 
 	*-freebsd*|*-dragonfly*)






^ permalink raw reply	[flat|nested] 12+ messages in thread

* [gentoo-commits] gentoo-x86 commit in eclass: user.eclass
@ 2011-11-29 19:32 Mike Frysinger (vapier)
  0 siblings, 0 replies; 12+ messages in thread
From: Mike Frysinger (vapier) @ 2011-11-29 19:32 UTC (permalink / raw
  To: gentoo-commits

vapier      11/11/29 19:32:23

  Modified:             user.eclass
  Log:
  eat mangled whitespace pointed out by David James

Revision  Changes    Path
1.17                 eclass/user.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/user.eclass?rev=1.17&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/user.eclass?rev=1.17&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/user.eclass?r1=1.16&r2=1.17

Index: user.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/user.eclass,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- user.eclass	29 Nov 2011 19:31:20 -0000	1.16
+++ user.eclass	29 Nov 2011 19:32:23 -0000	1.17
@@ -1,6 +1,6 @@
 # Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/user.eclass,v 1.16 2011/11/29 19:31:20 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/user.eclass,v 1.17 2011/11/29 19:32:23 vapier Exp $
 
 # @ECLASS: user.eclass
 # @MAINTAINER:
@@ -303,7 +303,7 @@
 	# Some targets need to find the next available GID manually
 	_enewgroup_next_gid() {
 		if [[ ${egid} == *[!0-9]* ]] ; then
-			 # Non numeric
+			# Non numeric
 			for ((egid = 101; egid <= 999; egid++)) ; do
 				[[ -z $(egetent group ${egid}) ]] && break
 			done
@@ -331,7 +331,7 @@
 	*)
 		local opts
 		if [[ ${egid} == *[!0-9]* ]] ; then
-			 # Non numeric; let groupadd figure out a GID for us
+			# Non numeric; let groupadd figure out a GID for us
 			opts=""
 		else
 			opts="-g ${egid}"






^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2011-11-29 19:32 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-26  7:20 [gentoo-commits] gentoo-x86 commit in eclass: user.eclass Mike Frysinger (vapier)
  -- strict thread matches above, loose matches on Subject: below --
2011-11-29 19:32 Mike Frysinger (vapier)
2011-11-29 19:31 Mike Frysinger (vapier)
2011-11-29 19:01 Mike Frysinger (vapier)
2011-11-26  6:50 Mike Frysinger (vapier)
2011-11-26  6:45 Mike Frysinger (vapier)
2011-11-26  6:42 Mike Frysinger (vapier)
2011-11-03 15:29 Mike Frysinger (vapier)
2011-11-03  0:35 Mike Frysinger (vapier)
2011-11-03  0:24 Mike Frysinger (vapier)
2011-10-27  7:49 Mike Frysinger (vapier)
2011-10-27  7:26 Mike Frysinger (vapier)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox