Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37748813
en ru br
Репозитории ALT
5.1: 1.6f-alt11
4.1: 1.6f-alt1
4.0: 1.5m2-alt4
+backports:1.6f-alt5.M40.1
3.0: 1.5m2-alt3
www.altlinux.org/Changes

Группа :: Система/Основа
Пакет: man

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: man-1.5m2-alt-utf8whatis.patch
Скачать


--- man-1.5m2/src/makewhatis.sh.vns	2004-05-28 16:07:20 +0400
+++ man-1.5m2/src/makewhatis.sh	2004-05-28 16:07:27 +0400
@@ -125,6 +125,11 @@
    done
 fi
 
+ICONV=/usr/bin/iconv
+if [ ! -x "$ICONV" ]; then
+	ICONV=
+fi
+
 for mandir in $manpath; do
 	[ -d "$mandir" ] || continue
 	[ "$mandir" != "/usr/man" ] || continue
@@ -152,6 +157,16 @@
 	else      
 		here=$PWD
 		cd "$mandir"
+		iconv_cmd=cat
+		if [ -f "$mandir/.charset" ]; then
+			charset=`cat $mandir/.charset`
+			if [ -n "$charset" -a -n "$ICONV" ]; then
+				iconv_cmd="$ICONV -f $charset -t utf-8"
+			fi
+			if [ "`echo TEST | $iconv_cmd`" != "TEST" ]; then
+				iconv_cmd=cat
+			fi
+		fi
 		for i in $SECTIONS; do
 			if [ -d "man$i" ]; then
 				cd "man$i"
@@ -159,26 +174,15 @@
 				export curdir="$mandir/man$i"
 				find -type f -name '*.*' $findarg $deffindarg -print | gawk '
 	    function readline() {
-	      if (use_zcat || use_bzcat) {
 		result = (pipe_cmd | getline);
 		if (result < 0) {
 		  print "Pipe error: " pipe_cmd " " ERRNO > "/dev/stderr";
 		}
-	      } else {
-		result = (getline < filename);
-		if (result < 0) {
-		  print "Read file error: " filename " " ERRNO > "/dev/stderr";
-		}
-	      }
 	      return result;
 	    }
 	    
 	    function closeline() {
-	      if (use_zcat || use_bzcat) {
 		return close(pipe_cmd);
-	      } else {
-		return close(filename);
-	      }
 	    }
 	    
 	    function do_one() {
@@ -219,13 +223,18 @@
 		pipe_cmd = filename;
 		gsub(pattern, "\\\\&", pipe_cmd);
 		pipe_cmd = "bzcat " pipe_cmd;
+	      } else {
+	        pipe_cmd = filename;
+		gsub(pattern, "\\\\&", pipe_cmd);
+		pipe_cmd = "cat " pipe_cmd;
 	      }
+	      pipe_cmd = pipe_cmd " | " iconv_cmd;
 	    
 	      while (!done && readline() > 0) {
 		gsub(/.\b/, "");
 		if (($1 ~ /^\.[Ss][Hh]/ &&
 		  ($2 ~ /[Nn][Aa][Mm][Ee]/ ||
-		   $2 ~ /[Ии][Мм][Яя]/ || $2 ~ /[Нн][Аа][Зз][Вв][Аа][Нн][Ии][Ее]/ ||
+		   $2 ~ /(п≤|п╦)(п°|п╪)(п╞|я▐)/ || $2 ~ /(п²|п╫)(п░|п╟)(п≈|п╥)(п▓|п╡)(п░|п╟)(п²|п╫)(п≤|п╦)(п∙|п╣)/ ||
 		   $2 ~ /^JMиNO/ || $2 ~ /^NAVN/ ||
 		   $2 ~ /^BEZEICHNUNG/ || $2 ~ /^NOMBRE/ ||
 		   $2 ~ /^NIMI/ || $2 ~ /^NOM/ || $2 ~ /^IME/ ||
@@ -358,7 +367,7 @@
 	      filename = $0;
 	      do_one();
 	    }
-	    ' pages=$pages section=$section verbose=$verbose curdir=$curdir
+	    ' pages=$pages section=$section verbose=$verbose curdir=$curdir iconv_cmd="$iconv_cmd"
 	    cd ..
 	 fi
 		done > "$TMPFILE"
--- man-1.5m2/src/apropos.sh.vns	2004-05-28 16:06:59 +0400
+++ man-1.5m2/src/apropos.sh	2004-05-28 16:14:28 +0400
@@ -49,6 +49,19 @@
     PAGER="%pager%"
 fi
 
+ICONV=/usr/bin/iconv
+if [ ! -x "$ICONV" ]
+then
+    ICONV=
+fi
+
+if [ -n "$ICONV" ]
+then
+    ICONV="$ICONV -f utf-8 -r?"
+else
+    ICONV=cat
+fi
+
 args=
 for arg in $*; do
     case $arg in
@@ -147,4 +160,4 @@
     fi
 
     shift
-done | $PAGER
+done | $ICONV | $PAGER
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin