/[gentoo-x86]/eclass/eutils.eclass
Gentoo

Diff of /eclass/eutils.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.248 Revision 1.255
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.248 2006/08/19 13:52:02 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.255 2006/10/24 17:27:31 wolf31o2 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}"
817 games) 822 games)
818 case ${catmin} in 823 case ${catmin} in
819 action) type=ActionGame;; 824 action) type=ActionGame;;
820 arcade) type=ArcadeGame;; 825 arcade) type=ArcadeGame;;
821 board) type=BoardGame;; 826 board) type=BoardGame;;
822 kid) type=KidsGame;; 827 kids) type=KidsGame;;
823 emulation) type=Emulator;; 828 emulation) type=Emulator;;
824 puzzle) type=LogicGame;; 829 puzzle) type=LogicGame;;
825 rpg) type=RolePlaying;; 830 rpg) type=RolePlaying;;
826 roguelike) type=RolePlaying;; 831 roguelike) type=RolePlaying;;
827 simulation) type=Simulation;; 832 simulation) type=Simulation;;
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
926make_session_desktop() { 931make_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
1205 # accepted ... if we don't find a match, we make the user accept 1210 # accepted ... if we don't find a match, we make the user accept
1206 local shopts=$- 1211 local shopts=$-
1207 local alic 1212 local alic
1208 set -o noglob #so that bash doesn't expand "*" 1213 set -o noglob #so that bash doesn't expand "*"
1209 for alic in ${ACCEPT_LICENSE} ; do 1214 for alic in ${ACCEPT_LICENSE} ; do
1210 if [[ ${alic} == * || ${alic} == ${l} ]]; then 1215 if [[ ${alic} == ${l} ]]; then
1211 set +o noglob; set -${shopts} #reset old shell opts 1216 set +o noglob; set -${shopts} #reset old shell opts
1212 return 0 1217 return 0
1213 fi 1218 fi
1214 done 1219 done
1215 set +o noglob; set -$shopts #reset old shell opts 1220 set +o noglob; set -$shopts #reset old shell opts
1593 local PKG=$(best_version $1) 1598 local PKG=$(best_version $1)
1594 [[ -z ${PKG} ]] && die "Unable to resolve $1 to an installed package" 1599 [[ -z ${PKG} ]] && die "Unable to resolve $1 to an installed package"
1595 shift 1600 shift
1596 1601
1597 local USEFILE=${ROOT}/var/db/pkg/${PKG}/USE 1602 local USEFILE=${ROOT}/var/db/pkg/${PKG}/USE
1603 local IUSEFILE=${ROOT}/var/db/pkg/${PKG}/IUSE
1598 1604
1599 # if the USE file doesnt exist, assume the $PKG is either 1605 # if the USE file doesnt exist, assume the $PKG is either
1600 # injected or package.provided 1606 # injected or package.provided
1601 [[ ! -e ${USEFILE} ]] && die "Unable to determine what USE flags $PKG was built with" 1607 [[ ! -e ${USEFILE} ]] && die "Unable to determine what USE flags $PKG was built with"
1608
1609 local IUSE_BUILT=$(<${IUSEFILE})
1610 # Don't check USE_EXPAND #147237
1611 local expand
1612 for expand in $(echo ${USE_EXPAND} | tr '[:upper:]' '[:lower:]') ; do
1613 if [[ $1 == ${expand}_* ]] ; then
1614 expand=""
1615 break
1616 fi
1617 done
1618 if [[ -n ${expand} ]] ; then
1619 has $1 ${IUSE_BUILT} || die "$PKG does not actually support the $1 USE flag!"
1620 fi
1602 1621
1603 local USE_BUILT=$(<${USEFILE}) 1622 local USE_BUILT=$(<${USEFILE})
1604 while [[ $# -gt 0 ]] ; do 1623 while [[ $# -gt 0 ]] ; do
1605 if [[ ${opt} = "-o" ]] ; then 1624 if [[ ${opt} = "-o" ]] ; then
1606 has $1 ${USE_BUILT} && return 0 1625 has $1 ${USE_BUILT} && return 0

Legend:
Removed from v.1.248  
changed lines
  Added in v.1.255

  ViewVC Help
Powered by ViewVC 1.1.20