diff options
author | Mike Frysinger <vapier@gentoo.org> | 2004-12-07 01:32:01 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2004-12-07 01:32:01 +0000 |
commit | 1c1f1c7dcddd32b72ec114c964609b4304b78a0f (patch) | |
tree | 1a8e1ba0bec18bb36fb6257420c723ce66c9515a /eclass | |
parent | mime.types dependancy (Manifest recommit) (diff) | |
download | gentoo-2-1c1f1c7dcddd32b72ec114c964609b4304b78a0f.tar.gz gentoo-2-1c1f1c7dcddd32b72ec114c964609b4304b78a0f.tar.bz2 gentoo-2-1c1f1c7dcddd32b72ec114c964609b4304b78a0f.zip |
built_with_use()
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/eutils.eclass | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index 73ffb49d36f9..38f8755bf06a 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.124 2004/11/13 11:15:33 usata Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.125 2004/12/07 01:32:01 vapier Exp $ # # Author: Martin Schlemmer <azarah@gentoo.org> # @@ -1515,3 +1515,23 @@ preserve_old_lib_notify() { einfo "Note: 'emerge gentoolkit' to get revdep-rebuild" fi } + +# Hack for people to figure out if a package was built with +# certain USE flags +# +# Usage: built_with_use <DEPEND ATOM> <List of USE flags> +# ex: built_with_use xchat gtk2 +built_with_use() { + local PKG=$(portageq best_version ${ROOT} $1) + local USEFILE="${ROOT}/var/db/pkg/${PKG}/USE" + [[ ! -e ${USEFILE} ]] && return 1 + + local USE_BUILT=$(<${USEFILE}) + + shift + while [ $# -gt 0 ] ; do + has $1 ${USE_BUILT} || return 1 + shift + done + return 0 +} |