]> git.draconx.ca Git - gentoo-fixes.git/blob - sys-apps/man/files/man-1.6g-xz.patch
sys-apps/man: Fix borken Gentoo man-1.6g-echo-escape.patch
[gentoo-fixes.git] / sys-apps / man / files / man-1.6g-xz.patch
1 add support for xz
2
3 http://bugs.gentoo.org/302380
4
5 --- a/src/makewhatis.sh
6 +++ b/src/makewhatis.sh
7 @@ -230,7 +230,7 @@
8             find $mandir/${pages}$i/. -name '*' $findarg0 $findarg -print | $AWK '
9  
10             function readline() {
11 -              if (use_zcat || use_bzcat || use_lzcat) {
12 +              if (use_zcat || use_bzcat || use_lzcat || use_xzcat) {
13                 result = (pipe_cmd | getline);
14                 if (result < 0) {
15                   print "Pipe error: " pipe_cmd " " ERRNO > "/dev/stderr";
16 @@ -245,7 +245,7 @@
17             }
18             
19             function closeline() {
20 -              if (use_zcat || use_bzcat || use_lzcat) {
21 +              if (use_zcat || use_bzcat || use_lzcat || use_xzcat) {
22                 return close(pipe_cmd);
23               } else {
24                 return close(filename);
25 @@ -266,7 +266,9 @@
26                 use_bzcat = match(filename,"\\.bz2");
27                if(!use_bzcat)
28                  use_lzcat = match(filename,"\\.lzma");
29 -              if (use_zcat || use_bzcat || use_lzcat ) {
30 +              if(!use_lzcat)
31 +                use_xzcat = match(filename,"\\.xz");
32 +              if (use_zcat || use_bzcat || use_lzcat || use_xzcat) {
33                 filename_no_gz = substr(filename, 0, RSTART - 1);
34               } else {
35                 filename_no_gz = filename;
36 @@ -279,13 +281,15 @@
37                 actual_section = section;
38               }
39               sub(/\..*/, "", progname);
40 -              if (use_zcat || use_bzcat || use_lzcat) {
41 +              if (use_zcat || use_bzcat || use_lzcat || use_xzcat) {
42                 if (use_zcat) {
43                   pipe_cmd = "zcat \"" filename "\"";
44                  } else if (use_bzcat) {
45                   pipe_cmd = "bzcat \"" filename "\"";
46 -                } else {
47 +                } else if (use_lzcat) {
48                    pipe_cmd = "lzcat \"" filename "\"";
49 +                } else {
50 +                  pipe_cmd = "xzcat \"" filename "\"";
51                  }
52                 # try to avoid suspicious stuff
53                 if (filename ~ /[;&|`$(]/) {