Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | Upstream-Status: Pending |
| 2 | |
| 3 | Signed-off-by: Scott Garman <scott.a.garman@intel.com> |
| 4 | |
| 5 | diff -Naur man-1.6e.orig/src/apropos.sh man-1.6e/src/apropos.sh |
| 6 | --- man-1.6e.orig/src/apropos.sh 2007-05-18 13:49:31.000000000 -0300 |
| 7 | +++ man-1.6e/src/apropos.sh 2007-05-18 14:24:33.000000000 -0300 |
| 8 | @@ -60,16 +60,56 @@ |
| 9 | esac |
| 10 | done |
| 11 | |
| 12 | +# list of languages to look for |
| 13 | +LANG_LIST=`echo $LANGUAGE:$LC_ALL:$LC_MESSAGES:$LANG | tr ':' ' '` |
| 14 | +DIR_LIST="" |
| 15 | +for d in /var/cache/man $manpath /usr/lib |
| 16 | +do |
| 17 | + for l in $LANG_LIST |
| 18 | + do |
| 19 | + if [ -d $d/$l ] |
| 20 | + then |
| 21 | + # check that the path is not already in the list |
| 22 | + if ! echo "$DIR_LIST" | grep " $d/$l\b" > /dev/null |
| 23 | + then |
| 24 | + DIR_LIST="$DIR_LIST $d/$l" |
| 25 | + fi |
| 26 | + fi |
| 27 | + done |
| 28 | + DIR_LIST="$DIR_LIST $d" |
| 29 | + # check that the path is not already in the list |
| 30 | + if ! echo "$DIR_LIST" | grep " $d\b" > /dev/null |
| 31 | + then |
| 32 | + DIR_LIST="$DIR_LIST $d/$l" |
| 33 | + fi |
| 34 | +done |
| 35 | + |
| 36 | while [ "$1" != "" ] |
| 37 | do |
| 38 | found=0 |
| 39 | - for d in /var/cache/man $manpath /usr/lib |
| 40 | + # in order not to display lines in more than one language for |
| 41 | + # a same man page; we check that a given man page name |
| 42 | + # hasn't already been displayed |
| 43 | + BAZ="" |
| 44 | + for d in $DIR_LIST |
| 45 | do |
| 46 | if [ -f $d/whatis ] |
| 47 | then |
| 48 | - if grep -"$grepopt1" "$grepopt2""$1" $d/whatis |
| 49 | + if FOO=`grep -"$grepopt1" "$grepopt2""$1" $d/whatis` |
| 50 | then |
| 51 | - found=1 |
| 52 | + # the LC_ALL=C is needed in case the text is |
| 53 | + # in a different encoding than the locale |
| 54 | + BAR=`echo -e "$FOO" | LC_ALL=C sed 's/ - .*$//' | tr ' []' '_' | sort -u` |
| 55 | + for i in $BAR |
| 56 | + do |
| 57 | + if ! echo "$BAZ" | grep "$i" > /dev/null |
| 58 | + then |
| 59 | + BAZ="$BAZ $i" |
| 60 | + i="^`echo $i | sed 's:_\+:\\\(\[_ \]\\\|\\\[\\\|\\\]\\\)\\\+:g'`" |
| 61 | + echo -e "$FOO" | grep "$i" |
| 62 | + found=1 |
| 63 | + fi |
| 64 | + done |
| 65 | # Some people are satisfied with a single occurrence |
| 66 | # But it is better to give all |
| 67 | # break |
| 68 | diff -Naur man-1.6e.orig/src/makewhatis.sh man-1.6e/src/makewhatis.sh |
| 69 | --- man-1.6e.orig/src/makewhatis.sh 2007-05-18 13:49:31.000000000 -0300 |
| 70 | +++ man-1.6e/src/makewhatis.sh 2007-05-18 13:50:07.000000000 -0300 |
| 71 | @@ -41,12 +41,32 @@ |
| 72 | |
| 73 | program=`basename $0` |
| 74 | |
| 75 | +# this allows to define language specific values fro NAME, DESCRIPTION |
| 76 | +# if not defined, using those default values |
| 77 | +if [ -z "$MAN_NAME" ] |
| 78 | +then |
| 79 | + MAN_NAME="ÐÐÐ|NOM|JMÃNO|NAVN|ÎÎÎÎÎ|NOMBRE|NIME|IZENA|NIMI|IME|\ |
| 80 | +NÃV|NOME|åå|ì´ë¦|NAAM|NAZWA|NUME|ÐÐЯ|MENO|ÐÐÐÐÐ|å称|å稱" |
| 81 | +fi |
| 82 | +if [ -z "$MAN_DESCRIPTION" ] |
| 83 | +then |
| 84 | + MAN_DESCRIPTION="ÐÐÐСÐÐÐÐ|DESCRIPCIÃ|POPIS|BESKRIVELSE|BESCHREIBUNG|\ |
| 85 | +Î ÎΡÎÎΡÎΦÎ|DESCRIPCIÃN|KIRJELDUS|AZALPENA|KUVAUS|OPIS|LEÃRÃS|DESCRIZIONE|\ |
| 86 | +説æ|ì¤ëª
|BESCHRIJVING|DESCRIÃÃO|DESCRIERE|ÐÐÐС|æè¿°" |
| 87 | +fi |
| 88 | +# make them into awk regexp |
| 89 | +MAN_NAME="^(${MAN_NAME})"; |
| 90 | +MAN_DESCRIPTION="^(${MAN_DESCRIPTION})"; |
| 91 | + |
| 92 | # In case both /usr/man and /usr/share/man exist, the former is local |
| 93 | # and should be first. |
| 94 | # It is a bug to add /var/cache/man to DEFCATPATH. |
| 95 | dm= |
| 96 | for d in /usr/share/man /usr/man /usr/X11R6/man /usr/local/man |
| 97 | do |
| 98 | + if [ -n "$LANG" -a -d "$d/$LANG" ]; then |
| 99 | + if [ x$dm = x ]; then dm="$d/$LANG"; else dm=$dm:"$d/$LANG"; fi |
| 100 | + fi |
| 101 | if [ -d $d ]; then |
| 102 | if [ x$dm = x ]; then dm=$d; else dm=$dm:$d; fi |
| 103 | fi |
| 104 | @@ -55,6 +75,9 @@ |
| 105 | dc= |
| 106 | for d in /var/cache/man /usr/share/man/preformat /usr/man/preformat /usr/share/man /usr/man |
| 107 | do |
| 108 | + if [ -n "$LANG" -a -d "$d/$LANG" ]; then |
| 109 | + if [ x$dc = x ]; then dm="$d/$LANG"; else dm=$dc:"$d/$LANG"; fi |
| 110 | + fi |
| 111 | if [ -d $d ]; then |
| 112 | if [ x$dc = x ]; then dc=$d; else dc=$dc:$d; fi |
| 113 | fi |
| 114 | @@ -194,7 +217,7 @@ |
| 115 | section=$i |
| 116 | curdir=$mandir/${pages}$i |
| 117 | export section verbose curdir |
| 118 | - find $mandir/${pages}$i/. -name '*' $findarg0 $findarg -print | $AWK ' |
| 119 | + find $mandir/${pages}$i/. -name '*' $findarg0 $findarg -print | LC_ALL=C $AWK -v MAN_NAME="$MAN_NAME" -v MAN_DESCRIPTION="$MAN_DESCRIPTION" ' |
| 120 | |
| 121 | function readline() { |
| 122 | if (use_zcat || use_bzcat) { |
| 123 | @@ -261,13 +284,7 @@ |
| 124 | gsub(/.\b/, ""); |
| 125 | if (($1 ~ /^\.[Ss][Hh]/ && |
| 126 | ($2 ~ /[Nn][Aa][Mm][Ee]/ || |
| 127 | - $2 ~ /^JMÉNO/ || $2 ~ /^NAVN/ || $2 ~ /^NUME/ || |
| 128 | - $2 ~ /^BEZEICHNUNG/ || $2 ~ /^NOMBRE/ || |
| 129 | - $2 ~ /^NIMI/ || $2 ~ /^NOM/ || $2 ~ /^IME/ || |
| 130 | - $2 ~ /^N[ÉE]V/ || $2 ~ /^NAMA/ || $2 ~ /^̾Á°/ || |
| 131 | - $2 ~ /^̾¾Î/ || $2 ~ /^À̸§/ || $2 ~ /^NAZWA/ || |
| 132 | - $2 ~ /^îáú÷áîéå/ || $2 ~ /^Ãû³Æ/ || $2 ~ /^¦WºÙ/ || |
| 133 | - $2 ~ /^NOME/ || $2 ~ /^NAAM/ || $2 ~ /^ÈÌÅ/)) || |
| 134 | + $2 ~ MAN_NAME )) || |
| 135 | (pages == "cat" && $1 ~ /^NAME/)) { |
| 136 | if (!insh) { |
| 137 | insh = 1; |
| 138 | @@ -278,6 +295,7 @@ |
| 139 | if ($1 ~ /^\.[Ss][HhYS]/ || |
| 140 | (pages == "cat" && |
| 141 | ($1 ~ /^S[yYeE]/ || $1 ~ /^DESCRIPTION/ || |
| 142 | + $1 ~ MAN_DESCRIPTION || |
| 143 | $1 ~ /^COMMAND/ || $1 ~ /^OVERVIEW/ || |
| 144 | $1 ~ /^STRUCTURES/ || $1 ~ /^INTRODUCTION/ || |
| 145 | $0 ~ /^[^ ]/))) { |