3
# Transform RELEASE_NOTES, split into "leader", and "major changes",
4
# split into major categories, and prepend dates to paragraphs.
6
# Input format: the leader text is copied verbatim; each paragraph
7
# starts with [class, class] where a class specifies one or more
8
# categories that the change should be listed under.
10
# Output format: each category is printed with a little header and
11
# each paragraph is tagged with [Incompat yyyymmdd] or with [Feature
14
%leader = (); %body = ();
15
$append_to = \%leader;
19
if (/^Incompatible changes with/) {
20
die "No date found: $_" unless /(\d\d\d\d\d\d\d\d)/;
22
$prefix = "[Incompat $1] ";
29
if (/^Major changes with/) {
30
die "No date found: $_" unless /(\d\d\d\d\d\d\d\d)/;
32
$prefix = "[Feature $1] ";
41
for $class (@classes) {
42
${$append_to}{$class} .= $prefix . $paragraph . $_;
47
if ($paragraph eq "") {
48
if ($append_to eq \%leader) {
49
@classes = ("default");
52
die "No [class] at start of paragraph: $_"
53
unless /^\[([^]]+)\]\s*(.*)/s;
55
($junk = $1) =~ s/\s*,\s*/,/g;
58
#print "junk >$junk<\n";
59
@classes = split(/,+/, $junk);
60
#print "[", join(', ', @classes), "] ", $paragraph;
69
for $class (@classes) {
70
${$append_to}{$class} .= $prefix . $paragraph . $_;
74
print $leader{"default"};
76
for $class (sort keys %body) {
77
print "Major changes - $class\n";
78
print "----------------------\n\n";