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:
parent
c28a6bb4f4
commit
c32f4259f9
41
man-db-2.9.4-alternitive.dif
Normal file
41
man-db-2.9.4-alternitive.dif
Normal 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
@ -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>
|
Mon May 31 19:07:16 UTC 2021 - Ferdinand Thiessen <rpm@fthiessen.de>
|
||||||
|
|
||||||
|
9
man.spec
9
man.spec
@ -54,6 +54,7 @@ Patch7: man-db-2.9.4-no-chown.patch
|
|||||||
Patch8: man-db-2.9.4.patch
|
Patch8: man-db-2.9.4.patch
|
||||||
# PATCH-FEATURE-OPENSUSE -- Add documentation about man0 section (header files)
|
# PATCH-FEATURE-OPENSUSE -- Add documentation about man0 section (header files)
|
||||||
Patch9: man-db-2.6.3-man0.dif
|
Patch9: man-db-2.6.3-man0.dif
|
||||||
|
Patch10: man-db-2.9.4-alternitive.dif
|
||||||
BuildRequires: automake
|
BuildRequires: automake
|
||||||
BuildRequires: flex
|
BuildRequires: flex
|
||||||
BuildRequires: gdbm-devel
|
BuildRequires: gdbm-devel
|
||||||
@ -61,6 +62,7 @@ BuildRequires: gettext-runtime
|
|||||||
BuildRequires: gettext-tools
|
BuildRequires: gettext-tools
|
||||||
BuildRequires: groff
|
BuildRequires: groff
|
||||||
BuildRequires: less
|
BuildRequires: less
|
||||||
|
BuildRequires: libalternatives-devel
|
||||||
BuildRequires: libpipeline-devel >= 1.5.0
|
BuildRequires: libpipeline-devel >= 1.5.0
|
||||||
BuildRequires: libzio-devel
|
BuildRequires: libzio-devel
|
||||||
BuildRequires: man-pages
|
BuildRequires: man-pages
|
||||||
@ -74,6 +76,7 @@ Requires: glibc-locale-base
|
|||||||
Suggests: glibc-locale
|
Suggests: glibc-locale
|
||||||
Requires: groff >= 1.18
|
Requires: groff >= 1.18
|
||||||
Requires: less
|
Requires: less
|
||||||
|
Requires: libalternatives1
|
||||||
# FIXME: use proper Requires(pre/post/preun/...)
|
# FIXME: use proper Requires(pre/post/preun/...)
|
||||||
PreReq: coreutils
|
PreReq: coreutils
|
||||||
PreReq: fillup
|
PreReq: fillup
|
||||||
@ -103,6 +106,7 @@ printer (using groff).
|
|||||||
%patch7 -p1
|
%patch7 -p1
|
||||||
%patch8 -p1
|
%patch8 -p1
|
||||||
%patch9 -b .s10
|
%patch9 -b .s10
|
||||||
|
%patch10 -b .libalernative
|
||||||
rm -f configure
|
rm -f configure
|
||||||
|
|
||||||
%build
|
%build
|
||||||
@ -140,7 +144,10 @@ for d in $(cat man/LINGUAS*) ; do
|
|||||||
test -d %{_datadir}/locale/$d || continue
|
test -d %{_datadir}/locale/$d || continue
|
||||||
LINGUAS="${LINGUAS:+$LINGUAS }$d"
|
LINGUAS="${LINGUAS:+$LINGUAS }$d"
|
||||||
done
|
done
|
||||||
export CFLAGS LINGUAS
|
|
||||||
|
LIBS="-lalternatives"
|
||||||
|
|
||||||
|
export CFLAGS LINGUAS LIBS
|
||||||
# Create configure
|
# Create configure
|
||||||
aclocal -I ${PWD} -I ${PWD}/m4 -I ${PWD}/gl/m4
|
aclocal -I ${PWD} -I ${PWD}/m4 -I ${PWD}/gl/m4
|
||||||
autoconf -B ${PWD} -B ${PWD}/m4 -B ${PWD}/gl/m4
|
autoconf -B ${PWD} -B ${PWD}/m4 -B ${PWD}/gl/m4
|
||||||
|
Loading…
Reference in New Issue
Block a user