summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gentoo.org>2010-08-30 22:08:24 +0000
committerDiego Elio Pettenò <flameeyes@gentoo.org>2010-08-30 22:08:24 +0000
commit195a72f6d50bc10155a273c499236889da7d1860 (patch)
tree6097351f0f779389b4e0340eee11d530e04eef64 /eclass/ruby-ng.eclass
parentAdd missing dependencies per configure and code inspection. Clean up old revi... (diff)
downloadhistorical-195a72f6d50bc10155a273c499236889da7d1860.tar.gz
historical-195a72f6d50bc10155a273c499236889da7d1860.tar.bz2
historical-195a72f6d50bc10155a273c499236889da7d1860.zip
Factor out the ree18→rubyee18 conversion and use it when generating the binwrapper (closes bug #335328).
Diffstat (limited to 'eclass/ruby-ng.eclass')
-rw-r--r--eclass/ruby-ng.eclass34
1 files changed, 22 insertions, 12 deletions
diff --git a/eclass/ruby-ng.eclass b/eclass/ruby-ng.eclass
index 01a87284fb61..459fb5ce48fc 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.26 2010/08/22 07:28:24 graaff Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-ng.eclass,v 1.27 2010/08/30 22:08:24 flameeyes Exp $
#
# @ECLASS: ruby-ng.eclass
# @MAINTAINER:
@@ -131,6 +131,25 @@ _ruby_atoms_samelib_generic() {
eshopts_pop
}
+# @FUNCTION: ruby_implementation_command
+# @RETURN: the path to the given ruby implementation
+# @DESCRIPTION:
+# Not all implementations have the same command basename as the
+# target; namely Ruby Enterprise 1.8 uses ree18 and rubyee18
+# respectively. This function translate between the two
+ruby_implementation_command() {
+ local _ruby_name=$1
+
+ # Add all USE_RUBY values where the flag name diverts from the binary here
+ case $1 in
+ ree18)
+ _ruby_name=rubyee18
+ ;;
+ esac
+
+ echo $(type -p ${_ruby_name} 2>/dev/null)
+}
+
_ruby_atoms_samelib() {
local atoms=$(_ruby_atoms_samelib_generic "$*")
@@ -263,20 +282,11 @@ _ruby_each_implementation() {
# only proceed if it's requested
use ruby_targets_${_ruby_implementation} || continue
- local _ruby_name=$_ruby_implementation
-
- # Add all USE_RUBY values where the flag name diverts from the binary here
- case $_ruby_implementation in
- ree18)
- _ruby_name=rubyee18
- ;;
- esac
-
- RUBY=$(type -p $_ruby_name 2>/dev/null)
+ RUBY=$(ruby_implementation_command ${_ruby_implementation})
invoked=yes
if [[ -n "$1" ]]; then
- _ruby_invoke_environment $_ruby_implementation "$@"
+ _ruby_invoke_environment ${_ruby_implementation} "$@"
fi
unset RUBY