summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorHans de Graaff <graaff@gentoo.org>2011-07-22 09:08:59 +0000
committerHans de Graaff <graaff@gentoo.org>2011-07-22 09:08:59 +0000
commitd199e65292ba601f757a044cb678719202319625 (patch)
tree2dc76465538e4e22d166c1d98107e4bc47ce7cb5 /eclass
parentVersion bump, security bug #375977. (diff)
downloadhistorical-d199e65292ba601f757a044cb678719202319625.tar.gz
historical-d199e65292ba601f757a044cb678719202319625.tar.bz2
historical-d199e65292ba601f757a044cb678719202319625.zip
Leverage the REQUIRED_USE mechanism to determine at dependency resolution time if this ebuild can satisfy RUBY_TARGETS. Patch by Matthew Schultz in bug 373227.
Diffstat (limited to 'eclass')
-rw-r--r--eclass/ruby-ng.eclass17
1 files changed, 16 insertions, 1 deletions
diff --git a/eclass/ruby-ng.eclass b/eclass/ruby-ng.eclass
index 0d32217c118e..a63a285fd907 100644
--- a/eclass/ruby-ng.eclass
+++ b/eclass/ruby-ng.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-ng.eclass,v 1.35 2011/07/19 05:48:09 graaff Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-ng.eclass,v 1.36 2011/07/22 09:08:59 graaff Exp $
#
# @ECLASS: ruby-ng.eclass
# @MAINTAINER:
@@ -257,6 +257,21 @@ ruby_add_bdepend() {
RDEPEND="${RDEPEND}"
}
+# @FUNCTION: ruby_get_use_targets
+# @DESCRIPTION:
+# Gets an array of ruby use targets that the ebuild sets
+ruby_get_use_targets() {
+ local t implementation
+ for implementation in ${USE_RUBY}; do
+ t+=" ruby_targets_${implementation}"
+ done
+ echo $t
+}
+
+if [[ ${EAPI:-0} -ge 4 && ${RUBY_OPTIONAL} != "yes" ]]; then
+ REQUIRED_USE=" || ( $(ruby_get_use_targets) )"
+fi
+
for _ruby_implementation in $USE_RUBY; do
IUSE="${IUSE} ruby_targets_${_ruby_implementation}"