diff options
author | Mike Frysinger <vapier@gentoo.org> | 2011-11-03 00:26:17 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2011-11-03 00:26:17 +0000 |
commit | cdee26f78315d439cbbdcfec4e8ff5ef35b02175 (patch) | |
tree | 929debfc104d3b414e3bd5d697a3f1d7d045936a /eclass/user.eclass | |
parent | clean up egetent style to make it clear how it works (diff) | |
download | gentoo-2-cdee26f78315d439cbbdcfec4e8ff5ef35b02175.tar.gz gentoo-2-cdee26f78315d439cbbdcfec4e8ff5ef35b02175.tar.bz2 gentoo-2-cdee26f78315d439cbbdcfec4e8ff5ef35b02175.zip |
restore egethome as some packages in the tree have been parsing getent directly for this
Diffstat (limited to 'eclass/user.eclass')
-rw-r--r-- | eclass/user.eclass | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/eclass/user.eclass b/eclass/user.eclass index 4631ca10e2ba..1ae623d38dbf 100644 --- a/eclass/user.eclass +++ b/eclass/user.eclass @@ -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.5 2011/11/03 00:24:19 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/user.eclass,v 1.6 2011/11/03 00:26:17 vapier Exp $ # @ECLASS: user.eclass # @MAINTAINER: @@ -404,3 +404,22 @@ enewgroup() { esac export SANDBOX_ON="${oldsandbox}" } + +# @FUNCTION: egethome +# @USAGE: <user> +# @DESCRIPTION: +# Gets the home directory for the specified user. +egethome() { + local pos + + case ${CHOST} in + *-darwin*|*-freebsd*|*-dragonfly*) + pos=9 + ;; + *) # Linux, NetBSD, OpenBSD, etc... + pos=6 + ;; + esac + + egetent passwd $1 | cut -d: -f${pos} +} |