summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gentoo.org>2005-09-18 22:02:59 +0000
committerDiego Elio Pettenò <flameeyes@gentoo.org>2005-09-18 22:02:59 +0000
commitfcaeb965bc4ab52aabf9c5faa0986133640c1a34 (patch)
tree458c0097b15fa9461984f9244a0afe595da07753 /eclass/eutils.eclass
parentAdded NoTapTyping warning. (diff)
downloadgentoo-2-fcaeb965bc4ab52aabf9c5faa0986133640c1a34.tar.gz
gentoo-2-fcaeb965bc4ab52aabf9c5faa0986133640c1a34.tar.bz2
gentoo-2-fcaeb965bc4ab52aabf9c5faa0986133640c1a34.zip
Do autorecognizion of shell to use checking for file presence instead of basing on userland.
Diffstat (limited to 'eclass/eutils.eclass')
-rw-r--r--eclass/eutils.eclass17
1 files changed, 11 insertions, 6 deletions
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 <azarah@gentoo.org>
#
@@ -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}"