chithanh    15/03/05 12:50:30

  Added:                xman-1.1.3-mandb-2.7.patch
  Log:
  Do not depend on old man-db versions but instead block on newer ones. Add 
patch from Debian to address issues with newer man-db, bug #541446.
  
  (Portage version: 2.2.14/cvs/Linux x86_64, signed Manifest commit with key 
0x2324E7B566DF2611!)

Revision  Changes    Path
1.1                  x11-apps/xman/files/xman-1.1.3-mandb-2.7.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-apps/xman/files/xman-1.1.3-mandb-2.7.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/x11-apps/xman/files/xman-1.1.3-mandb-2.7.patch?rev=1.1&content-type=text/plain

Index: xman-1.1.3-mandb-2.7.patch
===================================================================
>From 438763b6e231410b95b5e352feb65c63cd54de6a Mon Sep 17 00:00:00 2001
From: Julien Cristau <jcris...@debian.org>
Date: Fri, 7 Nov 2014 16:19:57 +0000
Subject: [PATCH] If we have man-db, don't try and emulate man's pipeline

Just let man itself do the formatting / zsoelim / ... dance.

Debian bug#764792 <https://bugs.debian.org/764792>

Signed-off-by: Julien Cristau <jcris...@debian.org>
---
 xman/configure.ac | 5 +++++
 xman/misc.c       | 8 ++++++++
 2 files changed, 13 insertions(+)

diff --git a/xman/configure.ac b/xman/configure.ac
index 9a80cbb..8bb44f2 100644
--- a/xman/configure.ac
+++ b/xman/configure.ac
@@ -44,6 +44,11 @@ if test "x$GROFF" = "xfound" ; then
    AC_DEFINE([HAS_GROFF], 1, [Define to 1 if you have the groff package.])
 fi
 
+AC_CHECK_PROG([MANDB], [mandb], [yes], [no])
+if test x"$MANDB" = xyes; then
+       AC_DEFINE([HAVE_MANDB], 1, [Define if the man implementation is man-db])
+fi
+
 AC_CHECK_FUNCS([mkstemp])
 
 AC_ARG_WITH(helpdir,
diff --git a/xman/misc.c b/xman/misc.c
index 06891cd..da8744a 100644
--- a/xman/misc.c
+++ b/xman/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 */
 
-- 
2.1.1





Reply via email to