Bug 206709 - Ports links to long descriptions have revision parameter duplicated, confusing svnweb
Summary: Ports links to long descriptions have revision parameter duplicated, confusin...
Status: Closed FIXED
Alias: None
Product: Documentation
Classification: Unclassified
Component: Website (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-doc (Nobody)
URL: http://www.freebsd.org/./ports/textpr...
Keywords: patch
: 215926 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-01-28 13:39 UTC by Dave Evans
Modified: 2017-01-10 15:56 UTC (History)
3 users (show)

See Also:


Attachments
diff to portindex script (791 bytes, patch)
2016-01-31 12:18 UTC, Mark Linimon
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Evans 2016-01-28 13:39:10 UTC
In the webpage for the ports textproc category, the link to the long description
for fop has the revision parameter repeated twice.  This is confusing svnweb,
which will come up with an error if you attempt to access the long description


FreeBSD Ports: Textproc
URL: http://www.freebsd.org/./ports/textproc.html#fop-2.0_1

Linkname: Long description
URL: https://svnweb.FreeBSD.org/ports/head/textproc/fop/pkg-descr?revision=HEAD?revision=HEAD

I'm giving fop as as example.  There are several (many?) other cases of this bug.
Comment 1 Andreas Perstinger 2016-01-28 16:36:57 UTC
This bug affects every port which is listed in more than one category.

Another example would be Zope 2.13. This port is listed in 3 categories: 

Python: https://www.freebsd.org/ports/python.html#zope213-2.13.23 (generated long description link: https://svnweb.freebsd.org/ports/head/www/zope213/pkg-descr?revision=HEAD )

WWW: https://www.freebsd.org/ports/www.html#zope213-2.13.23 (generated long description link: https://svnweb.freebsd.org/ports/head/www/zope213/pkg-descr?revision=HEAD?revision=HEAD )

Zope: https://www.freebsd.org/ports/zope.html#zope213-2.13.23 (generated long description link: https://svnweb.freebsd.org/ports/head/www/zope213/pkg-descr?revision=HEAD?revision=HEAD?revision=HEAD )

As you can see, in each category another copy of the string "?revision=HEAD" is appended to the link to the long description.

The bug is in https://svnweb.freebsd.org/doc/head/en_US.ISO8859-1/htdocs/ports/portindex?view=markup . On line 194, the loop goes through all the categories of a port (in alphabetical order) and creates the output string for the web page. On line 200 the string "?revision=HEAD" is appended to the $ldesc string. But $ldesc doesn't change inside the loop (except in the first iteration) thus more copies are appended in each iteration.

IMHO most of the body of the foreach loop should be outside it because most lines process the ports data in each iteration in the same way. Only line 195 and lines 241-258 should be inside the loop.
Comment 2 Dave Evans 2016-01-28 17:25:26 UTC
That might explain why textproc/py-reverend has revision=HEAD repeated 4 times.
Comment 3 Dave Evans 2016-01-28 17:32:09 UTC
Sorry, that should be py27-reverend in the textproc category
Comment 4 Mark Linimon freebsd_committer freebsd_triage 2016-01-31 12:18:21 UTC
Created attachment 166340 [details]
diff to portindex script
Comment 5 Dave Evans 2016-12-09 11:12:23 UTC
Has this bug been fixed?  It seems to be working for textproc/py27-reverend on the web site.

I can't see any mention in the svn log for portindex  though.
Comment 6 Andreas Perstinger 2016-12-09 12:49:04 UTC
(In reply to Dave Evans from comment #5)
No the bug is still not fixed.

How did you test the py27-reverend port?

If you use the port search form, then the generated result page doesn't use the portindex script and thus the bug doesn't show up.

The portindex script only creates the category listing pages. E.g. if you go to Categories Listed By Groups (https://www.freebsd.org/ports/categories-grouped.html) and there follow the link for the Textproc category, the link to the long description for py27-reverend still doesn't work.
Comment 7 Dave Evans 2016-12-09 14:32:11 UTC
> How did you test the py27-reverend port?

I used lynx on the port search form.

You are right. I should have used the port index, which is still broken.
Comment 8 Pietro Cerutti freebsd_committer freebsd_triage 2017-01-10 14:04:21 UTC
*** Bug 215926 has been marked as a duplicate of this bug. ***
Comment 9 Pietro Cerutti freebsd_committer freebsd_triage 2017-01-10 14:12:23 UTC
The attached patch works. Can someone from doc@ either approve or commit?
Comment 10 commit-hook freebsd_committer freebsd_triage 2017-01-10 15:53:12 UTC
A commit references this bug:

Author: gahr
Date: Tue Jan 10 15:52:40 UTC 2017
New revision: 49825
URL: https://svnweb.freebsd.org/changeset/doc/49825

Log:
  Fix double param in Long desc for ports in more than 1 category

  PR:		206709
  Submitted by:	linimon
  Reported by:	Dave Evans <dave.evans55@googlemail.com>
  Approved by:	brd

Changes:
  head/en_US.ISO8859-1/htdocs/ports/portindex