obsolete git-crypt
[oi-userland.git] / components / desktop / gnome / yelp / patches / 04-yelp-manpath.patch
blobead8af0b389d869548332fdc7f37548ed8735d70
1 https://www.illumos.org/issues/7266
3 --- /dev/null
4 +++ yelp-42.2/libyelp/yelp-manpath
5 @@ -0,0 +1,37 @@
6 +#!/usr/bin/sh
8 +PATH=/usr/bin
10 +function usage {
11 + printf "Usage:\n";
12 + printf "$0 -w [section] name\n"
15 +if [ "$1" != "-w" -o $# -gt 3 -o $# -lt 2 ] ; then
16 + usage
17 + exit
18 +fi
20 +if [ $# -eq 3 ] ; then
21 + section=$2
22 + name=$3
23 +else
24 + section=
25 + name=$2
26 +fi
28 +# If section is set, we need man page from this section.
29 +# if it is not set, show first one
30 +man -l "$name" | \
31 +while read str ; do
32 + manpath="`echo $str |cut -d \ -f 3`"
33 + mansection="`echo $str |cut -d \( -f 2 | cut -d \) -f 1`"
34 + fullpath="$manpath/man$mansection/$name.$mansection"
35 + if [ -z "$section" ]; then
36 + echo "$fullpath"
37 + break
38 + elif [ "$section" = "$mansection" ]; then
39 + echo "$fullpath"
40 + break
41 + fi
42 +done
43 --- yelp-42.2/libyelp/yelp-uri.c.orig
44 +++ yelp-42.2/libyelp/yelp-uri.c
45 @@ -950,7 +950,7 @@
46 static gchar*
47 find_man_path (gchar* name, gchar* section)
49 - const gchar* argv[] = { "man", "-w", NULL, NULL, NULL };
50 + const gchar* argv[] = { LIBEXECDIR "/yelp-manpath" , "-w", NULL, NULL, NULL };
51 gchar **my_argv;
52 gchar *ystdout = NULL;
53 gint status;
54 --- yelp-42.2/Makefile.am.orig
55 +++ yelp-42.2/Makefile.am
56 @@ -7,7 +7,7 @@
58 lib_LTLIBRARIES = libyelp/libyelp.la
60 -libexec_SCRIPTS = libyelp/yelp-groff
61 +libexec_SCRIPTS = libyelp/yelp-groff libyelp/yelp-manpath
63 libyelp_libyelp_la_SOURCES = \
64 libyelp/yelp-bookmarks.c \
65 @@ -147,6 +147,7 @@
66 $(YELP_EXTENSION_CFLAGS)
68 libyelp_web_extension_libyelpwebextension_la_CPPFLAGS = \
69 + -DLIBEXECDIR=\"$(libexecdir)\" \
70 -DDATADIR=\""$(datadir)"\" \
71 -DYELP_ICON_PATH=\"$(YELP_ICON_PATH)\" \
72 -I$(top_srcdir)/libyelp