]> git.draconx.ca Git - gentoo-fixes.git/blob - sys-apps/man/files/man-1.6f-man2html-compression-2.patch
sys-apps/man: Fix borken Gentoo man-1.6g-echo-escape.patch
[gentoo-fixes.git] / sys-apps / man / files / man-1.6f-man2html-compression-2.patch
1 add support for bzip2/lzma to man2html and friends
2
3 --- a/man2html/glimpse_filters
4 +++ b/man2html/glimpse_filters
5 @@ -1,3 +1,6 @@
6 +*.bz2  bzip2 -d -c
7 +*.lzma lzma -d -c
8 +*.xz   xz -d -c
9  *.gz   gzip -d -c
10  *.Z    gzip -d -c
11  
12 --- a/man2html/scripts/cgi-bin/man/man2html
13 +++ b/man2html/scripts/cgi-bin/man/man2html
14 @@ -93,6 +93,12 @@
15      *.bz2)
16         bzcat "$PAGE" | "$MAN2HTML" "$LL" -D "$PAGE"
17         ;;
18 +    *.lzma)
19 +       lzcat "$PAGE" | "$MAN2HTML" "$LL" -D "$PAGE"
20 +       ;;
21 +    *.xz)
22 +       xzcat "$PAGE" | "$MAN2HTML" "$LL" -D "$PAGE"
23 +       ;;
24      *)
25         "$MAN2HTML" "$LL" "$PAGE"
26         ;;
27 @@ -103,6 +106,12 @@
28  elif [ -r "$PAGE".bz2 ]
29  then
30         bzcat "$PAGE".bz2 | "$MAN2HTML" "$LL" -D "$PAGE"
31 +elif [ -r "$PAGE".lzma ]
32 +then
33 +       lzcat "$PAGE".lzma | "$MAN2HTML" "$LL" -D "$PAGE"
34 +elif [ -r "$PAGE".xz ]
35 +then
36 +       xzcat "$PAGE".xz | "$MAN2HTML" "$LL" -D "$PAGE"
37  else
38         "$MAN2HTML" -E "Strange... Cannot find (or read) $PAGE."
39  fi
40 --- a/man2html/scripts/cgi-bin/man/mansearch
41 +++ b/man2html/scripts/cgi-bin/man/mansearch
42 @@ -153,7 +153,7 @@
43        }
44        print "<DT> <a href=\"" cgipath "/man2html?" fullname "\">";
45        textname = filename;
46 -      sub(/\.(gz)|Z|z$/, "", textname);
47 +      sub(/\.([zZ]|gz|bz2|lzma|xz)$/, "", textname);
48        sub(/\./, "(", textname);
49        textname = textname ")";
50        print textname;
51 --- a/man2html/scripts/cgi-bin/man/mansec
52 +++ b/man2html/scripts/cgi-bin/man/mansec
53 @@ -128,7 +128,7 @@
54                                 # Print out alphabetic quick index and other links
55        }
56                                 # Split page.n into "page" and "n" and generate an entry
57 -      sub(/[.]([zZ]|(gz))$/, "", manpage);
58 +      sub(/[.]([zZ]|gz|bz2|lzma|xz)$/, "", manpage);
59        match(manpage, /[.][^.]+$/);      
60        title = substr(manpage, 1, RSTART - 1);
61        if (section != "all") {