From c32f4259f9dd4722661196ac251ca4419edad3b612cbbefae949a9eda553cde9 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Wed, 23 Jun 2021 08:37:34 +0000 Subject: [PATCH] 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 --- man-db-2.9.4-alternitive.dif | 41 ++++++++++++++++++++++++++++++++++++ man.changes | 6 ++++++ man.spec | 9 +++++++- 3 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 man-db-2.9.4-alternitive.dif diff --git a/man-db-2.9.4-alternitive.dif b/man-db-2.9.4-alternitive.dif new file mode 100644 index 0000000..3c3fecc --- /dev/null +++ b/man-db-2.9.4-alternitive.dif @@ -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 + #include + #include ++#include + + #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); + } + + /* diff --git a/man.changes b/man.changes index 5c81714..fd9bd63 100644 --- a/man.changes +++ b/man.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue May 31 20:59:59 UTC 2021 - Stefan Schubert + +- 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 diff --git a/man.spec b/man.spec index 135f592..1305af1 100644 --- a/man.spec +++ b/man.spec @@ -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