diff options
author | Diego Elio Pettenò <flameeyes@gentoo.org> | 2009-12-16 09:51:30 +0000 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@gentoo.org> | 2009-12-16 09:51:30 +0000 |
commit | 4e4a4e680ffdc837466e04631990deb7c23ef488 (patch) | |
tree | b5d394c7cfb33d7fdf92776d5ff9f18f0d2c7a50 /eclass/ruby-fakegem.eclass | |
parent | updated live ebuild's makefile patch (diff) | |
download | historical-4e4a4e680ffdc837466e04631990deb7c23ef488.tar.gz historical-4e4a4e680ffdc837466e04631990deb7c23ef488.tar.bz2 historical-4e4a4e680ffdc837466e04631990deb7c23ef488.zip |
Change the binary wrapper code.
Instead of using the Gem code to find the gem itself (which only
worked for gems whose library was named after the gem, and failed for
spec and other packages), ask Gem for its system path (which will be
dynamic depending on the Ruby implementation used) and affix the
hardcoded relative path of the wrapper (which we know at merge time).
Tested with rake, bluecloth, rspec, Ruby 1.8, 1.9 and JRuby.
Diffstat (limited to 'eclass/ruby-fakegem.eclass')
-rw-r--r-- | eclass/ruby-fakegem.eclass | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/eclass/ruby-fakegem.eclass b/eclass/ruby-fakegem.eclass index 59f3ac850e77..4388901c3848 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.4 2009/12/15 17:43:51 flameeyes Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.5 2009/12/16 09:51:30 flameeyes Exp $ # # @ECLASS: ruby-fakegem.eclass # @MAINTAINER: @@ -151,6 +151,7 @@ ruby_fakegem_binwrapper() { ( local gembinary=$1 local newbinary=${2:-/usr/bin/$gembinary} + local relativegembinary=${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}/bin/${gembinary} cat - > "${T}"/gembin-wrapper-${gembinary} <<EOF #!/usr/bin/env ruby @@ -160,7 +161,7 @@ ruby_fakegem_binwrapper() { require 'rubygems' -load Gem::GemPathSearcher.new.find('$(tr [A-Z] [a-z] <<< ${RUBY_FAKEGEM_NAME})').full_gem_path + "/bin/${gembinary}" +load Gem::default_path[-1] + "/gems/${relativegembinary}" EOF |