Bug 210927

Summary: x11/yelp: Does not display man pages, Illegal option -Z
Product: Ports & Packages Reporter: Rares Vernica <rvernica>
Component: Individual Port(s)Assignee: Carlos J. Puga Medina <cpm>
Status: Closed FIXED    
Severity: Affects Many People CC: cpm, gnome
Priority: --- Keywords: easy, patch, patch-ready
Version: LatestFlags: bugzilla: maintainer-feedback? (gnome)
koobs: merge-quarterly?
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch-yelp-man-compatibility
none
patch-yelp-man-compatibility
none
poudriere testport log on 93x32
none
patch-yelp-man-compatibility
none
patch-yelp-man-compatibility none

Description Rares Vernica 2016-07-08 16:13:56 UTC
yelp can display man pages if used like this:

  yelp man:ls

When I run this, I get:

  > yelp man:ls

  (yelp:5006): GVFS-RemoteVolumeMonitor-WARNING **: remote volume monitor with dbus name org.gtk.vfs.HalVolumeMonitor is not supported
  Illegal option -Z
  Usage:
   man [-adho] [-t | -w] [-M manpath] [-P pager] [-S mansect]
       [-m arch[:machine]] [-p [eprtv]] [mansect] page [...]
   man -f page [...] -- Emulates whatis(1)
   man -k page [...] -- Emulates apropos(1)

It seems that an extra "-Z" argument is passed to "man". The resulting yelp window that pops up shows a white page with just "()".

Version info:

  > pkg info yelp
  yelp-3.18.1
  Name           : yelp
  Version        : 3.18.1
  Installed on   : Fri Jul  8 04:27:35 2016 PDT
  Origin         : x11/yelp
  Architecture   : freebsd:10:x86:64
Comment 1 Rares Vernica 2016-07-09 00:03:58 UTC
I tried to fix this, but I got stuck. Here is what I tried.

I patched the "libyelp/yelp-man-parse.c" file:

--- a/libyelp/yelp-man-parser.c
+++ b/libyelp/yelp-man-parser.c
@@ -369,7 +369,7 @@ get_troff (gchar *path, GError **error)
 {
     gint ystdout;
     GError *err = NULL;
-    const gchar *argv[] = { "man", "-Z", "-Tutf8", "-EUTF-8", path, NULL };
+    const gchar *argv[] = { "man", "-t", path, NULL };
     gchar **my_argv;
 
     /* g_strdupv() should accept a "const gchar **". */

I replace "-Z" with "-t" and removed "-T" and "-E" arguments.

Now, when I run it, I don't get any error on the "man" arguments on the console, but in the "yelp" window, I get:

  Unknown Error
  Wrong 'x res' line from troff: %%Creator: groff version 1.19.2

I am not sure how to proceed from here, but I am willing to try more.
Comment 2 Carlos J. Puga Medina freebsd_committer freebsd_triage 2016-07-10 15:45:58 UTC
Created attachment 172326 [details]
patch-yelp-man-compatibility

Patch to enable compatibility with traditional man (ported from Gentoo).
Comment 3 Carlos J. Puga Medina freebsd_committer freebsd_triage 2016-07-14 19:12:02 UTC
Created attachment 172533 [details]
patch-yelp-man-compatibility
Comment 4 Carlos J. Puga Medina freebsd_committer freebsd_triage 2016-07-14 19:16:13 UTC
Created attachment 172535 [details]
poudriere testport log on 93x32
Comment 5 Carlos J. Puga Medina freebsd_committer freebsd_triage 2016-07-28 16:05:42 UTC
Created attachment 173072 [details]
patch-yelp-man-compatibility
Comment 6 Carlos J. Puga Medina freebsd_committer freebsd_triage 2016-07-30 21:45:56 UTC
Created attachment 173128 [details]
patch-yelp-man-compatibility
Comment 7 commit-hook freebsd_committer freebsd_triage 2016-07-30 22:32:01 UTC
A commit references this bug:

Author: cpm
Date: Sat Jul 30 22:31:21 UTC 2016
New revision: 419332
URL: https://svnweb.freebsd.org/changeset/ports/419332

Log:
  - Add USES=autoreconf
  - Enable compatibility with traditional man

  PR:	210927
  Submitted by:	cpm
  Reported by:	Rares Vernica <rvernica@gmail.com>
  Approved by:	gnome (maintainer timeout, 3 weeks)
  Obtained from:	Gentoo (https://github.com/gentoo/gentoo/blob/master/gnome-extra/yelp/files/yelp-3.16.0-man-compatibility.patch)
  MFH:	2016Q3

Changes:
  head/x11/yelp/Makefile
  head/x11/yelp/files/
  head/x11/yelp/files/patch-libyelp_Makefile.am
  head/x11/yelp/files/patch-libyelp_yelp-man-parser.c
  head/x11/yelp/files/yelp-groff
  head/x11/yelp/pkg-plist
Comment 8 commit-hook freebsd_committer freebsd_triage 2016-07-30 22:39:03 UTC
A commit references this bug:

Author: cpm
Date: Sat Jul 30 22:38:24 UTC 2016
New revision: 419335
URL: https://svnweb.freebsd.org/changeset/ports/419335

Log:
  MFH: r419332

  - Add USES=autoreconf
  - Enable compatibility with traditional man

  PR:	210927
  Submitted by:	cpm
  Reported by:	Rares Vernica <rvernica@gmail.com>
  Approved by:	gnome (maintainer timeout, 3 weeks)
  Obtained from:	Gentoo (https://github.com/gentoo/gentoo/blob/master/gnome-extra/yelp/files/yelp-3.16.0-man-compatibility.patch)

  Approved by:	ports-secteam (junovitch)

Changes:
_U  branches/2016Q3/
  branches/2016Q3/x11/yelp/Makefile
  branches/2016Q3/x11/yelp/files/
  branches/2016Q3/x11/yelp/pkg-plist