Accepting request 899998 from home:schubi2

- Supporting ALSO new `alternatives` which has the same tasks as
  `update-alternatives` but in a simplier way.

OBS-URL: https://build.opensuse.org/request/show/899998
OBS-URL: https://build.opensuse.org/package/show/Base:System/man?expand=0&rev=125
This commit is contained in:
Dr. Werner Fink 2021-06-23 08:37:34 +00:00 committed by Git OBS Bridge
parent c28a6bb4f4
commit c32f4259f9
3 changed files with 55 additions and 1 deletions

View File

@ -0,0 +1,41 @@
diff -u orig/man.c patch/man.c
--- src/man.c 2021-06-07 22:06:42.937525661 +0200
+++ src/man.c 2021-06-08 11:46:40.369916468 +0200
@@ -57,6 +57,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
+#include <libalternatives.h>
#include "argp.h"
#include "dirname.h"
@@ -4066,11 +4067,25 @@
int *found)
{
char *mp;
+ int count = 0;
- GL_LIST_FOREACH_START (manpathlist, mp)
- *found += locate_page (mp, page_section, page_name,
- candidates);
- GL_LIST_FOREACH_END (manpathlist);
+ GL_LIST_FOREACH_START (manpathlist, mp) {
+ count = locate_page (mp, page_section, page_name, candidates);
+ if (count == 0) {
+ /* Checking if there has been defined another manpage defined in the */
+ /* priorities of libalternatives. */
+ char **alternitives = libalts_get_default_manpages(page_name);
+ for (char **alter = alternitives; *alter; alter++){
+ char *p_name, *p_section;
+ split_page_name (*alter, &p_name, &p_section);
+ if (p_name && strlen(p_name)>0 && p_section && strlen(p_section)>0)
+ count = locate_page (mp, p_section, p_name, candidates);
+ free(*alter);
+ }
+ free(alternitives);
+ }
+ *found += count;
+ } GL_LIST_FOREACH_END (manpathlist);
}
/*

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue May 31 20:59:59 UTC 2021 - Stefan Schubert <schubi@suse.de>
- Supporting ALSO new `alternatives` which has the same tasks as
`update-alternatives` but in a simplier way.
-------------------------------------------------------------------
Mon May 31 19:07:16 UTC 2021 - Ferdinand Thiessen <rpm@fthiessen.de>

View File

@ -54,6 +54,7 @@ Patch7: man-db-2.9.4-no-chown.patch
Patch8: man-db-2.9.4.patch
# PATCH-FEATURE-OPENSUSE -- Add documentation about man0 section (header files)
Patch9: man-db-2.6.3-man0.dif
Patch10: man-db-2.9.4-alternitive.dif
BuildRequires: automake
BuildRequires: flex
BuildRequires: gdbm-devel
@ -61,6 +62,7 @@ BuildRequires: gettext-runtime
BuildRequires: gettext-tools
BuildRequires: groff
BuildRequires: less
BuildRequires: libalternatives-devel
BuildRequires: libpipeline-devel >= 1.5.0
BuildRequires: libzio-devel
BuildRequires: man-pages
@ -74,6 +76,7 @@ Requires: glibc-locale-base
Suggests: glibc-locale
Requires: groff >= 1.18
Requires: less
Requires: libalternatives1
# FIXME: use proper Requires(pre/post/preun/...)
PreReq: coreutils
PreReq: fillup
@ -103,6 +106,7 @@ printer (using groff).
%patch7 -p1
%patch8 -p1
%patch9 -b .s10
%patch10 -b .libalernative
rm -f configure
%build
@ -140,7 +144,10 @@ for d in $(cat man/LINGUAS*) ; do
test -d %{_datadir}/locale/$d || continue
LINGUAS="${LINGUAS:+$LINGUAS }$d"
done
export CFLAGS LINGUAS
LIBS="-lalternatives"
export CFLAGS LINGUAS LIBS
# Create configure
aclocal -I ${PWD} -I ${PWD}/m4 -I ${PWD}/gl/m4
autoconf -B ${PWD} -B ${PWD}/m4 -B ${PWD}/gl/m4