From 9f603c3b16ae0705530b1d5f079f355a4b18eb72 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Diego=20Elio=20Petten=C3=B2?= Date: Sat, 22 May 2010 12:31:03 +0000 Subject: [PATCH] Use a slightly different syntax for expliciting implementation-dependent dependencies. Rather than using a single, huge USE-conditional per atom, put the dependendencies under conditional _and_ USE-dependency. This allows for syntax like: USE_RUBY="ruby18 ruby19" ... ruby_add_bdepend "test? ( dev-ruby/first )" USE_RUBY="ruby18" ruby_add_bdepend "test? ( dev-ruby/second )" USE_RUBY="ruby19" ruby_add_bdepend "test? ( dev-ruby/third )" --- eclass/ruby-ng.eclass | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/eclass/ruby-ng.eclass b/eclass/ruby-ng.eclass index 11516aebb7f7..7c5de961ce74 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.16 2010/05/22 12:18:07 flameeyes Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-ng.eclass,v 1.17 2010/05/22 12:31:03 flameeyes Exp $ # # @ECLASS: ruby-ng.eclass # @MAINTAINER: @@ -112,21 +112,27 @@ ruby_samelib() { echo "[${res%,}]" } -_ruby_implementation_depend() { - echo "ruby_targets_${1}? ( ${2}[ruby_targets_${1}] )" -} - -_ruby_atoms_samelib() { - local samelib=$(ruby_samelib) - +_ruby_atoms_samelib_generic() { + echo "RUBYTARGET? (" for token in $*; do case "$token" in "||" | "(" | ")" | *"?") echo "${token}" ;; *) - echo "${token}${samelib}" ;; + # TODO we need to deal with merging USE-based + # dependencies + echo "${token}[RUBYTARGET]" ;; esac done + echo ")" +} + +_ruby_atoms_samelib() { + local atoms=$(_ruby_atoms_samelib_generic "$*") + + for _ruby_implementation in $USE_RUBY; do + echo "${atoms//RUBYTARGET/ruby_targets_${_ruby_implementation}}" + done } _ruby_wrap_conditions() { -- 2.26.2