Update release notes to include cherry header
[ric-plt/lib/rmr.git] / doc / src / rtd / fmt_changes.ksh
1 # vim: ts=4 noet sw=4:
2 #==================================================================================
3 #       Copyright (c) 2019 Nokia
4 #       Copyright (c) 2018-2019 AT&T Intellectual Property.
5 #
6 #   Licensed under the Apache License, Version 2.0 (the "License");
7 #   you may not use this file except in compliance with the License.
8 #   You may obtain a copy of the License at
9 #
10 #       http://www.apache.org/licenses/LICENSE-2.0
11 #
12 #   Unless required by applicable law or agreed to in writing, software
13 #   distributed under the License is distributed on an "AS IS" BASIS,
14 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 #   See the License for the specific language governing permissions and
16 #   limitations under the License.
17 #==================================================================================
18
19 #       Mnemonic:       fmt_changes.ksh
20 #       Abstract:       This script looks for CHANGES*.txt files at the top level
21 #                               and builds one {X}fm source file from which the release notes
22 #                               RTD file is created.
23
24 cat <<endKat
25
26 .** ------------------------------------------------------------------------
27 .** CAUTION: This .xfm file is automatically generated by fmt_changes.ksh
28 .**          do NOT edit. Use 'make rel-notes.xfm' to regenerate.
29 .** ------------------------------------------------------------------------
30
31 .dv GEN_TITLE 1
32 .dv doc_title RMR Release Notes
33 .im setup.im
34 .dh 1 u=off
35
36 &h1(RMR Release Notes)
37 The following is a list of release highlights for the RMR library.
38 At one point in time the RMR repo also housed a wrapper library with a
39 separate version and release cycle.
40 This resulted in &ital(leap frogging) versions for each package; the
41 RMR core library was assigned odd major numbers (e.g. 3.1.0).
42 When the wrapper code was moved to a different repo the need to leap frog
43 versions ceased, and beginning with version 4.0.0, the RMR versions should
44 no longer skip.
45
46 endKat
47
48 for x in ../../../CHANGES*.txt
49 do
50         awk '
51                 /^#/ { next }           # ditch all comments
52
53                 # tag project releases by matching release tag associated
54                 /4\.4\.6$/  { printf( "&h1(Cherry Release)\n" ); rheader = 1 }
55                 /4\.0\.5$/  { printf( "&h1(Bronze Release)\n" ); rheader = 1 }
56                 /1\.11\.1$/ { printf( "&h1(Amber Release)\n" ); rheader = 1 }
57
58                 print_raw && /^\t\t/ {                  # anything indented should be unformatted
59                         gsub( "^\t\t", "    ", $0 )
60                         if( ! format_off ) {
61                                 format_off = 1
62                                 printf( ".nf\n" )
63                         }
64                 }
65
66                 print_raw && /^$/ {                             # include blank lines after first real stuff
67                         if( format_off ) {
68                                 format_off = 0
69                                 printf( ".fo\n" );
70                         }
71                         printf( "&space\n\n" );
72                         next
73                 }
74
75                 $1 + 0 >= 2019 {
76                         print_raw = 1                           # safe to print blank lines
77                         printf( "&h2(%s)\n", $0 )
78                         next
79                 }
80
81                 print_raw { print }
82         ' $x
83 done