[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#764792: x11-apps: xman not rendering any pages (zsoelim: not found)



Control: tag -1 patch

On Sat, Oct 11, 2014 at 14:12:12 +0100, Colin Watson wrote:

> On Sat, Oct 11, 2014 at 01:28:34PM +0200, Julien Cristau wrote:
> > On Sat, Oct 11, 2014 at 02:45:17 -0400, Lee Cremeans wrote:
> > > I was trying out xman on my jessie system, and it turns out it won't render
> > > any pages at all. I notice that when I start xman from a terminal, I see
> > > 
> > > sh: 1: zsoelim: not found
> > > 
> > > in the terminal when I tell it to load a man page. Some checking shows that
> > > zsoelim was in man-db in wheezy, but that no longer seems to be the case
> > > with man-db in jessie on AMD64.
> > 
> > man-db 2.7.0's changelog says "Move zsoelim to /usr/lib/man-db/".
> > Colin, how should I handle this in xman?  Hardcode the path, patch out
> > the use of zsoelim, something else?
> 
> Wow that's an evil mess, and almost certainly broken with anything other
> than ISO-8859-1.  I would suggest burning it to the ground and using
> "man -l" or similar, at least on systems that have man-db, because xman
> appears to be just doing a bad job of reimplementing it.  Failing that
> it would be OK to hardcode /usr/lib/man-db/zsoelim for now (although you
> might want to test it and try both).
> 
> Sorry for the inconvenience; I thought this was an internal utility
> nobody else was using, so it seemed a no-brainer to move it when it was
> conflicting with other packages on other systems ...
> 
Thanks.  As a quick hack this seems to work; there's probably a way to
actually check for man-db...

diff --git a/configure.ac b/configure.ac
index 9a80cbb..ced29c7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -44,6 +44,13 @@ if test "x$GROFF" = "xfound" ; then
    AC_DEFINE([HAS_GROFF], 1, [Define to 1 if you have the groff package.])
 fi
 
+AC_ARG_ENABLE([man-db],
+              AS_HELP_STRING([--enable-man-db], [Use man -l to format pages instead of our own pipeline (use this if your man implementation is man-db)]),
+              [MANDB=$enableval], [MANDB=no])
+if test x"$MANDB" = xyes; then
+	AC_DEFINE([HAVE_MANDB], 1, [Define if your man implementation is man-db])
+fi
+
 AC_CHECK_FUNCS([mkstemp])
 
 AC_ARG_WITH(helpdir,
diff --git a/misc.c b/misc.c
index 06891cd..da8744a 100644
--- a/misc.c
+++ b/misc.c
@@ -661,6 +661,13 @@ static Boolean
 ConstructCommand(char *cmdbuf, const char *path,
                  const char *filename, const char *tempfile)
 {
+#ifdef HAVE_MANDB
+    int used = snprintf(cmdbuf, BUFSIZ, "man -l %s > %s 2>/dev/null",
+                        filename, tempfile);
+    if (used >= BUFSIZ - 1)
+	return FALSE;
+    return TRUE;
+#else
     /* The original code did the following to produce a command line:
      *   sprintf(cmdbuf,"cd %s ; %s %s %s > %s %s", path, TBL,
      *      filename, FORMAT, man_globals->tempfile, "2> /dev/null");
@@ -783,6 +790,7 @@ ConstructCommand(char *cmdbuf, const char *path,
         return (FALSE);
 
     return (TRUE);
+#endif /* man-db */
 }
 #endif                          /* HANDLE_ROFFSEQ */
 
Cheers,
Julien

Attachment: signature.asc
Description: Digital signature


Reply to: