summaryrefslogtreecommitdiff
path: root/Documentation/build-docdep.perl
blob: dedef765afc6a1b380fd85d6682f4b266f76a924 (plain)
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
#!/usr/bin/perl
 
my %include = ();
 
for my $text (<git-*.txt>) {
    open I, '<', $text || die "cannot read: $text";
    (my $base = $text) =~ s/\.txt$//;
    while (<I>) {
	if (/^include::/) {
	    chomp;
	    s/^include::\s*//;
	    s/\[\]//;
	    $include{$base}{$_} = 1;
	}
    }
    close I;
}
 
# Do we care about chained includes???
 
while (my ($base, $included) = each %include) {
    my ($suffix) = '1';
    if ($base eq 'git') {
	$suffix = '7'; # yuck...
    }
    print "$base.html $base.$suffix : ", join(" ", keys %$included), "\n";
}