Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 336906 - Please review Prefix changes to ruby-fakegem.eclass
Summary: Please review Prefix changes to ruby-fakegem.eclass
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Gentoo Ruby Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 295866
  Show dependency tree
 
Reported: 2010-09-12 10:35 UTC by Fabian Groffen
Modified: 2010-09-23 06:47 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian Groffen gentoo-dev 2010-09-12 10:35:18 UTC
These changes are necessary to support offset installs properly, as done in Prefix.  The changes are quite minimal and straight forward, hence inline:

--- ruby-fakegem.eclass 2010-09-08 10:31:13.943292000 +0200
+++ ruby-fakegem.eclass 2010-09-12 12:29:37.524763000 +0200
@@ -92,7 +92,9 @@
 # This function returns the gems data directory for the ruby
 # implementation in question.
 ruby_fakegem_gemsdir() {
-       local _gemsitedir=$(${RUBY} -r rbconfig -e 'print Config::CONFIG["sitelibdir"]' | sed -e 's:site_ruby:gems:')
+       has "${EAPI}" 2 && ! use prefix && EPREFIX=
+
+       local _gemsitedir=$(${RUBY} -r rbconfig -e 'print Config::CONFIG["sitelibdir"]' | sed -e 's:site_ruby:gems:' -e "s:^${EPREFIX}::")
 
        [[ -z ${_gemsitedir} ]] && {
                eerror "Unable to find the gems dir"

Please comment on these changes and/or accept.  In that case, apply the changes or give us the OK to do so.
Comment 1 Alex Legler (RETIRED) archtester gentoo-dev Security 2010-09-12 11:40:23 UTC
It should use the ruby_rbconfig_value function from ruby-ng.eclass instead of the manual rbconfig query. Maybe this is a good time to change that.
Comment 2 Fabian Groffen gentoo-dev 2010-09-13 16:47:05 UTC
ok, how about this?

--- ruby-fakegem.eclass 2010-09-08 10:31:13.943292000 +0200
+++ ruby-fakegem.eclass 2010-09-13 18:46:19.098321000 +0200
@@ -92,7 +92,11 @@
 # This function returns the gems data directory for the ruby
 # implementation in question.
 ruby_fakegem_gemsdir() {
-       local _gemsitedir=$(${RUBY} -r rbconfig -e 'print Config::CONFIG["sitelibdir"]' | sed -e 's:site_ruby:gems:')
+       has "${EAPI}" 2 && ! use prefix && EPREFIX=
+
+       local _gemsitedir=$(ruby_rbconfig_value 'sitelibdir')
+       _gemsitedir=${_gemsitedir//site_ruby/gems}
+       _gemsitedir=${_gemsitedir#${EPREFIX}}
 
        [[ -z ${_gemsitedir} ]] && {
                eerror "Unable to find the gems dir"
Comment 3 Fabian Groffen gentoo-dev 2010-09-21 19:40:14 UTC
Is this change ok?  I'll assume so this friday and commit the change if you don't object.  Thanks.
Comment 4 Alex Legler (RETIRED) archtester gentoo-dev Security 2010-09-23 06:30:28 UTC
(In reply to comment #3)
> Is this change ok?  I'll assume so this friday and commit the change if you
> don't object.  Thanks.
> 

ugh, forgot about this bug. Please go ahead.
Comment 5 Fabian Groffen gentoo-dev 2010-09-23 06:47:45 UTC
thanks, committed