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. Adding class
9 # info is the only manual processing needed to go from a RELEASE_NOTES
10 # file to the transformed representation.
12 # Output format: each category is printed with a little header and
13 # each paragraph is tagged with [Incompat yyyymmdd] or with [Feature
16 %leader = (); %body = ();
17 $append_to = \
%leader;
21 if (/^Incompatible changes with/) {
22 die "No date found: $_" unless /(\d\d\d\d\d\d\d\d)/;
24 $prefix = "[Incompat $1] ";
31 if (/^Major changes with/) {
32 die "No date found: $_" unless /(\d\d\d\d\d\d\d\d)/;
34 $prefix = "[Feature $1] ";
43 for $class (@classes) {
44 ${$append_to}{$class} .= $paragraph . $_;
49 if ($paragraph eq "") {
50 if ($append_to eq \
%leader) {
51 @classes = ("default");
53 } elsif (/^\[([^]]+)\]\s*(.*)/s) {
54 $paragraph = $prefix . $2;
55 ($junk = $1) =~ s/\s*,\s*/,/g;
58 #print "junk >$junk<\n";
59 @classes = split(/,+/, $junk);
60 #print "[", join(', ', @classes), "] ", $paragraph;
71 for $class (@classes) {
72 ${$append_to}{$class} .= $prefix . $paragraph . $_;
76 print $leader{"default"};
78 for $class (sort keys %body) {
79 print "Major changes - $class\n";
80 ($junk = "Major changes - $class") =~ s/./-/g;