From f16cd6ec38851feeb4982b2588388ff975e28fcf Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 2 May 2009 20:18:21 +0000 Subject: Split the release notes into a separate file for each (active) major branch, as per my recent proposal. release.sgml itself is now just a stub that should change rarely; ideally, only once per major release to add a new include line. Most editing work will occur in the release-N.N.sgml files. To update a back branch for a minor release, just copy the appropriate release-N.N.sgml file(s) into the back branch. This commit doesn't change the end-product documentation at all, only the source layout. However, it makes it easy to start omitting ancient information from newer branches' documentation, should we ever decide to do that. --- doc/src/sgml/generate_history.pl | 58 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 doc/src/sgml/generate_history.pl (limited to 'doc/src/sgml/generate_history.pl') diff --git a/doc/src/sgml/generate_history.pl b/doc/src/sgml/generate_history.pl new file mode 100644 index 00000000000..6fa7c791d12 --- /dev/null +++ b/doc/src/sgml/generate_history.pl @@ -0,0 +1,58 @@ +#! /usr/bin/perl -w + +# generate_history.pl -- flatten release notes for use as HISTORY file +# +# Usage: generate_history.pl srcdir release.sgml >output.sgml +# +# The main point of this script is to strip out references, which +# generally point into the rest of the documentation and so can't be used +# in a standalone build of the release notes. To make sure this is done +# everywhere, we have to fold in the sub-files of the release notes. +# +# $PostgreSQL: pgsql/doc/src/sgml/generate_history.pl,v 1.1.10.1 2009/05/02 20:18:21 tgl Exp $ + +use strict; + +my($srcdir) = shift; +defined($srcdir) || die "$0: missing required argument: srcdir\n"; +my($infile) = shift; +defined($infile) || die "$0: missing required argument: inputfile\n"; + +# Emit DOCTYPE header so that the output is a self-contained SGML document +print "\n"; + +process_file($infile); + +exit 0; + +sub process_file { + my($filename) = @_; + + local *FILE; # need a local filehandle so we can recurse + + my($f) = $srcdir . '/' . $filename; + open(FILE, $f) || die "could not read $f: $!\n"; + + while () { + # Recursively expand sub-files of the release notes + if (m/^&(release-.*);$/) { + process_file($1 . ".sgml"); + next; + } + + # Remove tags, which might span multiple lines + while (m/]*>//) { + next; + } + # incomplete tag, so slurp another line + $_ .= ; + } + + # Remove too + s|||g; + + print; + } + close(FILE); +} -- cgit v1.2.3