summaryrefslogtreecommitdiff
path: root/eclass
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
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')
-rw-r--r--eclass/ruby-fakegem.eclass8
-rw-r--r--eclass/ruby-ng.eclass34
2 files changed, 26 insertions, 16 deletions
diff --git a/eclass/ruby-fakegem.eclass b/eclass/ruby-fakegem.eclass
index e6cfa8b3956f..72e64f4a7eb4 100644
--- a/eclass/ruby-fakegem.eclass
+++ b/eclass/ruby-fakegem.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-fakegem.eclass,v 1.22 2010/07/29 09:38:09 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.23 2010/08/30 22:08:24 flameeyes Exp $
#
# @ECLASS: ruby-fakegem.eclass
# @MAINTAINER:
@@ -152,7 +152,7 @@ ruby_fakegem_genspec() {
# so better taking this into consideration.
local quoted_description=${DESCRIPTION//\"/\\\"}
cat - > "${T}"/${RUBY_FAKEGEM_NAME}-${_ruby_implementation} <<EOF
-# generated by ruby-fakegem.eclass $Revision: 1.22 $
+# generated by ruby-fakegem.eclass $Revision: 1.23 $
Gem::Specification.new do |s|
s.name = "${RUBY_FAKEGEM_NAME}"
s.version = "${RUBY_FAKEGEM_VERSION}"
@@ -192,7 +192,7 @@ ruby_fakegem_binwrapper() {
use ruby_targets_${implementation} || continue
if [ -z $rubycmd ]; then
# if no other implementation was set before, set it.
- rubycmd="/usr/bin/${implementation}"
+ rubycmd="$(ruby_implementation_command ${implementation})"
else
# if another implementation already arrived, then make
# it generic and break out of the loop. This ensures
@@ -206,7 +206,7 @@ ruby_fakegem_binwrapper() {
#!${rubycmd}
# This is a simplified version of the RubyGems wrapper
#
-# Generated by ruby-fakegem.eclass $Revision: 1.22 $
+# Generated by ruby-fakegem.eclass $Revision: 1.23 $
require 'rubygems'
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