Bug 209220

Summary: "Long description" link of many ports returns error
Product: Documentation Reporter: graham
Component: WebsiteAssignee: Chris Rees <crees>
Status: Closed FIXED    
Severity: Affects Only Me CC: allanjude, andipersti, bjk, crees, joeb1, linimon, portmgr, sd
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
URL: https://svnweb.freebsd.org/doc/head/en_US.ISO8859-1/htdocs/ports/portindex
Attachments:
Description Flags
Fix the long description link for ports without their own pkg-descr file none

Description graham 2016-05-03 02:49:20 UTC
In the Ports section of the FreeBSD website, clicking on many (but not all) ports' "Long description" link returns an error:

An Exception Has Occurred
Unknown location: /head/net/wireshark-qt5/pkg-descr
HTTP Response Status
404 Not Found

This is from http://svnweb.freebsd.org/ports/head/net/wireshark-qt5/pkg-descr?revision=HEAD

This may be related to https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206709 but it's not quite the same as, here, the revision is not repeated in the URL.
Comment 1 Shawn Debnath 2016-05-04 00:05:49 UTC
There are no files other than the Makefile for this port. I.e., pkg-descr is missing under ports/wireshark-qt5. Looks like a port issue.
Comment 2 graham 2016-05-04 23:16:44 UTC
I don't know if it's a ports issue or a website issue, but there are lots of ports that don't have a pkg-descr. They will all have this problem. Below are the first 20 or so I found. So, either all ports should have this file, or the web site shouldn't show the link for those that don't.


math/fpc-fftw
math/fpc-gmp
math/php70-bcmath
math/php70-gmp
math/fpc-numlib
math/arpack-ng-mpich
math/xlapack
math/php56-bcmath
math/php56-gmp
math/ploticus-nox11
math/spooles-mpich
math/mumps-mpich
math/fftw-float
math/fftw3-float
math/fftw3-long
math/fftw3-quad
math/php55-bcmath
math/php55-gmp
textproc/php55-pspell
textproc/php55-wddx
textproc/php55-xmlreader
textproc/php55-xsl
textproc/php56-pspell
textproc/php56-wddx
textproc/php56-xmlreader
textproc/php56-xsl
textproc/qt4-xmlpatterns
textproc/qt5-xmlpatterns
Comment 3 Benjamin Kaduk freebsd_committer freebsd_triage 2016-05-05 00:07:39 UTC
Adding portmgr to cc to opine on official ports policy.
Comment 4 Mathieu Arnold freebsd_committer freebsd_triage 2016-05-05 06:25:19 UTC
All ports have a pkg-descr file, but it's not always in the port's directory:

mat@aragorn.in:/home/mat/work/freebsd/ports/net/wireshark-qt5 $ make -V DESCR
/home/mat/work/freebsd/ports/net/wireshark-qt5/../wireshark/pkg-descr

Whatever's generating that link gets is wrong.
Comment 5 Mark Linimon freebsd_committer freebsd_triage 2016-10-01 13:03:46 UTC
The script that generates the link is portindex (see URL), which I submitted a patch for in 206709.

The pkg-descr field is derived from INDEX.

Looking at the current links on the website, I no longer see this problem.  Can the submitter confirm this?
Comment 6 joeb1 2016-10-01 14:44:42 UTC
I found same problem in under 1 minute just clicking on any "long description".

Your fix is not working in all cases.

https://svnweb.freebsd.org/ports/head/textproc/go.text/pkg-descr?revision=HEAD?revision=HEAD

https://svnweb.freebsd.org/ports/head/math/php70-gmp/pkg-descr?revision=HEAD

Maybe the current version of what the website is reading needs to be rebuilt to remove all the bad url's pointing to the port's long description text file.
Comment 7 Benjamin Kaduk freebsd_committer freebsd_triage 2016-10-02 00:22:18 UTC
IIRC, we get a full rebuild every 6 hours, and an incremental rebuild ever 10 minutes.
Comment 8 graham 2016-10-02 04:52:43 UTC
(In reply to joeb1 from comment #6)

The first of the two URLs that joeb1 lists has two "?revision=HEAD" bits. Remove the second one and it works correctly. The second one works for me.

So, yes, this appears to be fixed. Thanks!
Comment 9 graham 2016-10-02 04:53:40 UTC
(In reply to Mark Linimon from comment #5)

Looks good! Thanks, Mark.
Comment 10 graham 2016-10-02 04:57:26 UTC
(In reply to graham from comment #9)

Oops, looks like I spoke too soon. I just tried a few of the ones I listed above.

https://svnweb.freebsd.org/ports/head/math/fftw3-quad/pkg-descr?revision=HEAD

(i.e. math/fftw3-quad from my list) still returns an error.
Comment 11 Allan Jude freebsd_committer freebsd_triage 2016-10-02 05:01:34 UTC
(In reply to graham from comment #10)
That port actually lacks a pkg-descr file.

The error is correct. I am not sure what percentage of ports lack a pkg-descr file
Comment 12 Andreas Perstinger 2016-10-06 11:21:56 UTC
Created attachment 175460 [details]
Fix the long description link for ports without their own pkg-descr file

This bug is not related to bug#206709 because portindex only creates the html pages for the categories listings (reachable from the left sidebar). E.g. if you go to the listing for all math ports (https://www.freebsd.org/ports/math.html) and then scroll down to the fftw3-quad port, the link for the long description works (linking to the description for the "master" port fftw3).

But if you use the search box you get to another page (https://www.freebsd.org/cgi/ports.cgi?query=fftw3-quad&stype=all) where the link is broken. The search results are created by /cgi/ports.cgi (https://svnweb.freebsd.org/doc/head/en_US.ISO8859-1/htdocs/cgi/ports.cgi?view=markup). On lines 311-314 the value from the INDEX file is correctly read into $descfile but on line 344 $l (which is based on the port's path in the ports tree) is used for creating the link.

In my attached patch I've also renamed a variable name ($remotePrefixCVS -> $remotePrefixRepo) and updated the associated comment. :-)
Comment 13 commit-hook freebsd_committer freebsd_triage 2018-12-23 21:42:09 UTC
A commit references this bug:

Author: crees
Date: Sun Dec 23 21:41:27 UTC 2018
New revision: 52715
URL: https://svnweb.freebsd.org/changeset/doc/52715

Log:
  Fix long descriptions (pkg-descr) links for slave ports

  While here, use https for svnweb and use Repo instead of Cvs for variable.

  PR:		doc/209220
  Submitted by:	Andreas Perstinger

Changes:
  head/en_US.ISO8859-1/htdocs/cgi/ports.cgi
Comment 14 Chris Rees freebsd_committer freebsd_triage 2018-12-23 21:44:12 UTC
Brilliant, well done.  I've applied the substitution to the descr variable as well as $l, though I'm sure it works mostly without.

Committed, thanks!