update to 2.8.6.1

- resolves #1742475
This commit is contained in:
Nikola Forró 2019-08-28 10:58:50 +02:00
parent 95ce280022
commit 2d0db51d7d
4 changed files with 83 additions and 51 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@
/man-db-2.7.6.1.tar.xz
/man-db-2.8.3.tar.xz
/man-db-2.8.4.tar.xz
/man-db-2.8.6.1.tar.xz

View File

@ -1,6 +1,6 @@
From 84d6b3fab40be5e1ea288fb296df6cd8be06c985 Mon Sep 17 00:00:00 2001
From 0aaea01eb448a2a66c1a00b156f19fac7d686b04 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nikola=20Forr=C3=B3?= <nforro@redhat.com>
Date: Thu, 19 Jan 2017 10:45:57 +0100
Date: Tue, 27 Aug 2019 17:53:03 +0200
Subject: [PATCH] man(1): Fix override dir handling
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
@ -21,15 +21,15 @@ is passed to ./configure.
Reported-by: Nikola Forró <nforro@redhat.com>
Tested-by: Nikola Forró <nforro@redhat.com>
---
src/man.c | 33 +++++++++++++++++++++++++++++++++
src/manp.c | 52 +++++++++++++++++++++-------------------------------
2 files changed, 54 insertions(+), 31 deletions(-)
src/man.c | 33 ++++++++++++++++++++++++++++++++
src/manp.c | 55 +++++++++++++++++++++---------------------------------
2 files changed, 54 insertions(+), 34 deletions(-)
diff --git a/src/man.c b/src/man.c
index 15a568a..8b11f43 100644
index 78c8968..197e5fb 100644
--- a/src/man.c
+++ b/src/man.c
@@ -2665,6 +2665,32 @@ static int duplicate_candidates (struct candidate *left,
@@ -2685,6 +2685,32 @@ static bool duplicate_candidates (struct candidate *left,
return ret;
}
@ -62,7 +62,7 @@ index 15a568a..8b11f43 100644
static int compare_candidates (const struct candidate *left,
const struct candidate *right)
{
@@ -2749,6 +2775,13 @@ static int compare_candidates (const struct candidate *left,
@@ -2774,6 +2800,13 @@ static int compare_candidates (const struct candidate *left,
if (cmp)
return cmp;
@ -77,17 +77,18 @@ index 15a568a..8b11f43 100644
* page in the user's preferred language than a page from a better
* section, but that attracted objections, so now we prefer to get
diff --git a/src/manp.c b/src/manp.c
index 0d864f1..b78a50f 100644
index 1dfecf3..13dd72a 100644
--- a/src/manp.c
+++ b/src/manp.c
@@ -931,23 +931,6 @@ static char *def_path (int flag)
@@ -935,23 +935,6 @@ static char *def_path (enum config_flag flag)
return manpath;
}
/*
-/*
- * If specified with configure, append OVERRIDE_DIR to dir param and add it
- * to the lp list.
- * to list.
- */
-static void insert_override_dir (char **lp, const char *dir)
-static void insert_override_dir (gl_list_t list, const char *dir)
-{
- char *override_dir = NULL;
-
@ -95,53 +96,77 @@ index 0d864f1..b78a50f 100644
- return;
-
- if ((override_dir = xasprintf ("%s/%s", dir, OVERRIDE_DIR))) {
- add_dir_to_list (lp, override_dir);
- add_dir_to_list (list, override_dir);
- free (override_dir);
- }
-}
-
-/*
/*
* For each directory in the user's path, see if it is one of the
* directories listed in the man_db.config file. If so, and it is
* not already in the manpath, add it. If the directory is not listed
@@ -994,8 +977,6 @@ char *get_manpath_from_path (const char *path, int mandatory)
if (mandir_list) {
debug ("is in the config file\n");
while (mandir_list) {
- insert_override_dir (tmplist,
- mandir_list->cont);
add_dir_to_list (tmplist, mandir_list->cont);
mandir_list = iterate_over_list
(mandir_list, p, MANPATH_MAP);
@@ -1014,7 +995,6 @@ char *get_manpath_from_path (const char *path, int mandatory)
"../share/man, or share/man "
"subdirectory\n");
@@ -1000,7 +983,6 @@ char *get_manpath_from_path (const char *path, int mandatory)
if (!manpath_map_found)
debug ("is in the config file\n");
manpath_map_found = true;
- insert_override_dir (tmplist, config_item->cont);
add_dir_to_list (tmplist, config_item->cont);
} GL_LIST_FOREACH_END (config);
- insert_override_dir (tmplist, t);
add_dir_to_list (tmplist, t);
free (t);
} else
@@ -1030,10 +1010,8 @@ char *get_manpath_from_path (const char *path, int mandatory)
@@ -1021,11 +1003,8 @@ char *get_manpath_from_path (const char *path, int mandatory)
debug ("\nadding mandatory man directories\n\n");
for (list = namestore; list; list = list->next)
- if (list->flag == MANDATORY) {
- insert_override_dir (tmplist, list->key);
+ if (list->flag == MANDATORY)
add_dir_to_list (tmplist, list->key);
GL_LIST_FOREACH_START (config, config_item) {
- if (config_item->flag == MANDATORY) {
- insert_override_dir (tmplist,
- config_item->key);
+ if (config_item->flag == MANDATORY)
add_dir_to_list (tmplist, config_item->key);
- }
} GL_LIST_FOREACH_END (config);
}
len = 0;
@@ -1201,18 +1179,30 @@ void create_pathlist (const char *manp, char **mp)
@@ -1113,7 +1092,6 @@ static void add_man_subdirs (gl_list_t list, const char *path)
if (subdir) {
newpath = xasprintf ("%.*s/man", (int) (subdir - path), path);
if (is_directory (newpath) == 1) {
- insert_override_dir (list, newpath);
add_dir_to_list (list, newpath);
found = 1;
}
@@ -1122,7 +1100,6 @@ static void add_man_subdirs (gl_list_t list, const char *path)
newpath = xasprintf ("%s/man", path);
if (is_directory (newpath) == 1) {
- insert_override_dir (list, newpath);
add_dir_to_list (list, newpath);
found = 1;
}
@@ -1132,7 +1109,6 @@ static void add_man_subdirs (gl_list_t list, const char *path)
newpath = xasprintf ("%.*s/share/man",
(int) (subdir - path), path);
if (is_directory (newpath) == 1) {
- insert_override_dir (list, newpath);
add_dir_to_list (list, newpath);
found = 1;
}
@@ -1141,7 +1117,6 @@ static void add_man_subdirs (gl_list_t list, const char *path)
newpath = xasprintf ("%s/share/man", path);
if (is_directory (newpath) == 1) {
- insert_override_dir (list, newpath);
add_dir_to_list (list, newpath);
found = 1;
}
@@ -1193,19 +1168,31 @@ gl_list_t create_pathlist (const char *manp)
gl_list_node_t node;
const char *p, *end;
char **mphead = mp;
- /* Expand the manpath into a list for easier handling. */
+ /* Expand the manpath into a list for easier handling.
+ * For each entry, add corresponding OVERRIDE_DIR.
+ * */
list = new_string_list (GL_LINKEDHASH_LIST, true);
for (p = manp;; p = end + 1) {
+ char *element, *element_override;
+ ssize_t p_len;
@ -149,10 +174,10 @@ index 0d864f1..b78a50f 100644
end = strchr (p, ':');
- if (end) {
- char *element = xstrndup (p, end - p);
- mp = add_dir_to_path_list (mphead, mp, element);
- add_dir_to_path_list (list, element);
- free (element);
- } else {
- mp = add_dir_to_path_list (mphead, mp, p);
- add_dir_to_path_list (list, p);
- break;
+ p_len = end ? end - p : (ssize_t)strlen(p);
+
@ -160,18 +185,18 @@ index 0d864f1..b78a50f 100644
+
+ if (strlen(OVERRIDE_DIR)) {
+ element_override = xasprintf("%s/%s", element, OVERRIDE_DIR);
+ mp = add_dir_to_path_list (mphead, mp, element_override);
+ add_dir_to_path_list (list, element_override);
+ free (element_override);
}
+
+ mp = add_dir_to_path_list (mphead, mp, element);
+ add_dir_to_path_list (list, element);
+ free (element);
+
+ if (!end)
+ break;
}
*mp = NULL;
/* Eliminate duplicates due to symlinks. */
--
2.7.4
2.21.0

View File

@ -3,8 +3,8 @@
Summary: Tools for searching and reading man pages
Name: man-db
Version: 2.8.4
Release: 5%{?dist}
Version: 2.8.6.1
Release: 1%{?dist}
# GPLv2+ .. man-db
# GPLv3+ .. gnulib
License: GPLv2+ and GPLv3+
@ -17,7 +17,7 @@ Source3: man-db-cache-update.service
Patch0: man-db-2.8.3-change-owner-of-man-cache.patch
# http://lists.nongnu.org/archive/html/man-db-devel/2017-01/msg00013.html
Patch1: man-db-2.7.6.1-fix-override-dir-handling.patch
Patch1: man-db-2.8.6.1-fix-override-dir-handling.patch
Obsoletes: man < 2.0
Provides: man = %{version}
@ -57,6 +57,7 @@ This package provides periodic update of man-db cache.
%configure \
--with-sections="1 1p 8 2 3 3p 3pm 4 5 6 7 9 0p n l p o 1x 2x 3x 4x 5x 6x 7x 8x" \
--disable-setuid --disable-cache-owner \
--with-systemdsystemunitdir=no \
--with-browser=elinks --with-lzip=lzip \
--with-override-dir=overrides
make CC="%{__cc} %{optflags}" %{?_smp_mflags} V=1
@ -165,6 +166,7 @@ fi
%lang(ja) %{_datadir}/man/ja/man*/*
%lang(nl) %{_datadir}/man/nl/man*/*
%lang(pl) %{_datadir}/man/pl/man*/*
%lang(pt) %{_datadir}/man/pt/man*/*
%lang(pt_BR) %{_datadir}/man/pt_BR/man*/*
%lang(ru) %{_datadir}/man/ru/man*/*
%lang(sr) %{_datadir}/man/sr/man*/*
@ -176,6 +178,10 @@ fi
%config(noreplace) %{_sysconfdir}/cron.daily/man-db.cron
%changelog
* Tue Aug 27 2019 Nikola Forró <nforro@redhat.com> - 2.8.6.1-1
- update to 2.8.6.1
resolves #1742475
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.8.4-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

View File

@ -1 +1 @@
SHA512 (man-db-2.8.4.tar.xz) = 3cc160a5a8a0a4e918f6f6546582d1e5fe9851a13c5bd8dc94e3fcbf4ec28cb3cd1524b1ae30722931c84981fa8ca9ac64c9c4d9544c2d0bea80ac9f39cb5e66
SHA512 (man-db-2.8.6.1.tar.xz) = 0c43cdddf2e07cd4a2225e098ea4cbfb2842a9bbf08bfb073058be0d66efac3a77ca0f8725564677c8f61e671f471c76f1dbba77a7601d7a63bb81350ef51bb5