improve man page handling

This commit is contained in:
Matthias Clasen 2006-11-03 19:48:29 +00:00
parent 0dfbb3b4c1
commit 2dad8a2fc4
2 changed files with 38 additions and 1 deletions

30
yelp-2.16.0-apropos.patch Normal file
View File

@ -0,0 +1,30 @@
--- yelp-2.16.0/src/yelp-search-pager.c.apropos 2006-11-03 14:06:37.000000000 -0500
+++ yelp-2.16.0/src/yelp-search-pager.c 2006-11-03 14:32:34.000000000 -0500
@@ -2039,8 +2039,16 @@
gchar *title = NULL;
/*gint i;*/
- if (line == NULL || line[0] == NULL || line[1] == NULL)
- continue;
+ if (line == NULL || line[0] == NULL || line[1] == NULL)
+ goto done;
+
+ /* RH man inserts rpm references into the whatis database */
+ if (g_str_has_prefix (line[1], "rpm)"))
+ goto done;
+
+ tmp = strchr (line[0], ' ');
+ if (tmp)
+ *tmp = '\0';
title = g_strdup (g_strstrip (line[0]));
after = strstr (line[1], ")");
@@ -2068,6 +2076,8 @@
xmlNewChild (child, NULL, BAD_CAST "score",
BAD_CAST "0.1");
g_free (tmp);
+
+done:
g_strfreev (line);
}

View File

@ -19,7 +19,7 @@
Summary: A system documentation reader from the Gnome project
Name: yelp
Version: 2.16.1
Release: 5%{?dist}
Release: 6%{?dist}
Source: %{name}-%{version}.tar.bz2
# http://bugzilla.gnome.org/show_bug.cgi?id=319096
Patch1: yelp-2.15.5-fedora-docs.patch
@ -27,6 +27,9 @@ Patch2: yelp-2.13.2-add-mime-handling.patch
Patch3: yelp-2.15.91-use-pango.patch
# backports from cvs
Patch4: yelp-2.16.1-crash-fixes.patch
# http://bugzilla.gnome.org/show_bug.cgi?id=370167
Patch5: yelp-2.16.0-apropos.patch
License: GPL
Group: Applications/System
BuildRoot: %{_tmppath}/%{name}-root
@ -84,6 +87,7 @@ one central tool.
%patch2 -p1 -b .add-mime-handling
%patch3 -p1 -b .use-pango
%patch4 -p1 -b .crash-fixes
%patch5 -p1 -b .apropos
%build
%configure \
@ -144,6 +148,9 @@ update-desktop-database &> /dev/null ||:
%{_datadir}/yelp
%changelog
* Fri Nov 3 2006 Matthias Clasen <mclasen@redhat.com> - 2.16.1-6
- Improve the whatis parser
* Fri Nov 3 2006 Matthias Clasen <mclasen@redhat.com> - 2.16.1-5
- Silence %%pre