Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 476694 (rdoc20) - dev-ruby/rdoc misses rdoc20 wrapper, result: app-admin/eselect-ruby-20120106 fails symlinking rdoc-2 (ruby20 profile)
Summary: dev-ruby/rdoc misses rdoc20 wrapper, result: app-admin/eselect-ruby-20120106 ...
Status: RESOLVED FIXED
Alias: rdoc20
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Ruby Team
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2013-07-13 08:48 UTC by cmuelle8
Modified: 2013-07-14 09:28 UTC (History)
0 users

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


Attachments
rdoc-4.0.1.ebuild.patch (rdoc-4.0.1.ebuild.patch,853 bytes, patch)
2013-07-13 09:35 UTC, cmuelle8
Details | Diff
result of patch (rdoc-4.0.1-r1.ebuild,2.76 KB, text/plain)
2013-07-13 09:35 UTC, cmuelle8
Details

Note You need to log in before you can comment on or make changes to this bug.
Description cmuelle8 2013-07-13 08:48:41 UTC
The binary installed by rdoc-4 package is

# cave contents rdoc::installed | grep bin/rdoc
/usr/lib64/ruby/gems/2.0.0/gems/rdoc-4.0.1/bin/rdoc
/usr/bin/rdoc-2



Symlinked result of running eselect ruby

# eselect ruby list
Available Ruby profiles:
  [1]   ruby20 (with Rubygems) *

# ls -l /usr/bin/rdoc
lrwxrwxrwx 1 root root 6 13. Jul 10:21 /usr/bin/rdoc -> rdoc20



The problem is here

# grep -A9 create_symlinks /usr/share/eselect/modules/ruby.eselect
create_symlinks() {
	local target=${1} version

	version=${target##*ruby}
	
	local path="${EROOT}${bindir}/"
	# these have to work
	for f in "ruby" "irb" "erb" "ri" "testrb" "rdoc" ; do
		ln -s "${f}${version}" "${path}${f}" || \
			die -q "Could not set ${f} symlink"



Note that die fails its intention here, so eselect ruby does NOT bail.  ln will return 0, that is success, as long as it can create the link.  It's not a failure if the target of the symlink does not exist at creation time.

"die" would only execute, if the previous symlink still existed, since ln -f option is not used.  this is prevented earlier by

  rm -f ${EROOT}${bindir}/{ruby,gem,irb,erb,ri,rdoc,testrb}



Suggested solution:

Either
- ruby.eselect needs to be patched
OR
- dev-ruby/rdoc should rename installed binary ("rdoc-2" -> "rdoc20")


Greetings

Reproducible: Always
Comment 1 cmuelle8 2013-07-13 09:35:01 UTC
Created attachment 353194 [details, diff]
rdoc-4.0.1.ebuild.patch

There actually is code in the rdoc ebuild - for ruby19 - that suggests a better solution.  So I chose for the second option to fix this, leaving eselect.ruby alone.

Thanks devs for fixing this in tree.
Comment 2 cmuelle8 2013-07-13 09:35:56 UTC
Created attachment 353196 [details]
result of patch
Comment 3 Hans de Graaff gentoo-dev Security 2013-07-14 09:28:04 UTC
(In reply to cmuelle8 from comment #1)
> Created attachment 353194 [details, diff] [details, diff]
> rdoc-4.0.1.ebuild.patch
> 
> There actually is code in the rdoc ebuild - for ruby19 - that suggests a
> better solution.  So I chose for the second option to fix this, leaving
> eselect.ruby alone.

Thanks for the analysis and patch. Fixed in rdoc-4.0.1-r1. 

I dropped the ruby20 depend because that would only be needed if we need a specific ruby20 patch level. I also renamed the short variable name to something more intuitively meaningful. Other than that: applied.