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

Diff of /eclass/eutils.eclass

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

Revision 1.129 Revision 1.130
1# Copyright 1999-2004 Gentoo Foundation 1# Copyright 1999-2004 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.129 2004/12/23 20:38:25 eradicator Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.130 2004/12/24 07:16:14 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.
1528} 1528}
1529 1529
1530# Hack for people to figure out if a package was built with 1530# Hack for people to figure out if a package was built with
1531# certain USE flags 1531# certain USE flags
1532# 1532#
1533# Usage: built_with_use <DEPEND ATOM> <List of USE flags> 1533# Usage: built_with_use [-a|-o] <DEPEND ATOM> <List of USE flags>
1534# ex: built_with_use xchat gtk2 1534# ex: built_with_use xchat gtk2
1535#
1536# Flags: -a all USE flags should be utilized
1537# -o at least one USE flag should be utilized
1538# Note: the default flag is '-a'
1535built_with_use() { 1539built_with_use() {
1540 local opt=$1
1541 [[ ${opt:0:1} = "-" ]] && shift || opt="-a"
1542
1536 local PKG=$(portageq best_version ${ROOT} $1) 1543 local PKG=$(best_version $1)
1544 shift
1545
1537 local USEFILE="${ROOT}/var/db/pkg/${PKG}/USE" 1546 local USEFILE="${ROOT}/var/db/pkg/${PKG}/USE"
1538 [[ ! -e ${USEFILE} ]] && return 1 1547 [[ ! -e ${USEFILE} ]] && return 1
1539 1548
1540 local USE_BUILT=$(<${USEFILE}) 1549 local USE_BUILT=$(<${USEFILE})
1541
1542 shift
1543 while [ $# -gt 0 ] ; do 1550 while [[ $# -gt 0 ]] ; do
1551 if [[ ${opt} = "-o" ]] ; then
1552 has $1 ${USE_BUILT} && return 0
1553 else
1544 has $1 ${USE_BUILT} || return 1 1554 has $1 ${USE_BUILT} || return 1
1555 fi
1545 shift 1556 shift
1546 done 1557 done
1547 return 0 1558 [[ ${opt} = "-a" ]]
1548} 1559}
1549 1560
1550# Many configure scripts wrongly bail when a C++ compiler 1561# Many configure scripts wrongly bail when a C++ compiler
1551# could not be detected. #73450 1562# could not be detected. #73450
1552epunt_cxx() { 1563epunt_cxx() {

Legend:
Removed from v.1.129  
changed lines
  Added in v.1.130

  ViewVC Help
Powered by ViewVC 1.1.20