wok view manserver/stuff/manserver-1.08-add-xz.patch @ rev 17735

dahdi-linux: save firmware as source (again)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Mar 06 12:02:31 2015 +0100 (2015-03-06)
parents
children
line source
1 --- manServer.pl.orig
2 +++ manServer.pl
3 @@ -175,7 +175,7 @@
4 listDir($request);
5 $processed = 1;
6 }
7 - elsif (-f $request || -f "$request.gz" || -f "$request.bz2")
8 + elsif (-f $request || -f "$request.gz" || -f "$request.bz2" || -f "$request.xz")
9 {
10 # Only allow fully specified files if they're in our manpath
11 foreach $md (@manpath)
12 @@ -270,7 +270,7 @@
13 foreach $f (@files)
14 {
15 next if ($f eq "." || $f eq ".." || $f !~ m/\./);
16 - $f =~ s/\.(gz|bz2)$//;
17 + $f =~ s/\.(gz|bz2|xz)$//;
18 # ($name) = ($f =~ m,/([^/]*)$,);
19 print OUT "<A HREF=\"$root$request/$f\">$f</A>&nbsp;\n";
20 }
21 @@ -322,6 +322,13 @@
22 $srcfile =~ m/^(.*)$/;
23 $srcfile = $1; # untaint
24 }
25 + elsif (-f "$file.xz")
26 + {
27 + $zfile = "$file.xz";
28 + $srcfile = "/usr/bin/xzcat $zfile |";
29 + $srcfile =~ m/^(.*)$/;
30 + $srcfile = $1; # untaint
31 + }
32 }
33 print LOG "man2html $file\n";
34 $foundNroffTag = 0;
35 @@ -2823,7 +2830,7 @@
36 @multipleMatches = ();
38 $file = $_[0];
39 - return $file if (-f $file || -f "$file.gz" || -f "$file.bz2");
40 + return $file if (-f $file || -f "$file.gz" || -f "$file.bz2" || -f "$file.xz");
42 # Search the path for the requested man page, which may be of the form:
43 # "/usr/man/man1/ls.1", "ls.1" or "ls".
44 @@ -2837,7 +2844,7 @@
45 {
46 $dir = $md;
47 $file = "$dir/man$sect/$page.$sect";
48 - push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2");
49 + push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2" || -f "$file.xz");
50 }
51 }
52 else
53 @@ -2855,13 +2862,13 @@
54 {
55 ($s) = ($dir =~ m/man([0-9A-Za-z]+)$/);
56 $file = "$dir/$page.$s";
57 - push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2");
58 + push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2" || -f "$file.xz");
59 $file = "$dir/$request";
60 - push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2");
61 + push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2" || -f "$file.xz");
62 if ($sect && "$page.$sect" ne $request)
63 {
64 $file = "$dir/$page.$sect";
65 - push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2");
66 + push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2" || -f "$file.xz");
67 }
68 }
69 if (@multipleMatches == 1)
70 @@ -2882,7 +2889,7 @@
71 {
72 if ($f =~ m/^$page\./)
73 {
74 - $f =~ s/\.(gz|bz2)$//;
75 + $f =~ s/\.(gz|bz2|xz)$//;
76 push(@multipleMatches, "$dir/$f");
77 }
78 }
79 @@ -2908,7 +2915,7 @@
80 {
81 next if ($f eq "." || $f eq ".." || $f !~ m/\./);
82 next unless ("$dir/$f" =~ m/perl/);
83 - $f =~ s/\.(gz|bz2)$//;
84 + $f =~ s/\.(gz|bz2|xz)$//;
85 ($name) = ($f =~ m,(.+)\.[^.]*$,);
86 $perlPages{$name} = "$dir/$f";
87 }