3 # generate_history.pl -- flatten release notes for use as HISTORY file
5 # Usage: generate_history.pl srcdir release.sgml >output.sgml
7 # The main point of this script is to strip out <link> references, which
8 # generally point into the rest of the documentation and so can't be used
9 # in a standalone build of the release notes. To make sure this is done
10 # everywhere, we have to fold in the sub-files of the release notes.
17 defined($srcdir) || die "$0: missing required argument: srcdir\n";
19 defined($infile) || die "$0: missing required argument: inputfile\n";
21 # Emit DOCTYPE header so that the output is a self-contained SGML document
22 print "<!DOCTYPE appendix PUBLIC \"-//OASIS//DTD DocBook V4.2//EN\">\n";
24 process_file
($infile);
31 local *FILE
; # need a local filehandle so we can recurse
33 my($f) = $srcdir . '/' . $filename;
34 open(FILE
, $f) || die "could not read $f: $!\n";
37 # Recursively expand sub-files of the release notes
38 if (m/^&(release-.*);$/) {
39 process_file
($1 . ".sgml");
43 # Remove <link ...> tags, which might span multiple lines
45 if (s/<link\s+linkend[^>]*>//) {
48 # incomplete tag, so slurp another line