wok-6.x annotate manserver/stuff/manserver-1.08-add-xz.patch @ rev 23617

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