[man-db/f16] - resolves: #657409 fixed warning when invoking col by the mandb program in cron - resolves: #8248

pschiffe pschiffe at fedoraproject.org
Thu Jul 12 16:36:41 UTC 2012


commit e6e1bffb757b53b4b57f9d865232a3e9193a37d5
Author: Peter Schiffer <pschiffe at redhat.com>
Date:   Thu Jul 12 18:36:20 2012 +0200

    - resolves: #657409
      fixed warning when invoking col by the mandb program in cron
    - resolves: #824825
      apropos returns correct exit code for invalid man page

 man-db-2.6.0.2-locale-fallback.patch   |   55 ++++++++++++++++++++++++++++++++
 man-db-2.6.0.2-whatis-error-code.patch |   11 ++++++
 man-db.spec                            |   12 ++++++-
 3 files changed, 77 insertions(+), 1 deletions(-)
---
diff --git a/man-db-2.6.0.2-locale-fallback.patch b/man-db-2.6.0.2-locale-fallback.patch
new file mode 100644
index 0000000..d3ddc27
--- /dev/null
+++ b/man-db-2.6.0.2-locale-fallback.patch
@@ -0,0 +1,55 @@
+diff -upr man-db-2.6.0.2.orig/lib/encodings.c man-db-2.6.0.2/lib/encodings.c
+--- man-db-2.6.0.2.orig/lib/encodings.c	2011-03-20 02:53:00.000000000 +0100
++++ man-db-2.6.0.2/lib/encodings.c	2012-07-12 17:32:59.748386994 +0200
+@@ -586,14 +586,23 @@ char *find_charset_locale (const char *c
+ 	if (STREQ (charset, get_locale_charset ()))
+ 		return NULL;
+ 
+-	supported = fopen (supported_path, "r");
+-	if (!supported)
+-		return NULL;
+-
+ 	saved_locale = setlocale (LC_CTYPE, NULL);
+ 	if (saved_locale)
+ 		saved_locale = xstrdup (saved_locale);
+ 
++	supported = fopen (supported_path, "r");
++	if (!supported) {
++		if (strlen (charset) >= (size_t) 5
++				&& strncmp (charset, "UTF-8", (size_t) 5) == 0) {
++			locale = "en_US.UTF-8";
++			if (setlocale (LC_CTYPE, locale)) {
++				setlocale (LC_CTYPE, saved_locale);
++				return locale;
++			}
++		}
++		return NULL;
++	}
++
+ 	while (getline (&line, &n, supported) >= 0) {
+ 		const char *space = strchr (line, ' ');
+ 		if (space) {
+diff -upr man-db-2.6.0.2.orig/src/straycats.c man-db-2.6.0.2/src/straycats.c
+--- man-db-2.6.0.2.orig/src/straycats.c	2011-01-09 21:36:53.000000000 +0100
++++ man-db-2.6.0.2/src/straycats.c	2012-07-12 17:31:44.976196785 +0200
+@@ -177,6 +177,7 @@ static int check_for_stray (void)
+ 			char *lang, *page_encoding;
+ 			char *mandir_base;
+ 			pipecmd *col_cmd;
++			char *col_locale;
+ 			char *fullpath;
+ 
+ 			/* we have a straycat. Need to filter it and get
+@@ -226,6 +227,12 @@ static int check_for_stray (void)
+ 			col_cmd = pipecmd_new_argstr
+ 				(get_def_user ("col", COL));
+ 			pipecmd_arg (col_cmd, "-bx");
++			col_locale = find_charset_locale ("UTF-8");
++			if (col_locale) {
++				pipecmd_setenv (col_cmd, "LC_CTYPE",
++						col_locale);
++				free (col_locale);
++			}
+ 			pipeline_command (decomp, col_cmd);
+ 
+ 			fullpath = canonicalize_file_name (catdir);
diff --git a/man-db-2.6.0.2-whatis-error-code.patch b/man-db-2.6.0.2-whatis-error-code.patch
new file mode 100644
index 0000000..7863199
--- /dev/null
+++ b/man-db-2.6.0.2-whatis-error-code.patch
@@ -0,0 +1,11 @@
+diff -upr man-db-2.6.0.2.orig/src/whatis.c man-db-2.6.0.2/src/whatis.c
+--- man-db-2.6.0.2.orig/src/whatis.c	2011-03-20 03:38:48.000000000 +0100
++++ man-db-2.6.0.2/src/whatis.c	2012-07-12 17:52:47.929961438 +0200
+@@ -646,7 +646,6 @@ static int do_apropos (char *page, char 
+ 					display (&info, MYDBM_DPTR (key));
+ 			}
+ 			free (seen_key);
+-			found++;
+ 		} else {
+ 			got_match = parse_name (page, MYDBM_DPTR (key));
+ 			if (got_match)
diff --git a/man-db.spec b/man-db.spec
index 2d2014e..2ff267b 100644
--- a/man-db.spec
+++ b/man-db.spec
@@ -3,7 +3,7 @@
 Summary: Tools for searching and reading man pages
 Name: man-db
 Version: 2.6.0.2
-Release: 3%{?dist}
+Release: 4%{?dist}
 # project man-db  GPLv2+
 # Gnulib part     GPLv3+
 License: GPLv2+ and GPLv3+
@@ -16,6 +16,8 @@ Source2: man-db.sysconfig
 Patch1: man-db-2.5.9-sgr.patch
 Patch2: man-db-2.6.1-wildcards.patch
 Patch3: man-db-2.6.1-so-links.patch
+Patch4: man-db-2.6.0.2-locale-fallback.patch
+Patch5: man-db-2.6.0.2-whatis-error-code.patch
 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Obsoletes: man < 2.0
 Provides: man-pages-reader = %{version}
@@ -38,6 +40,8 @@ manual pages.
 %patch1 -p1 -b .sgr
 %patch2 -p1 -b .wildcards
 %patch3 -p1 -b .so-links
+%patch4 -p1 -b .locale-fallback
+%patch5 -p1 -b .whatis-error-code
 
 %build
 ./autogen.sh
@@ -121,6 +125,12 @@ rm -rf $RPM_BUILD_ROOT
 %lang(ja)   %{_datadir}/man/ja/man*/*
 
 %changelog
+* Thu Jul 12 2012 Peter Schiffer <pschiffe at redhat.com> - 2.6.0.2-4
+- resolves: #657409
+  fixed warning when invoking col by the mandb program in cron
+- resolves: #824825
+  apropos returns correct exit code for invalid man page
+
 * Thu Apr 26 2012 Peter Schiffer <pschiffe at redhat.com> - 2.6.0.2-3
 - resolves: #677669
   added support for wildcards in path


More information about the scm-commits mailing list