| 1 | # Copyright 1999-2006 Gentoo Foundation |
1 | # Copyright 1999-2006 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | # $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.252 2006/10/05 00:12:07 nyhm Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.254 2006/10/18 21:35:19 drizzt Exp $ |
| 4 | # |
4 | # |
| 5 | # This eclass is for general purpose functions that most ebuilds |
5 | # This eclass is for general purpose functions that most ebuilds |
| 6 | # have to implement themselves. |
6 | # have to implement themselves. |
| 7 | # |
7 | # |
| 8 | # NB: If you add anything, please comment it! |
8 | # NB: If you add anything, please comment it! |
| … | |
… | |
| 501 | for shell in /sbin/nologin /usr/sbin/nologin /bin/false /usr/bin/false /dev/null ; do |
501 | for shell in /sbin/nologin /usr/sbin/nologin /bin/false /usr/bin/false /dev/null ; do |
| 502 | [[ -x ${ROOT}${shell} ]] && break |
502 | [[ -x ${ROOT}${shell} ]] && break |
| 503 | done |
503 | done |
| 504 | |
504 | |
| 505 | if [[ ${shell} == "/dev/null" ]] ; then |
505 | if [[ ${shell} == "/dev/null" ]] ; then |
| 506 | eerror "Unable to identify the shell to use" |
506 | eerror "Unable to identify the shell to use, proceeding with userland default." |
| 507 | die "Unable to identify the shell to use" |
507 | case ${USERLAND} in |
|
|
508 | GNU) shell="/bin/false" ;; |
|
|
509 | BSD) shell="/sbin/nologin" ;; |
|
|
510 | Darwin) shell="/usr/sbin/nologin" ;; |
|
|
511 | *) die "Unable to identify the default shell for userland ${USERLAND}" |
|
|
512 | esac |
| 508 | fi |
513 | fi |
| 509 | |
514 | |
| 510 | eshell=${shell} |
515 | eshell=${shell} |
| 511 | fi |
516 | fi |
| 512 | einfo " - Shell: ${eshell}" |
517 | einfo " - Shell: ${eshell}" |
| … | |
… | |
| 917 | ) |
922 | ) |
| 918 | } |
923 | } |
| 919 | |
924 | |
| 920 | # Make a GDM/KDM Session file |
925 | # Make a GDM/KDM Session file |
| 921 | # |
926 | # |
| 922 | # make_desktop_entry(<title>, <command>) |
927 | # make_session_desktop(<title>, <command>) |
| 923 | # title: File to execute to start the Window Manager |
928 | # title: File to execute to start the Window Manager |
| 924 | # command: Name of the Window Manager |
929 | # command: Name of the Window Manager |
| 925 | |
930 | |
| 926 | make_session_desktop() { |
931 | make_session_desktop() { |
| 927 | [[ -z $1 ]] && eerror "make_session_desktop: You must specify the title" && return 1 |
932 | [[ -z $1 ]] && eerror "make_session_desktop: You must specify the title" && return 1 |