/[gentoo-x86]/eclass/ruby-ng.eclass
Gentoo

Diff of /eclass/ruby-ng.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.26 Revision 1.27
1# Copyright 1999-2009 Gentoo Foundation 1# Copyright 1999-2009 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-ng.eclass,v 1.26 2010/08/22 07:28:24 graaff Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-ng.eclass,v 1.27 2010/08/30 22:08:24 flameeyes Exp $
4# 4#
5# @ECLASS: ruby-ng.eclass 5# @ECLASS: ruby-ng.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Ruby herd <ruby@gentoo.org> 7# Ruby herd <ruby@gentoo.org>
8# 8#
129 done 129 done
130 echo ")" 130 echo ")"
131 eshopts_pop 131 eshopts_pop
132} 132}
133 133
134# @FUNCTION: ruby_implementation_command
135# @RETURN: the path to the given ruby implementation
136# @DESCRIPTION:
137# Not all implementations have the same command basename as the
138# target; namely Ruby Enterprise 1.8 uses ree18 and rubyee18
139# respectively. This function translate between the two
140ruby_implementation_command() {
141 local _ruby_name=$1
142
143 # Add all USE_RUBY values where the flag name diverts from the binary here
144 case $1 in
145 ree18)
146 _ruby_name=rubyee18
147 ;;
148 esac
149
150 echo $(type -p ${_ruby_name} 2>/dev/null)
151}
152
134_ruby_atoms_samelib() { 153_ruby_atoms_samelib() {
135 local atoms=$(_ruby_atoms_samelib_generic "$*") 154 local atoms=$(_ruby_atoms_samelib_generic "$*")
136 155
137 for _ruby_implementation in $USE_RUBY; do 156 for _ruby_implementation in $USE_RUBY; do
138 echo "${atoms//RUBYTARGET/ruby_targets_${_ruby_implementation}}" 157 echo "${atoms//RUBYTARGET/ruby_targets_${_ruby_implementation}}"
261 local invoked=no 280 local invoked=no
262 for _ruby_implementation in ${USE_RUBY}; do 281 for _ruby_implementation in ${USE_RUBY}; do
263 # only proceed if it's requested 282 # only proceed if it's requested
264 use ruby_targets_${_ruby_implementation} || continue 283 use ruby_targets_${_ruby_implementation} || continue
265 284
266 local _ruby_name=$_ruby_implementation 285 RUBY=$(ruby_implementation_command ${_ruby_implementation})
267
268 # Add all USE_RUBY values where the flag name diverts from the binary here
269 case $_ruby_implementation in
270 ree18)
271 _ruby_name=rubyee18
272 ;;
273 esac
274
275 RUBY=$(type -p $_ruby_name 2>/dev/null)
276 invoked=yes 286 invoked=yes
277 287
278 if [[ -n "$1" ]]; then 288 if [[ -n "$1" ]]; then
279 _ruby_invoke_environment $_ruby_implementation "$@" 289 _ruby_invoke_environment ${_ruby_implementation} "$@"
280 fi 290 fi
281 291
282 unset RUBY 292 unset RUBY
283 done 293 done
284 294

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.27

  ViewVC Help
Powered by ViewVC 1.1.20