Gentoo Archives: gentoo-commits

From: "Diego Petteno (flameeyes)" <flameeyes@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in eclass: ruby-fakegem.eclass ruby-ng.eclass
Date: Mon, 30 Aug 2010 22:08:29
Message-Id: 20100830220824.AF66220051@flycatcher.gentoo.org
1 flameeyes 10/08/30 22:08:24
2
3 Modified: ruby-fakegem.eclass ruby-ng.eclass
4 Log:
5 Factor out the ree18→rubyee18 conversion and use it when generating the binwrapper (closes bug #335328).
6
7 Revision Changes Path
8 1.23 eclass/ruby-fakegem.eclass
9
10 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.23&view=markup
11 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.23&content-type=text/plain
12 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?r1=1.22&r2=1.23
13
14 Index: ruby-fakegem.eclass
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v
17 retrieving revision 1.22
18 retrieving revision 1.23
19 diff -u -r1.22 -r1.23
20 --- ruby-fakegem.eclass 29 Jul 2010 09:38:09 -0000 1.22
21 +++ ruby-fakegem.eclass 30 Aug 2010 22:08:24 -0000 1.23
22 @@ -1,6 +1,6 @@
23 # Copyright 1999-2009 Gentoo Foundation
24 # Distributed under the terms of the GNU General Public License v2
25 -# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.22 2010/07/29 09:38:09 flameeyes Exp $
26 +# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.23 2010/08/30 22:08:24 flameeyes Exp $
27 #
28 # @ECLASS: ruby-fakegem.eclass
29 # @MAINTAINER:
30 @@ -152,7 +152,7 @@
31 # so better taking this into consideration.
32 local quoted_description=${DESCRIPTION//\"/\\\"}
33 cat - > "${T}"/${RUBY_FAKEGEM_NAME}-${_ruby_implementation} <<EOF
34 -# generated by ruby-fakegem.eclass $Revision: 1.22 $
35 +# generated by ruby-fakegem.eclass $Revision: 1.23 $
36 Gem::Specification.new do |s|
37 s.name = "${RUBY_FAKEGEM_NAME}"
38 s.version = "${RUBY_FAKEGEM_VERSION}"
39 @@ -192,7 +192,7 @@
40 use ruby_targets_${implementation} || continue
41 if [ -z $rubycmd ]; then
42 # if no other implementation was set before, set it.
43 - rubycmd="/usr/bin/${implementation}"
44 + rubycmd="$(ruby_implementation_command ${implementation})"
45 else
46 # if another implementation already arrived, then make
47 # it generic and break out of the loop. This ensures
48 @@ -206,7 +206,7 @@
49 #!${rubycmd}
50 # This is a simplified version of the RubyGems wrapper
51 #
52 -# Generated by ruby-fakegem.eclass $Revision: 1.22 $
53 +# Generated by ruby-fakegem.eclass $Revision: 1.23 $
54
55 require 'rubygems'
56
57
58
59
60 1.27 eclass/ruby-ng.eclass
61
62 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-ng.eclass?rev=1.27&view=markup
63 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-ng.eclass?rev=1.27&content-type=text/plain
64 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-ng.eclass?r1=1.26&r2=1.27
65
66 Index: ruby-ng.eclass
67 ===================================================================
68 RCS file: /var/cvsroot/gentoo-x86/eclass/ruby-ng.eclass,v
69 retrieving revision 1.26
70 retrieving revision 1.27
71 diff -u -r1.26 -r1.27
72 --- ruby-ng.eclass 22 Aug 2010 07:28:24 -0000 1.26
73 +++ ruby-ng.eclass 30 Aug 2010 22:08:24 -0000 1.27
74 @@ -1,6 +1,6 @@
75 # Copyright 1999-2009 Gentoo Foundation
76 # Distributed under the terms of the GNU General Public License v2
77 -# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-ng.eclass,v 1.26 2010/08/22 07:28:24 graaff Exp $
78 +# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-ng.eclass,v 1.27 2010/08/30 22:08:24 flameeyes Exp $
79 #
80 # @ECLASS: ruby-ng.eclass
81 # @MAINTAINER:
82 @@ -131,6 +131,25 @@
83 eshopts_pop
84 }
85
86 +# @FUNCTION: ruby_implementation_command
87 +# @RETURN: the path to the given ruby implementation
88 +# @DESCRIPTION:
89 +# Not all implementations have the same command basename as the
90 +# target; namely Ruby Enterprise 1.8 uses ree18 and rubyee18
91 +# respectively. This function translate between the two
92 +ruby_implementation_command() {
93 + local _ruby_name=$1
94 +
95 + # Add all USE_RUBY values where the flag name diverts from the binary here
96 + case $1 in
97 + ree18)
98 + _ruby_name=rubyee18
99 + ;;
100 + esac
101 +
102 + echo $(type -p ${_ruby_name} 2>/dev/null)
103 +}
104 +
105 _ruby_atoms_samelib() {
106 local atoms=$(_ruby_atoms_samelib_generic "$*")
107
108 @@ -263,20 +282,11 @@
109 # only proceed if it's requested
110 use ruby_targets_${_ruby_implementation} || continue
111
112 - local _ruby_name=$_ruby_implementation
113 -
114 - # Add all USE_RUBY values where the flag name diverts from the binary here
115 - case $_ruby_implementation in
116 - ree18)
117 - _ruby_name=rubyee18
118 - ;;
119 - esac
120 -
121 - RUBY=$(type -p $_ruby_name 2>/dev/null)
122 + RUBY=$(ruby_implementation_command ${_ruby_implementation})
123 invoked=yes
124
125 if [[ -n "$1" ]]; then
126 - _ruby_invoke_environment $_ruby_implementation "$@"
127 + _ruby_invoke_environment ${_ruby_implementation} "$@"
128 fi
129
130 unset RUBY