File: build-html

package info (click to toggle)
sleuthkit 4.12.1%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 18,608 kB
  • sloc: ansic: 143,795; cpp: 52,225; java: 37,892; xml: 2,416; python: 1,076; perl: 874; makefile: 439; sh: 184
file content (44 lines) | stat: -rwxr-xr-x 1,095 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/perl -w

# Creates HTML versions of the man pages and stores them in the 
# local www directory. 
#
# NOTE: This has been hard coded to work on one of my development
# systems.  It will need to be updated to be more general. 

use strict;

my $BACK = "";
my $RMAN = "/rman-3.2/rman";

# rman and www are back different levels depending on 
# which branch we are on.
if (-d "../../rman-3.2") {
    $BACK = "../../";
} elsif (-d "../../../rman-3.2") {
    $BACK = "../../../";
} elsif (-d "../../../../rman-3.2") {
    $BACK = "../../../../";
} else {
    die "Missing rman directory";
}

die "www not in same dir as rman" unless (-e "${BACK}/www");

print "Cleaning up www directory\n";
system ("rm ${BACK}/www/man/*.html");

print "Building html files\n";
opendir (DIR, ".") or die "Error opening current directory";
while (1) {
    my $f = readdir(DIR);
    last unless defined ($f);
    next if (($f eq ".") || ($f eq ".."));
    if ($f =~ /^(.*?)\.1$/) {
        $f = $1;
    } else {
        next;
    }

    system("${BACK}${RMAN} -f html ${f}.1 > ${BACK}/www/man/${f}.html");
}