chiark / gitweb /
Update preferred contact method for the security team.
[developers-reference.git] / debian / tocsubstvars
1 #!/usr/bin/perl -w
2
3 use strict;
4 use Debian::Debhelper::Dh_Lib;
5
6 init();
7
8 sub gettoc {
9     my $f = shift;
10     my @toc;
11
12     open(FILE, "<$f") || die("opening $f: $!\n");
13     while (<FILE>) {
14         chomp;
15         /^\d+\.\s/ && push(@toc, $_);
16     }
17     close(FILE) || die("closing $f: $!\n");
18     return @toc;
19 }
20
21 my @entoc = gettoc("developers-reference.txt");
22
23 # sanity test
24 if ( $#entoc == -1 ) {
25     error("found no entries in the TOC, aborting");
26 } elsif ( $#entoc < 4 ) {
27     error("only found " . $#entoc . " entries in the TOC, aborting");
28 }
29 verbose_print("found " . $#entoc . " entries in TOC");
30
31 my $entoc = "   " . join('${Newline}   ', @entoc);
32
33 foreach my $package (@{$dh{DOPACKAGES}}) {
34     addsubstvar($package, "TOC:en", $entoc);
35 }
36
37