From 368579d83004a96b085548a97a9d79f6c7e14687 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Diego=20Elio=20Petten=C3=B2?= Date: Fri, 21 May 2010 23:18:46 +0000 Subject: [PATCH] Change processing of atoms in ruby_add_rdepend and ruby_add_bdepend to make it possible to process complex dependency strings, such as || ( virtual/ruby-test-unit dev-ruby/test-unit:2 ) which is going to be common for test-unit-2 compatible packages; to have a proper dependency tree. This, theorically, can also drop the need for the 2-ary calls for ruby_add_bdepend and ruby_add_rdepend. --- eclass/ruby-ng.eclass | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/eclass/ruby-ng.eclass b/eclass/ruby-ng.eclass index 4e5a3ec4710d..8d86e7c03b22 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.13 2010/05/01 16:05:45 flameeyes Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-ng.eclass,v 1.14 2010/05/21 23:18:46 flameeyes Exp $ # # @ECLASS: ruby-ng.eclass # @MAINTAINER: @@ -142,6 +142,19 @@ _ruby_add_rdepend() { _ruby_add_bdepend "$atom" test } +_ruby_atoms_samelib() { + local samelib=$(ruby_samelib) + + for token in $*; do + case "$token" in + "||" | "(" | ")" ) + echo "${token}" ;; + *) + echo "${token}${samelib}" ;; + esac + done +} + # @FUNCTION: ruby_add_rdepend # @USAGE: [conditions] atom # @DESCRIPTION: @@ -167,9 +180,7 @@ ruby_add_rdepend() { ;; esac - for atom in $atoms; do - _ruby_add_rdepend "${atom}$(ruby_samelib)" "$conditions" - done + _ruby_add_rdepend "$(_ruby_atoms_samelib "${atoms}")" "$conditions" } # @FUNCTION: ruby_add_bdepend @@ -198,9 +209,7 @@ ruby_add_bdepend() { ;; esac - for atom in $atoms; do - _ruby_add_bdepend "${atom}$(ruby_samelib)" "$conditions" - done + _ruby_add_bdepend "$(_ruby_atoms_samelib "${atoms}")" "$conditions" } for _ruby_implementation in $USE_RUBY; do -- 2.26.2