summaryrefslogtreecommitdiffstats
path: root/mantools/make-relnotes
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 01:46:30 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 01:46:30 +0000
commitb5896ba9f6047e7031e2bdee0622d543e11a6734 (patch)
treefd7b460593a2fee1be579bec5697e6d887ea3421 /mantools/make-relnotes
parentInitial commit. (diff)
downloadpostfix-b5896ba9f6047e7031e2bdee0622d543e11a6734.tar.xz
postfix-b5896ba9f6047e7031e2bdee0622d543e11a6734.zip
Adding upstream version 3.4.23.upstream/3.4.23upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mantools/make-relnotes')
-rwxr-xr-xmantools/make-relnotes85
1 files changed, 85 insertions, 0 deletions
diff --git a/mantools/make-relnotes b/mantools/make-relnotes
new file mode 100755
index 0000000..f5d26f3
--- /dev/null
+++ b/mantools/make-relnotes
@@ -0,0 +1,85 @@
+#!/usr/bin/perl
+
+# Transform RELEASE_NOTES, split into "leader", and "major changes",
+# split into major categories, and prepend dates to paragraphs.
+#
+# Input format: the leader text is copied verbatim; each section
+# starts with "Incompatible changes with snapshot YYYYMMDD" or "Major
+# changes with snapshot YYYYMMDD"; each paragraph starts with [class,
+# class] where a class specifies one or more categories that the
+# change should be listed under. Adding class info is the only manual
+# processing needed to go from a RELEASE_NOTES file to the transformed
+# representation.
+#
+# Output format: each category is printed with a little header and
+# each paragraph is tagged with [Incompat yyyymmdd] or with [Feature
+# yyyymmdd].
+
+%leader = (); %body = ();
+$append_to = \%leader;
+
+while (<>) {
+
+ if (/^(Incompatible changes|Incompatibility) with/) {
+ die "No date found: $_" unless /(\d\d\d\d\d\d\d\d)/;
+ $append_to = \%body;
+ $prefix = "[Incompat $1] ";
+ while (<>) {
+ last if /^====/;
+ }
+ next;
+ }
+
+ if (/^Major changes with/) {
+ die "No date found: $_" unless /(\d\d\d\d\d\d\d\d)/;
+ $append_to = \%body;
+ $prefix = "[Feature $1] ";
+ while (<>) {
+ last if /^====/;
+ }
+ next;
+ }
+
+ if (/^\s*\n/) {
+ if ($paragraph) {
+ for $class (@classes) {
+ ${$append_to}{$class} .= $paragraph . $_;
+ }
+ $paragraph = "";
+ }
+ } else {
+ if ($paragraph eq "") {
+ if ($append_to eq \%leader) {
+ @classes = ("default");
+ $paragraph = $_;
+ } elsif (/^\[([^]]+)\]\s*(.*)/s) {
+ $paragraph = $prefix . $2;
+ ($junk = $1) =~ s/\s*,\s*/,/g;
+ $junk =~ s/^\s+//;
+ $junk =~ s/\s+$//;
+ #print "junk >$junk<\n";
+ @classes = split(/,+/, $junk);
+ #print "[", join(', ', @classes), "] ", $paragraph;
+ } else {
+ $paragraph = $_;
+ }
+ } else {
+ $paragraph .= $_;
+ }
+ }
+}
+
+if ($paragraph) {
+ for $class (@classes) {
+ ${$append_to}{$class} .= $prefix . $paragraph . $_;
+ }
+}
+
+print $leader{"default"};
+
+for $class (sort keys %body) {
+ print "Major changes - $class\n";
+ ($junk = "Major changes - $class") =~ s/./-/g;
+ print $junk, "\n\n";
+ print $body{$class};
+}