summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gentoo.org>2010-05-22 12:31:03 +0000
committerDiego Elio Pettenò <flameeyes@gentoo.org>2010-05-22 12:31:03 +0000
commitde5d08fa886abb6c3e44cf7bf14fe9a7ffe11a0a (patch)
tree4a784db7ddbaeacf9030ad4aec0f7e063af376c0
parentAllow for standard depend syntax in the single parameter form of ruby_add_rde... (diff)
downloadgentoo-2-de5d08fa886abb6c3e44cf7bf14fe9a7ffe11a0a.tar.gz
gentoo-2-de5d08fa886abb6c3e44cf7bf14fe9a7ffe11a0a.tar.bz2
gentoo-2-de5d08fa886abb6c3e44cf7bf14fe9a7ffe11a0a.zip
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 )"
-rw-r--r--eclass/ruby-ng.eclass24
1 files 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() {