summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Graaff <graaff@gentoo.org>2007-08-25 18:49:44 +0000
committerHans de Graaff <graaff@gentoo.org>2007-08-25 18:49:44 +0000
commitbee3446a841b86d061d2fa3454b33e46bd7f6633 (patch)
treecc278ce8f2952f0df01ae0c4c0e581d5c87aea36 /eclass/ruby.eclass
parentNew package requested via bug #178733 (diff)
downloadhistorical-bee3446a841b86d061d2fa3454b33e46bd7f6633.tar.gz
historical-bee3446a841b86d061d2fa3454b33e46bd7f6633.tar.bz2
historical-bee3446a841b86d061d2fa3454b33e46bd7f6633.zip
USE_RUBY does not work for gems but does generate a (harmless) error, so ignore this code in prepall when installing a gem
Diffstat (limited to 'eclass/ruby.eclass')
-rw-r--r--eclass/ruby.eclass86
1 files changed, 46 insertions, 40 deletions
diff --git a/eclass/ruby.eclass b/eclass/ruby.eclass
index 7e630c33d8e7..b6a950cc8e8d 100644
--- a/eclass/ruby.eclass
+++ b/eclass/ruby.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby.eclass,v 1.67 2007/08/25 06:06:20 pclouds Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby.eclass,v 1.68 2007/08/25 18:49:44 graaff Exp $
#
# Author: Mamoru KOMACHI <usata@gentoo.org>
#
@@ -214,48 +214,54 @@ erubyinstall() {
ruby_einstall "$@"
}
-# prepall adds SLOT support for ruby.eclass
+# prepall adds SLOT support for ruby.eclass. SLOT support currently
+# does not work for gems, so if a gem is installed we skip all the
+# SLOT code to avoid possible errors, in particular the mv command
+# that is part of the USE_RUBY="any" case.
prepall() {
- [[ ! -x /usr/bin/ruby16 ]] && export USE_RUBY=${USE_RUBY/ruby16/}
- [[ ! -x /usr/bin/ruby18 ]] && export USE_RUBY=${USE_RUBY/ruby18/}
- [[ ! -x /usr/bin/ruby19 ]] && export USE_RUBY=${USE_RUBY/ruby19/}
-
- local ruby_slots=$(echo "${USE_RUBY}" | wc -w)
-
- if [ "$ruby_slots" -ge 2 ] || (use ppc-macos && [ "$ruby_slots" -ge 1 ])
- then
- einfo "Now we are building the package for ${USE_RUBY}"
- for rb in ${USE_RUBY} ruby ; do
- einfo "Using $rb"
- export RUBY=/usr/bin/$rb
- ruby() { /usr/bin/$rb "$@" ; }
- mkdir -p ${S}
- cd ${WORKDIR}
- einfo "Unpacking for $rb"
- src_unpack || die "src_unpack failed"
- cd ${S}
- find . -name '*.[ao]' -exec rm {} \;
- einfo "Building for $rb"
- src_compile || die "src_compile failed"
- cd ${S}
- einfo "Installing for $rb"
- src_install || die "src_install failed"
- done
- elif [ "${USE_RUBY}" == "any" ] ; then
- siteruby=$(${RUBY} -r rbconfig -e 'print Config::CONFIG["sitelibdir"]')
- # in case no directories found in siteruby
- local shopts=$-
- set -o noglob # so that bash doen't expand "*"
-
- for x in ${D}/${siteruby}/* ; do
- mv $x ${D}/${siteruby}/..
- done
- if [ -d ${D}${siteruby} ] ; then
- rmdir --ignore-fail-on-non-empty ${D}/${siteruby}
+ if [ -z "${GEM_SRC}" ]; then
+
+ [[ ! -x /usr/bin/ruby16 ]] && export USE_RUBY=${USE_RUBY/ruby16/}
+ [[ ! -x /usr/bin/ruby18 ]] && export USE_RUBY=${USE_RUBY/ruby18/}
+ [[ ! -x /usr/bin/ruby19 ]] && export USE_RUBY=${USE_RUBY/ruby19/}
+
+ local ruby_slots=$(echo "${USE_RUBY}" | wc -w)
+
+ if [ "$ruby_slots" -ge 2 ] || (use ppc-macos && [ "$ruby_slots" -ge 1 ])
+ then
+ einfo "Now we are building the package for ${USE_RUBY}"
+ for rb in ${USE_RUBY} ruby ; do
+ einfo "Using $rb"
+ export RUBY=/usr/bin/$rb
+ ruby() { /usr/bin/$rb "$@" ; }
+ mkdir -p ${S}
+ cd ${WORKDIR}
+ einfo "Unpacking for $rb"
+ src_unpack || die "src_unpack failed"
+ cd ${S}
+ find . -name '*.[ao]' -exec rm {} \;
+ einfo "Building for $rb"
+ src_compile || die "src_compile failed"
+ cd ${S}
+ einfo "Installing for $rb"
+ src_install || die "src_install failed"
+ done
+ elif [ "${USE_RUBY}" == "any" ] ; then
+ siteruby=$(${RUBY} -r rbconfig -e 'print Config::CONFIG["sitelibdir"]')
+ # in case no directories found in siteruby
+ local shopts=$-
+ set -o noglob # so that bash doen't expand "*"
+
+ for x in ${D}/${siteruby}/* ; do
+ mv $x ${D}/${siteruby}/..
+ done
+ if [ -d ${D}${siteruby} ] ; then
+ rmdir --ignore-fail-on-non-empty ${D}/${siteruby}
+ fi
+
+ set +o noglob; set -$shopts # reset old shell opts
fi
-
- set +o noglob; set -$shopts # reset old shell opts
fi
# Continue with the regular prepall, see bug 140697