Gentoo Archives: gentoo-commits

From: "Alex Legler (a3li)" <a3li@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in eclass: ruby-ng.eclass
Date: Mon, 26 Apr 2010 15:08:01
Message-Id: 20100426150758.78E7B2C04C@corvid.gentoo.org
1 a3li 10/04/26 15:07:58
2
3 Modified: ruby-ng.eclass
4 Log:
5 Adding a ruby_rbconfig_value function to ruby-ng.eclass for easy access even to not regularly needed rbconfig data
6
7 Revision Changes Path
8 1.11 eclass/ruby-ng.eclass
9
10 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-ng.eclass?rev=1.11&view=markup
11 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-ng.eclass?rev=1.11&content-type=text/plain
12 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-ng.eclass?r1=1.10&r2=1.11
13
14 Index: ruby-ng.eclass
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo-x86/eclass/ruby-ng.eclass,v
17 retrieving revision 1.10
18 retrieving revision 1.11
19 diff -u -r1.10 -r1.11
20 --- ruby-ng.eclass 5 Apr 2010 07:41:09 -0000 1.10
21 +++ ruby-ng.eclass 26 Apr 2010 15:07:58 -0000 1.11
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-ng.eclass,v 1.10 2010/04/05 07:41:09 a3li Exp $
26 +# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-ng.eclass,v 1.11 2010/04/26 15:07:58 a3li Exp $
27 #
28 # @ECLASS: ruby-ng.eclass
29 # @MAINTAINER:
30 @@ -418,6 +418,13 @@
31 _ruby_each_implementation _each_ruby_check_install
32 }
33
34 +# @FUNCTION: ruby_rbconfig_value
35 +# @USAGE: rbconfig item
36 +# @RETURN: Returns the value of the given rbconfig item of the Ruby interpreter in ${RUBY}.
37 +ruby_rbconfig_value() {
38 + echo $(${RUBY} -rrbconfig -e "puts Config::CONFIG['$1']")
39 +}
40 +
41 # @FUNCTION: doruby
42 # @USAGE: file [file...]
43 # @DESCRIPTION:
44 @@ -425,7 +432,7 @@
45 doruby() {
46 [[ -z ${RUBY} ]] && die "\$RUBY is not set"
47 ( # don't want to pollute calling env
48 - insinto $(${RUBY} -rrbconfig -e 'print Config::CONFIG["sitelibdir"]')
49 + insinto $(ruby_rbconfig_value 'sitelibdir')
50 insopts -m 0644
51 doins "$@"
52 ) || die "failed to install $@"
53 @@ -440,10 +447,10 @@
54 # @FUNCTION: ruby_get_hdrdir
55 # @RETURN: The location of the header files belonging to the Ruby interpreter in ${RUBY}.
56 ruby_get_hdrdir() {
57 - local rubyhdrdir=$(${RUBY} -rrbconfig -e 'puts Config::CONFIG["rubyhdrdir"]')
58 + local rubyhdrdir=$(ruby_rbconfig_value 'rubyhdrdir')
59
60 if [[ "${rubyhdrdir}" = "nil" ]] ; then
61 - rubyhdrdir=$(${RUBY} -rrbconfig -e 'puts Config::CONFIG["archdir"]')
62 + rubyhdrdir=$(ruby_rbconfig_value 'archdir')
63 fi
64
65 echo "${rubyhdrdir}"