From: Diego Elio Pettenò Date: Sun, 18 Sep 2005 22:02:59 +0000 (+0000) Subject: Do autorecognizion of shell to use checking for file presence instead of basing on... X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8ad98a97a4d742978e303e3358fa4d08cd12e450;p=gentoo.git Do autorecognizion of shell to use checking for file presence instead of basing on userland. --- diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index 3f63db4c420b..d793f631dc8d 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.197 2005/09/18 17:33:44 flameeyes Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.198 2005/09/18 22:02:59 flameeyes Exp $ # # Author: Martin Schlemmer # @@ -494,11 +494,16 @@ enewuser() { die "${eshell} does not exist" fi else - case ${USERLAND} in - Darwin) eshell="/usr/bin/false";; - BSD) eshell="/usr/sbin/nologin";; - *) eshell="/bin/false";; - esac + for shell in /sbin/nologin /usr/sbin/nologin /bin/false /usr/bin/false /dev/null; do + [[ -x ${ROOT}${shell} ]] && break; + done + + if [[ ${shell} == "/dev/null" ]]; then + eerror "Unable to identify the shell to use" + die "Unable to identify the shell to use" + fi + + eshell=${shell} fi einfo " - Shell: ${eshell}" opts="${opts} -s ${eshell}"