Bug 442727

Summary: broken URL links in search/index.tex
Product: [Fedora] Fedora Reporter: George N. White III <whiteg>
Component: RAssignee: Tom "spot" Callaway <tcallawa>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 8CC: jonathanbaron7
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 2.7.0-2.fc9.1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-05-21 10:54:28 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description George N. White III 2008-04-16 13:58:51 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.13) Gecko/20080325 Fedora/2.0.0.13-1.fc8 Firefox/2.0.0.13 pango-text

Description of problem:
the search function returns a page with broken links, take directly from
/usr/share/doc/R-2.6.2/html/search/index.txt.  This file is generated by
/usr/lib/rpm/R-make-search-index.sh, which simply cats the package
CONTENTS files.  



Version-Release number of selected component (if applicable):
R-2.6.2-1.fc8.1

How reproducible:
Always


Steps to Reproduce:

1. firefox /usr/share/doc/R-2.6.2/html/index.html

2. click on "Search Engine & Keywords"
   [The search engine is reported to fail using icedtea.  I'm 
    using Sun's jre 1.6.]

3. enter a search term, e.g., axis



Actual Results:
note the broken URL for the "axis" entry on the resulting page:

    file:///usr/share/doc/library/graphics/html/axis.html
 
 


Expected Results:
The correct location is: 
   file:///usr/lib/R/library/graphics/html/axis.html


Additional info:
One way to fix this would be to put the documentation in a "doc" 
subdirectory:

/usr/share/doc/R-2.6.2/doc/html

and create a symbolic link 
/usr/share/doc/R-2.6.2/library --> /usr/lib/R/library

Another approach would be to have the script that generates
index.txt edt the URL lines.

Comment 1 Fedora Update System 2008-05-15 16:04:19 UTC
rpy-0.4.6-25.fc7,R-2.7.0-2.fc7.1 has been submitted as an update for Fedora 7

Comment 2 Fedora Update System 2008-05-15 16:07:41 UTC
rpy-1.0.1-4.fc8,R-2.7.0-2.fc8.1 has been submitted as an update for Fedora 8

Comment 3 Fedora Update System 2008-05-15 16:10:44 UTC
rpy-1.0.1-6.fc9,R-2.7.0-2.fc9.1 has been submitted as an update for Fedora 9

Comment 4 Fedora Update System 2008-05-17 22:18:59 UTC
R-2.7.0-2.fc9.1, rpy-1.0.1-6.fc9 has been pushed to the Fedora 9 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update R rpy'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F9/FEDORA-2008-4012

Comment 5 Fedora Update System 2008-05-21 10:54:22 UTC
R-2.7.0-2.fc9.1, rpy-1.0.1-6.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 6 Fedora Update System 2008-05-21 10:56:44 UTC
rpy-1.0.1-4.fc8, R-2.7.0-2.fc8.1 has been pushed to the Fedora 8 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2008-05-21 11:02:56 UTC
R-2.7.0-2.fc7.1, rpy-0.4.6-25.fc7 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 8 George N. White III 2008-05-21 14:54:29 UTC
There is still a problem with the R documentation in R-2.7.0-2.fc8.

I see no change in the broken directory structure from the previous 
version.  The bad links can be seen without using the search engine.

$ firefox /usr/share/doc/R-2.7.0/html/index.html

Select Packages and the the first link, you get:

Firefox can't find the file 
at /usr/share/doc/library/KernSmooth/html/00Index.html.

A workaround is to create a doc directory and 3 symbolic links:

# cd /usr/share/doc/R-2.7.0/
# mkdir doc
# ln -s /usr/lib/R/library .
# ln -s html doc/
# ln -s manual doc/

Alternatively, '/usr/lib/rpm/R-make-search-index.sh' should also rewrite
the 'html/packages.html' file. 




Comment 9 Tom "spot" Callaway 2008-05-21 15:30:57 UTC
I didn't fix the directory structure, because that is how upstream R wants to do
things going forward. Instead, I fixed the search indexes. Good catch on the
packages.html file having broken links, but that is easy to fix inside the spec
with a sed invocation. Please test R-2.7.0-3, as that should resolve all the
issues I can see.

Comment 10 Fedora Update System 2008-05-21 17:53:36 UTC
R-2.7.0-3.fc7 has been submitted as an update for Fedora 7

Comment 11 Fedora Update System 2008-05-21 17:56:12 UTC
R-2.7.0-3.fc8 has been submitted as an update for Fedora 8

Comment 12 Fedora Update System 2008-05-21 17:56:56 UTC
R-2.7.0-3.fc9 has been submitted as an update for Fedora 9

Comment 13 Tom "spot" Callaway 2008-05-21 18:11:29 UTC
Well, if it was possible, I made it worse in -3. Ignore that one, I'm working on -4.

Comment 14 Fedora Update System 2008-05-22 20:37:44 UTC
R-2.7.0-4.fc7 has been submitted as an update for Fedora 7

Comment 15 Fedora Update System 2008-05-22 20:38:16 UTC
R-2.7.0-4.fc8 has been submitted as an update for Fedora 8

Comment 16 Fedora Update System 2008-05-22 20:38:51 UTC
R-2.7.0-4.fc9 has been submitted as an update for Fedora 9

Comment 17 Fedora Update System 2008-05-29 02:34:21 UTC
R-2.7.0-4.fc8 has been pushed to the Fedora 8 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 18 Fedora Update System 2008-05-29 02:35:02 UTC
R-2.7.0-4.fc7 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 19 Fedora Update System 2008-05-29 02:50:32 UTC
R-2.7.0-4.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 20 Jonathan Baron 2008-05-30 08:42:21 UTC
With R-2.7.0-4.fc9, the links in /usr/share/doc/R-2.7.0/html/packages.html are
written as (for example) "../../library/acepack/html/00Index.html", which seems
to me to be the same problem described in this bug.  One solution, aside from
comment #8, is to change them to /usr/lib/R/library/acepack/html/00Index.html.

In earlier versions of R, the packages.html file was actually in
/usr/lib/R/doc/, which was better because it did not require the version number
for linking.  But I asked about this on the R-devel mailing list, and,
apparently, the changed location of the packages.html file has some reason. 
(Brian Ripley said that it required rebuilding too much.  But in the current rpm
the packages.html file is rebuilt with every update, which is, I think, exactly
what should happen, and exactly what used to happen.  Thus, I do not understand
why the packages.html file is where it is now.  It is possible that the Fedora
rpm works differently than what happens if you build from source, which is why I
am reporting here rather than R-devel.)

See https://stat.ethz.ch/pipermail/r-devel/2008-May/049732.html.


Comment 21 George N. White III 2008-05-30 22:12:45 UTC
I can confirm this with R-2.7.0-4.fc8.  The problem is that the various files are
updated when an package is installed using R install.packages(), but the script
in /usr/lib/rpm needs to be run again or install.packages() needs to provide
absolute paths when it writes the files.


Comment 22 Jonathan Baron 2008-05-31 12:10:23 UTC
In R-2.7.0-5.fc9.x86_64, which was said to fix the problem, a problem is still
present.  The packages.html file is in /usr/share/doc/R-2.7.0/html/ and the
links to packages go to ../../library/, which resolves to
/usr/share/doc/library, which is wrong.  It should be /usr/lib64/R/, or
../../../../lib64/R/library.

But this is a little crazy because it must depend on whether you have lib or
lib64.  Thus, an even simpler solution would be go to back to the old behavior
of putting the doc directory in /usr/lib64/R or /usr/lib/R, where it used to be.
 Perhaps this violates Fedora policy.

What is clear, though, is that the argument in
https://stat.ethz.ch/pipermail/r-devel/2008-May/049732.html, is not relevant to
this issue.  The packages.html file is getting rebuilt every time you update
anything, which is, I think, exactly what should happen.

In the meantime I'm putting a soft link to /usr/lib64/R/library in /usr/share/doc/.


Comment 23 Jonathan Baron 2008-06-01 10:56:14 UTC
I realized that the problem has been fixed for the initial packages.html file
that is built when R is installed.  However, the problem in comment 22 is still
present after updating or installing packages.

According to Brian Ripley
(in https://stat.ethz.ch/pipermail/r-devel/2008-May/049732.html):
"The function used to update doc/html/packages.html is 
utils:::link.html.help(), which is a wrapper for 
tools:::unix.packages.html."

It may be that this is not worth fixing.  I may be the only one who uses
packages.html extensively (at http://finzi.psych.upenn.edu, where it lists all
the packages and provides direct links to their html pages, a function that to
my knowledge exists nowhere else).  And it is working for me now because of the
soft link that I created.