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

Diff of /eclass/eutils.eclass

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

Revision 1.245 Revision 1.247
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.245 2006/07/15 19:26:55 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.247 2006/08/11 02:21:47 vapier 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!
1581built_with_use() { 1581built_with_use() {
1582 local opt=$1 1582 local opt=$1
1583 [[ ${opt:0:1} = "-" ]] && shift || opt="-a" 1583 [[ ${opt:0:1} = "-" ]] && shift || opt="-a"
1584 1584
1585 local PKG=$(best_version $1) 1585 local PKG=$(best_version $1)
1586 [[ -z ${PKG} ]] && die "Unable to resolve $1 to an installed package"
1586 shift 1587 shift
1587 1588
1588 local USEFILE=${ROOT}/var/db/pkg/${PKG}/USE 1589 local USEFILE=${ROOT}/var/db/pkg/${PKG}/USE
1589 1590
1590 # if the USE file doesnt exist, assume the $PKG is either 1591 # if the USE file doesnt exist, assume the $PKG is either
1591 # injected or package.provided 1592 # injected or package.provided
1592 [[ ! -e ${USEFILE} ]] && return 0 1593 [[ ! -e ${USEFILE} ]] && die "Unable to determine what USE flags $PKG was built with"
1593 1594
1594 local USE_BUILT=$(<${USEFILE}) 1595 local USE_BUILT=$(<${USEFILE})
1595 while [[ $# -gt 0 ]] ; do 1596 while [[ $# -gt 0 ]] ; do
1596 if [[ ${opt} = "-o" ]] ; then 1597 if [[ ${opt} = "-o" ]] ; then
1597 has $1 ${USE_BUILT} && return 0 1598 has $1 ${USE_BUILT} && return 0

Legend:
Removed from v.1.245  
changed lines
  Added in v.1.247

  ViewVC Help
Powered by ViewVC 1.1.20