update to 2.9.0

- resolves #1764582
This commit is contained in:
Nikola Forró 2020-01-09 17:12:11 +01:00
parent 75b683fe49
commit da858b86c2
4 changed files with 46 additions and 35 deletions

1
.gitignore vendored
View File

@ -4,3 +4,4 @@
/man-db-2.8.4.tar.xz /man-db-2.8.4.tar.xz
/man-db-2.8.6.1.tar.xz /man-db-2.8.6.1.tar.xz
/man-db-2.8.7.tar.xz /man-db-2.8.7.tar.xz
/man-db-2.9.0.tar.xz

View File

@ -1,4 +1,4 @@
From 50e4ba5f8848a422cf82c5b79ab0e32c8bfa10eb Mon Sep 17 00:00:00 2001 From 490ef9d4ea308491f56c4c51712126127b2de004 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nikola=20Forr=C3=B3?= <nforro@redhat.com> From: =?UTF-8?q?Nikola=20Forr=C3=B3?= <nforro@redhat.com>
Date: Tue, 27 Aug 2019 17:53:03 +0200 Date: Tue, 27 Aug 2019 17:53:03 +0200
Subject: [PATCH] man(1): Fix override dir handling Subject: [PATCH] man(1): Fix override dir handling
@ -26,10 +26,10 @@ Tested-by: Nikola Forró <nforro@redhat.com>
2 files changed, 54 insertions(+), 34 deletions(-) 2 files changed, 54 insertions(+), 34 deletions(-)
diff --git a/src/man.c b/src/man.c diff --git a/src/man.c b/src/man.c
index 207e6f6..9b3d038 100644 index 24651d1..d5dc8e3 100644
--- a/src/man.c --- a/src/man.c
+++ b/src/man.c +++ b/src/man.c
@@ -2688,6 +2688,32 @@ static bool duplicate_candidates (struct candidate *left, @@ -2684,6 +2684,32 @@ static bool duplicate_candidates (struct candidate *left,
return ret; return ret;
} }
@ -62,7 +62,7 @@ index 207e6f6..9b3d038 100644
static int compare_candidates (const struct candidate *left, static int compare_candidates (const struct candidate *left,
const struct candidate *right) const struct candidate *right)
{ {
@@ -2777,6 +2803,13 @@ static int compare_candidates (const struct candidate *left, @@ -2773,6 +2799,13 @@ static int compare_candidates (const struct candidate *left,
if (cmp) if (cmp)
return cmp; return cmp;
@ -77,10 +77,10 @@ index 207e6f6..9b3d038 100644
* page in the user's preferred language than a page from a better * page in the user's preferred language than a page from a better
* section, but that attracted objections, so now we prefer to get * section, but that attracted objections, so now we prefer to get
diff --git a/src/manp.c b/src/manp.c diff --git a/src/manp.c b/src/manp.c
index 588f47c..db34c15 100644 index 5441339..c4a25fd 100644
--- a/src/manp.c --- a/src/manp.c
+++ b/src/manp.c +++ b/src/manp.c
@@ -935,23 +935,6 @@ static char *def_path (enum config_flag flag) @@ -903,23 +903,6 @@ static char *def_path (enum config_flag flag)
return manpath; return manpath;
} }
@ -104,7 +104,7 @@ index 588f47c..db34c15 100644
/* /*
* For each directory in the user's path, see if it is one of the * 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 * directories listed in the man_db.config file. If so, and it is
@@ -1000,7 +983,6 @@ char *get_manpath_from_path (const char *path, int mandatory) @@ -968,7 +951,6 @@ char *get_manpath_from_path (const char *path, int mandatory)
if (!manpath_map_found) if (!manpath_map_found)
debug ("is in the config file\n"); debug ("is in the config file\n");
manpath_map_found = true; manpath_map_found = true;
@ -112,8 +112,8 @@ index 588f47c..db34c15 100644
add_dir_to_list (tmplist, config_item->cont); add_dir_to_list (tmplist, config_item->cont);
} GL_LIST_FOREACH_END (config); } GL_LIST_FOREACH_END (config);
@@ -1021,11 +1003,8 @@ char *get_manpath_from_path (const char *path, int mandatory) @@ -989,11 +971,8 @@ char *get_manpath_from_path (const char *path, int mandatory)
debug ("\nadding mandatory man directories\n\n"); debug ("adding mandatory man directories\n");
GL_LIST_FOREACH_START (config, config_item) { GL_LIST_FOREACH_START (config, config_item) {
- if (config_item->flag == MANDATORY) { - if (config_item->flag == MANDATORY) {
@ -125,48 +125,52 @@ index 588f47c..db34c15 100644
} GL_LIST_FOREACH_END (config); } GL_LIST_FOREACH_END (config);
} }
@@ -1113,7 +1092,6 @@ static void add_man_subdirs (gl_list_t list, const char *path) @@ -1078,7 +1057,6 @@ static void add_man_subdirs (gl_list_t list, const char *path)
if (subdir) { if (subdir) {
newpath = xasprintf ("%.*s/man", (int) (subdir - path), path); newpath = xasprintf ("%.*s/man", (int) (subdir - path), path);
if (is_directory (newpath) == 1) { if (is_directory (newpath) == 1) {
- insert_override_dir (list, newpath); - insert_override_dir (list, newpath);
add_dir_to_list (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) free (newpath);
@@ -1086,7 +1064,6 @@ static void add_man_subdirs (gl_list_t list, const char *path)
newpath = xasprintf ("%s/man", path); newpath = xasprintf ("%s/man", path);
if (is_directory (newpath) == 1) { if (is_directory (newpath) == 1) {
- insert_override_dir (list, newpath); - insert_override_dir (list, newpath);
add_dir_to_list (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) free (newpath);
@@ -1095,7 +1072,6 @@ static void add_man_subdirs (gl_list_t list, const char *path)
newpath = xasprintf ("%.*s/share/man", newpath = xasprintf ("%.*s/share/man",
(int) (subdir - path), path); (int) (subdir - path), path);
if (is_directory (newpath) == 1) { if (is_directory (newpath) == 1) {
- insert_override_dir (list, newpath); - insert_override_dir (list, newpath);
add_dir_to_list (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) free (newpath);
@@ -1103,7 +1079,6 @@ static void add_man_subdirs (gl_list_t list, const char *path)
newpath = xasprintf ("%s/share/man", path); newpath = xasprintf ("%s/share/man", path);
if (is_directory (newpath) == 1) { if (is_directory (newpath) == 1) {
- insert_override_dir (list, newpath); - insert_override_dir (list, newpath);
add_dir_to_list (list, newpath); add_dir_to_list (list, newpath);
found = 1;
} }
@@ -1193,19 +1168,31 @@ gl_list_t create_pathlist (const char *manp) free (newpath);
gl_list_node_t node; @@ -1199,7 +1174,9 @@ gl_list_t create_pathlist (const char *manp)
const char *p, *end; const struct canonicalized_path *cp;
- /* Expand the manpath into a list for easier handling. */ /* Expand the manpath into a list of (path, canonicalized path)
+ /* Expand the manpath into a list for easier handling. - * pairs for easier handling. add_dir_to_path_list only adds items
+ * For each entry, add corresponding OVERRIDE_DIR. + * pairs for easier handling. For each entry, add corresponding
+ * */ + * OVERRIDE_DIR.
+ * add_dir_to_path_list only adds items
list = new_string_list (GL_LINKEDHASH_LIST, true); * if they do not have the same canonicalized path as an existing
* item, thereby eliminating duplicates due to symlinks.
*/
@@ -1208,15 +1185,25 @@ gl_list_t create_pathlist (const char *manp)
(GL_LINKEDHASH_LIST, canonicalized_path_equals,
canonicalized_path_hash, canonicalized_path_free, false);
for (p = manp;; p = end + 1) { for (p = manp;; p = end + 1) {
+ char *element, *element_override; + char *element, *element_override;
+ ssize_t p_len; + ssize_t p_len;
@ -174,10 +178,10 @@ index 588f47c..db34c15 100644
end = strchr (p, ':'); end = strchr (p, ':');
- if (end) { - if (end) {
- char *element = xstrndup (p, end - p); - char *element = xstrndup (p, end - p);
- add_dir_to_path_list (list, element); - add_dir_to_path_list (canonicalized_list, element);
- free (element); - free (element);
- } else { - } else {
- add_dir_to_path_list (list, p); - add_dir_to_path_list (canonicalized_list, p);
- break; - break;
+ p_len = end ? end - p : (ssize_t)strlen(p); + p_len = end ? end - p : (ssize_t)strlen(p);
+ +
@ -185,18 +189,18 @@ index 588f47c..db34c15 100644
+ +
+ if (strlen(OVERRIDE_DIR)) { + if (strlen(OVERRIDE_DIR)) {
+ element_override = xasprintf("%s/%s", element, OVERRIDE_DIR); + element_override = xasprintf("%s/%s", element, OVERRIDE_DIR);
+ add_dir_to_path_list (list, element_override); + add_dir_to_path_list (canonicalized_list, element_override);
+ free (element_override); + free (element_override);
} }
+ +
+ add_dir_to_path_list (list, element); + add_dir_to_path_list (canonicalized_list, element);
+ free (element); + free (element);
+ +
+ if (!end) + if (!end)
+ break; + break;
} }
/* Eliminate duplicates due to symlinks. */ list = new_string_list (GL_ARRAY_LIST, false);
-- --
2.21.0 2.21.1

View File

@ -3,8 +3,8 @@
Summary: Tools for searching and reading man pages Summary: Tools for searching and reading man pages
Name: man-db Name: man-db
Version: 2.8.7 Version: 2.9.0
Release: 2%{?dist} Release: 1%{?dist}
# GPLv2+ .. man-db # GPLv2+ .. man-db
# GPLv3+ .. gnulib # GPLv3+ .. gnulib
License: GPLv2+ and GPLv3+ License: GPLv2+ and GPLv3+
@ -136,6 +136,7 @@ fi
%{_unitdir}/man-db-restart-cache-update.service %{_unitdir}/man-db-restart-cache-update.service
%{_sbindir}/accessdb %{_sbindir}/accessdb
%{_bindir}/man %{_bindir}/man
%{_bindir}/man-recode
%{_bindir}/whatis %{_bindir}/whatis
%{_bindir}/apropos %{_bindir}/apropos
%{_bindir}/manpath %{_bindir}/manpath
@ -153,6 +154,7 @@ fi
%{_mandir}/man1/apropos.1* %{_mandir}/man1/apropos.1*
%{_mandir}/man1/lexgrog.1* %{_mandir}/man1/lexgrog.1*
%{_mandir}/man1/man.1* %{_mandir}/man1/man.1*
%{_mandir}/man1/man-recode.1*
%{_mandir}/man1/manconv.1* %{_mandir}/man1/manconv.1*
%{_mandir}/man1/manpath.1* %{_mandir}/man1/manpath.1*
%{_mandir}/man1/whatis.1* %{_mandir}/man1/whatis.1*
@ -181,6 +183,10 @@ fi
%config(noreplace) %{_sysconfdir}/cron.daily/man-db.cron %config(noreplace) %{_sysconfdir}/cron.daily/man-db.cron
%changelog %changelog
* Thu Jan 09 2020 Nikola Forró <nforro@redhat.com> - 2.9.0-1
- update to 2.9.0
resolves #1764582
* Fri Sep 27 2019 Nikola Forró <nforro@redhat.com> - 2.8.7-2 * Fri Sep 27 2019 Nikola Forró <nforro@redhat.com> - 2.8.7-2
- schedule interrupted cache update for the next boot, instead of blocking - schedule interrupted cache update for the next boot, instead of blocking
system reboot/shutdown system reboot/shutdown

View File

@ -1 +1 @@
SHA512 (man-db-2.8.7.tar.xz) = 9f9d6f3b776c0b35f95c179fb668f2dc3db3d3e63a162cfda98c5d126fe147f2418e1a1503037ebe28314f57d9b6f48b7f7674d611df14424973a866a61ff2d9 SHA512 (man-db-2.9.0.tar.xz) = 7deb4421c7944276c6edf974b1336ee2f6605ee470c98d374544e2fcaa32ec2afe077c5fd020fc1f74df058384a293b8ad5a92d86b1c15a949573af46ba09cda