summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/man/man-1.6f/man-1.6e-i18n_whatis.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/man/man-1.6f/man-1.6e-i18n_whatis.patch')
-rw-r--r--meta/recipes-extended/man/man-1.6f/man-1.6e-i18n_whatis.patch141
1 files changed, 141 insertions, 0 deletions
diff --git a/meta/recipes-extended/man/man-1.6f/man-1.6e-i18n_whatis.patch b/meta/recipes-extended/man/man-1.6f/man-1.6e-i18n_whatis.patch
new file mode 100644
index 0000000000..ad62a6016f
--- /dev/null
+++ b/meta/recipes-extended/man/man-1.6f/man-1.6e-i18n_whatis.patch
@@ -0,0 +1,141 @@
1diff -Naur man-1.6e.orig/src/apropos.sh man-1.6e/src/apropos.sh
2--- man-1.6e.orig/src/apropos.sh 2007-05-18 13:49:31.000000000 -0300
3+++ man-1.6e/src/apropos.sh 2007-05-18 14:24:33.000000000 -0300
4@@ -60,16 +60,56 @@
5 esac
6 done
7
8+# list of languages to look for
9+LANG_LIST=`echo $LANGUAGE:$LC_ALL:$LC_MESSAGES:$LANG | tr ':' ' '`
10+DIR_LIST=""
11+for d in /var/cache/man $manpath /usr/lib
12+do
13+ for l in $LANG_LIST
14+ do
15+ if [ -d $d/$l ]
16+ then
17+ # check that the path is not already in the list
18+ if ! echo "$DIR_LIST" | grep " $d/$l\b" > /dev/null
19+ then
20+ DIR_LIST="$DIR_LIST $d/$l"
21+ fi
22+ fi
23+ done
24+ DIR_LIST="$DIR_LIST $d"
25+ # check that the path is not already in the list
26+ if ! echo "$DIR_LIST" | grep " $d\b" > /dev/null
27+ then
28+ DIR_LIST="$DIR_LIST $d/$l"
29+ fi
30+done
31+
32 while [ "$1" != "" ]
33 do
34 found=0
35- for d in /var/cache/man $manpath /usr/lib
36+ # in order not to display lines in more than one language for
37+ # a same man page; we check that a given man page name
38+ # hasn't already been displayed
39+ BAZ=""
40+ for d in $DIR_LIST
41 do
42 if [ -f $d/whatis ]
43 then
44- if grep -"$grepopt1" "$grepopt2""$1" $d/whatis
45+ if FOO=`grep -"$grepopt1" "$grepopt2""$1" $d/whatis`
46 then
47- found=1
48+ # the LC_ALL=C is needed in case the text is
49+ # in a different encoding than the locale
50+ BAR=`echo -e "$FOO" | LC_ALL=C sed 's/ - .*$//' | tr ' []' '_' | sort -u`
51+ for i in $BAR
52+ do
53+ if ! echo "$BAZ" | grep "$i" > /dev/null
54+ then
55+ BAZ="$BAZ $i"
56+ i="^`echo $i | sed 's:_\+:\\\(\[_ \]\\\|\\\[\\\|\\\]\\\)\\\+:g'`"
57+ echo -e "$FOO" | grep "$i"
58+ found=1
59+ fi
60+ done
61 # Some people are satisfied with a single occurrence
62 # But it is better to give all
63 # break
64diff -Naur man-1.6e.orig/src/makewhatis.sh man-1.6e/src/makewhatis.sh
65--- man-1.6e.orig/src/makewhatis.sh 2007-05-18 13:49:31.000000000 -0300
66+++ man-1.6e/src/makewhatis.sh 2007-05-18 13:50:07.000000000 -0300
67@@ -41,12 +41,32 @@
68
69 program=`basename $0`
70
71+# this allows to define language specific values fro NAME, DESCRIPTION
72+# if not defined, using those default values
73+if [ -z "$MAN_NAME" ]
74+then
75+ MAN_NAME="ИМЕ|NOM|JMÉNO|NAVN|ΟΝΟΜΑ|NOMBRE|NIME|IZENA|NIMI|IME|\
76+NÉV|NOME|名前|이름|NAAM|NAZWA|NUME|ИМЯ|MENO|НАЗВА|名称|名稱"
77+fi
78+if [ -z "$MAN_DESCRIPTION" ]
79+then
80+ MAN_DESCRIPTION="ОПИСАНИЕ|DESCRIPCIÓ|POPIS|BESKRIVELSE|BESCHREIBUNG|\
81+ΠΕΡΙΓΡΑΦΗ|DESCRIPCIÓN|KIRJELDUS|AZALPENA|KUVAUS|OPIS|LEÍRÁS|DESCRIZIONE|\
82+説明|설명|BESCHRIJVING|DESCRIÇÃO|DESCRIERE|ОПИС|描述"
83+fi
84+# make them into awk regexp
85+MAN_NAME="^(${MAN_NAME})";
86+MAN_DESCRIPTION="^(${MAN_DESCRIPTION})";
87+
88 # In case both /usr/man and /usr/share/man exist, the former is local
89 # and should be first.
90 # It is a bug to add /var/cache/man to DEFCATPATH.
91 dm=
92 for d in /usr/share/man /usr/man /usr/X11R6/man /usr/local/man
93 do
94+ if [ -n "$LANG" -a -d "$d/$LANG" ]; then
95+ if [ x$dm = x ]; then dm="$d/$LANG"; else dm=$dm:"$d/$LANG"; fi
96+ fi
97 if [ -d $d ]; then
98 if [ x$dm = x ]; then dm=$d; else dm=$dm:$d; fi
99 fi
100@@ -55,6 +75,9 @@
101 dc=
102 for d in /var/cache/man /usr/share/man/preformat /usr/man/preformat /usr/share/man /usr/man
103 do
104+ if [ -n "$LANG" -a -d "$d/$LANG" ]; then
105+ if [ x$dc = x ]; then dm="$d/$LANG"; else dm=$dc:"$d/$LANG"; fi
106+ fi
107 if [ -d $d ]; then
108 if [ x$dc = x ]; then dc=$d; else dc=$dc:$d; fi
109 fi
110@@ -194,7 +217,7 @@
111 section=$i
112 curdir=$mandir/${pages}$i
113 export section verbose curdir
114- find $mandir/${pages}$i/. -name '*' $findarg0 $findarg -print | $AWK '
115+ find $mandir/${pages}$i/. -name '*' $findarg0 $findarg -print | LC_ALL=C $AWK -v MAN_NAME="$MAN_NAME" -v MAN_DESCRIPTION="$MAN_DESCRIPTION" '
116
117 function readline() {
118 if (use_zcat || use_bzcat) {
119@@ -261,13 +284,7 @@
120 gsub(/.\b/, "");
121 if (($1 ~ /^\.[Ss][Hh]/ &&
122 ($2 ~ /[Nn][Aa][Mm][Ee]/ ||
123- $2 ~ /^JMNO/ || $2 ~ /^NAVN/ || $2 ~ /^NUME/ ||
124- $2 ~ /^BEZEICHNUNG/ || $2 ~ /^NOMBRE/ ||
125- $2 ~ /^NIMI/ || $2 ~ /^NOM/ || $2 ~ /^IME/ ||
126- $2 ~ /^N[E]V/ || $2 ~ /^NAMA/ || $2 ~ /^̾/ ||
127- $2 ~ /^̾/ || $2 ~ /^̸/ || $2 ~ /^NAZWA/ ||
128- $2 ~ /^/ || $2 ~ /^/ || $2 ~ /^W/ ||
129- $2 ~ /^NOME/ || $2 ~ /^NAAM/ || $2 ~ /^/)) ||
130+ $2 ~ MAN_NAME )) ||
131 (pages == "cat" && $1 ~ /^NAME/)) {
132 if (!insh) {
133 insh = 1;
134@@ -278,6 +295,7 @@
135 if ($1 ~ /^\.[Ss][HhYS]/ ||
136 (pages == "cat" &&
137 ($1 ~ /^S[yYeE]/ || $1 ~ /^DESCRIPTION/ ||
138+ $1 ~ MAN_DESCRIPTION ||
139 $1 ~ /^COMMAND/ || $1 ~ /^OVERVIEW/ ||
140 $1 ~ /^STRUCTURES/ || $1 ~ /^INTRODUCTION/ ||
141 $0 ~ /^[^ ]/))) {