- adds support for man-pages-overrides

This commit is contained in:
Peter Schiffer 2012-10-24 18:10:49 +02:00
parent 7eb2871dd5
commit fb7459cae4
2 changed files with 68 additions and 1 deletions

View File

@ -0,0 +1,63 @@
diff -up man-db-2.6.3/src/manp.c.overrides man-db-2.6.3/src/manp.c
--- man-db-2.6.3/src/manp.c.overrides 2012-10-24 16:52:35.134486439 +0200
+++ man-db-2.6.3/src/manp.c 2012-10-24 16:59:28.300037133 +0200
@@ -51,6 +51,7 @@
#include <ctype.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/param.h>
#include <assert.h>
#include <errno.h>
#include <dirent.h>
@@ -95,6 +96,9 @@ static struct list *namestore, *tailstor
#define MANPATH_MAP 0
#define MANDATORY 1
+/* Subdirectory of MANPATH entries searched for man pages before the directory itself. */
+#define OVERRIDES_DIR "/overrides"
+
/* DIRLIST list[MAXDIRS]; */
static char *tmplist[MAXDIRS];
@@ -933,6 +937,7 @@ char *get_manpath_from_path (const char
char **lp;
char *end;
char *manpathlist;
+ char overrides[MAXPATHLEN];
struct list *list;
tmppath = xstrdup (path);
@@ -960,6 +965,9 @@ char *get_manpath_from_path (const char
if (mandir_list) {
debug ("is in the config file\n");
while (mandir_list) {
+ strcpy(overrides, mandir_list->cont);
+ strcat(overrides, OVERRIDES_DIR);
+ add_dir_to_list (tmplist, overrides);
add_dir_to_list (tmplist, mandir_list->cont);
mandir_list = iterate_over_list
(mandir_list, p, MANPATH_MAP);
@@ -978,6 +986,9 @@ char *get_manpath_from_path (const char
"../share/man, or share/man "
"subdirectory\n");
+ strcpy(overrides, t);
+ strcat(overrides, OVERRIDES_DIR);
+ add_dir_to_list (tmplist, overrides);
add_dir_to_list (tmplist, t);
free (t);
} else
@@ -993,8 +1004,12 @@ char *get_manpath_from_path (const char
debug ("\nadding mandatory man directories\n\n");
for (list = namestore; list; list = list->next)
- if (list->flag == MANDATORY)
+ if (list->flag == MANDATORY) {
+ strcpy(overrides, list->key);
+ strcat(overrides, OVERRIDES_DIR);
+ add_dir_to_list (tmplist, overrides);
add_dir_to_list (tmplist, list->key);
+ }
}
len = 0;

View File

@ -25,6 +25,8 @@ Patch2: man-db-2.6.1-so-links.patch
Patch3: man-db-2.6.1-locale-fallback.patch
# resolves: #841431
Patch4: man-db-2.6.2-invalid-cache.patch
# adds support for man-pages-overrides
Patch5: man-db-2.6.3-overrides.patch
Obsoletes: man < 2.0
Provides: man = %{version}
@ -50,6 +52,7 @@ manual pages.
%patch2 -p1 -b .so-links
%patch3 -p1 -b .locale-fallback
%patch4 -p1 -b .invalid-cache
%patch5 -p1 -b .overrides
%build
%configure \
@ -120,12 +123,13 @@ install -D -p -m 0644 %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/man-db
%lang(it) %{_datadir}/man/it/man*/*
%changelog
* Thu Oct 18 2012 Peter Schiffer <pschiffe@redhat.com> - 2.6.3-1
* Wed Oct 24 2012 Peter Schiffer <pschiffe@redhat.com> - 2.6.3-1
- resolves: #858577
updated to 2.6.3
- cleaned .spec file
- resolves: #855632
fixed SIGABRT crash
- adds support for man-pages-overrides
* Tue Jul 31 2012 Peter Schiffer <pschiffe@redhat.com> - 2.6.2-5
- resolves: #841431