| 1 | # Copyright 1999-2005 Gentoo Foundation |
1 | # Copyright 1999-2005 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.212 2005/10/22 02:32:48 vapier Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.213 2005/10/22 19:04:02 vapier Exp $ |
| 4 | # |
4 | # |
| 5 | # Author: Martin Schlemmer <azarah@gentoo.org> |
5 | # Author: Martin Schlemmer <azarah@gentoo.org> |
| 6 | # |
6 | # |
| 7 | # This eclass is for general purpose functions that most ebuilds |
7 | # This eclass is for general purpose functions that most ebuilds |
| 8 | # have to implement themselves. |
8 | # have to implement themselves. |
| … | |
… | |
| 1555 | [[ ${opt:0:1} = "-" ]] && shift || opt="-a" |
1555 | [[ ${opt:0:1} = "-" ]] && shift || opt="-a" |
| 1556 | |
1556 | |
| 1557 | local PKG=$(best_version $1) |
1557 | local PKG=$(best_version $1) |
| 1558 | shift |
1558 | shift |
| 1559 | |
1559 | |
| 1560 | local USEFILE="${ROOT}/var/db/pkg/${PKG}/USE" |
1560 | local USEFILE=${ROOT}/var/db/pkg/${PKG}/USE |
|
|
1561 | |
|
|
1562 | # if the USE file doesnt exist, assume the $PKG is either |
|
|
1563 | # injected or package.provided |
| 1561 | [[ ! -e ${USEFILE} ]] && return 1 |
1564 | [[ ! -e ${USEFILE} ]] && return 0 |
| 1562 | |
1565 | |
| 1563 | local USE_BUILT=$(<${USEFILE}) |
1566 | local USE_BUILT=$(<${USEFILE}) |
| 1564 | while [[ $# -gt 0 ]] ; do |
1567 | while [[ $# -gt 0 ]] ; do |
| 1565 | if [[ ${opt} = "-o" ]] ; then |
1568 | if [[ ${opt} = "-o" ]] ; then |
| 1566 | has $1 ${USE_BUILT} && return 0 |
1569 | has $1 ${USE_BUILT} && return 0 |