| 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.253 2006/10/06 07:00:14 flameeyes 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;; |
| … | |
… | |
| 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 |