Skip to content

Commit 06d9252

Browse files
committed
doc: fix build-docdep.perl
We renamed from .txt to .adoc all the asciidoc source files and necessary includes. We also need to adjust the build-docdep tool to work on files whose suffix is .adoc when computing the documentation dependencies. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 561de07 commit 06d9252

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

Documentation/build-docdep.perl

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
my %include = ();
55
my %included = ();
66

7-
for my $text (<*.txt>) {
8-
open I, '<', $text || die "cannot read: $text";
7+
for my $adoc (<*.adoc>) {
8+
open I, '<', $adoc || die "cannot read: $adoc";
99
while (<I>) {
1010
if (/^include::/) {
1111
chomp;
1212
s/^include::\s*//;
1313
s/\[\]//;
1414
s/{build_dir}/${build_dir}/;
15-
$include{$text}{$_} = 1;
15+
$include{$adoc}{$_} = 1;
1616
$included{$_} = 1;
1717
}
1818
}
@@ -23,14 +23,14 @@
2323
my $changed = 1;
2424
while ($changed) {
2525
$changed = 0;
26-
while (my ($text, $included) = each %include) {
26+
while (my ($adoc, $included) = each %include) {
2727
for my $i (keys %$included) {
28-
# $text has include::$i; if $i includes $j
29-
# $text indirectly includes $j.
28+
# $adoc has include::$i; if $i includes $j
29+
# $adoc indirectly includes $j.
3030
if (exists $include{$i}) {
3131
for my $j (keys %{$include{$i}}) {
32-
if (!exists $include{$text}{$j}) {
33-
$include{$text}{$j} = 1;
32+
if (!exists $include{$adoc}{$j}) {
33+
$include{$adoc}{$j} = 1;
3434
$included{$j} = 1;
3535
$changed = 1;
3636
}
@@ -40,10 +40,10 @@
4040
}
4141
}
4242

43-
foreach my $text (sort keys %include) {
44-
my $included = $include{$text};
45-
if (! exists $included{$text} &&
46-
(my $base = $text) =~ s/\.txt$//) {
43+
foreach my $adoc (sort keys %include) {
44+
my $included = $include{$adoc};
45+
if (! exists $included{$adoc} &&
46+
(my $base = $adoc) =~ s/\.adoc$//) {
4747
print "$base.html $base.xml : ", join(" ", sort keys %$included), "\n";
4848
}
4949
}

0 commit comments

Comments
 (0)