annotate contrib/mklog.py @ 19:2b5abeee2509 default tip

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
19
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
1 #!/usr/bin/env python3
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
2
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
3 # Copyright (C) 2020 Free Software Foundation, Inc.
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
4 #
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
5 # This file is part of GCC.
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
6 #
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
7 # GCC is free software; you can redistribute it and/or modify
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
8 # it under the terms of the GNU General Public License as published by
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
9 # the Free Software Foundation; either version 3, or (at your option)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
10 # any later version.
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
11 #
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
12 # GCC is distributed in the hope that it will be useful,
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
15 # GNU General Public License for more details.
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
16 #
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
17 # You should have received a copy of the GNU General Public License
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
18 # along with GCC; see the file COPYING. If not, write to
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
19 # the Free Software Foundation, 51 Franklin Street, Fifth Floor,
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
20 # Boston, MA 02110-1301, USA.
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
21
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
22 # This script parses a .diff file generated with 'diff -up' or 'diff -cp'
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
23 # and adds a skeleton ChangeLog file to the file. It does not try to be
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
24 # too smart when parsing function names, but it produces a reasonable
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
25 # approximation.
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
26 #
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
27 # Author: Martin Liska <mliska@suse.cz>
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
28
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
29 import argparse
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
30 import os
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
31 import re
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
32 import sys
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
33
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
34 import requests
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
35
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
36 from unidiff import PatchSet
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
37
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
38 pr_regex = re.compile(r'(\/(\/|\*)|[Cc*!])\s+(?P<pr>PR [a-z+-]+\/[0-9]+)')
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
39 dr_regex = re.compile(r'(\/(\/|\*)|[Cc*!])\s+(?P<dr>DR [0-9]+)')
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
40 identifier_regex = re.compile(r'^([a-zA-Z0-9_#].*)')
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
41 comment_regex = re.compile(r'^\/\*')
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
42 struct_regex = re.compile(r'^(class|struct|union|enum)\s+'
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
43 r'(GTY\(.*\)\s+)?([a-zA-Z0-9_]+)')
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
44 macro_regex = re.compile(r'#\s*(define|undef)\s+([a-zA-Z0-9_]+)')
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
45 super_macro_regex = re.compile(r'^DEF[A-Z0-9_]+\s*\(([a-zA-Z0-9_]+)')
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
46 fn_regex = re.compile(r'([a-zA-Z_][^()\s]*)\s*\([^*]')
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
47 template_and_param_regex = re.compile(r'<[^<>]*>')
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
48 bugzilla_url = 'https://gcc.gnu.org/bugzilla/rest.cgi/bug?id=%s&' \
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
49 'include_fields=summary'
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
50
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
51 function_extensions = set(['.c', '.cpp', '.C', '.cc', '.h', '.inc', '.def'])
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
52
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
53 help_message = """\
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
54 Generate ChangeLog template for PATCH.
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
55 PATCH must be generated using diff(1)'s -up or -cp options
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
56 (or their equivalent in git).
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
57 """
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
58
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
59 script_folder = os.path.realpath(__file__)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
60 gcc_root = os.path.dirname(os.path.dirname(script_folder))
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
61
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
62
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
63 def find_changelog(path):
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
64 folder = os.path.split(path)[0]
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
65 while True:
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
66 if os.path.exists(os.path.join(gcc_root, folder, 'ChangeLog')):
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
67 return folder
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
68 folder = os.path.dirname(folder)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
69 if folder == '':
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
70 return folder
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
71 raise AssertionError()
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
72
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
73
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
74 def extract_function_name(line):
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
75 if comment_regex.match(line):
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
76 return None
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
77 m = struct_regex.search(line)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
78 if m:
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
79 # Struct declaration
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
80 return m.group(1) + ' ' + m.group(3)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
81 m = macro_regex.search(line)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
82 if m:
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
83 # Macro definition
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
84 return m.group(2)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
85 m = super_macro_regex.search(line)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
86 if m:
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
87 # Supermacro
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
88 return m.group(1)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
89 m = fn_regex.search(line)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
90 if m:
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
91 # Discard template and function parameters.
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
92 fn = m.group(1)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
93 fn = re.sub(template_and_param_regex, '', fn)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
94 return fn.rstrip()
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
95 return None
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
96
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
97
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
98 def try_add_function(functions, line):
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
99 fn = extract_function_name(line)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
100 if fn and fn not in functions:
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
101 functions.append(fn)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
102 return bool(fn)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
103
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
104
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
105 def sort_changelog_files(changed_file):
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
106 return (changed_file.is_added_file, changed_file.is_removed_file)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
107
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
108
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
109 def get_pr_titles(prs):
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
110 output = ''
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
111 for pr in prs:
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
112 id = pr.split('/')[-1]
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
113 r = requests.get(bugzilla_url % id)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
114 bugs = r.json()['bugs']
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
115 if len(bugs) == 1:
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
116 output += '%s - %s\n' % (pr, bugs[0]['summary'])
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
117 print(output)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
118 if output:
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
119 output += '\n'
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
120 return output
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
121
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
122
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
123 def generate_changelog(data, no_functions=False, fill_pr_titles=False):
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
124 changelogs = {}
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
125 changelog_list = []
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
126 prs = []
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
127 out = ''
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
128 diff = PatchSet(data)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
129
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
130 for file in diff:
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
131 changelog = find_changelog(file.path)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
132 if changelog not in changelogs:
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
133 changelogs[changelog] = []
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
134 changelog_list.append(changelog)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
135 changelogs[changelog].append(file)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
136
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
137 # Extract PR entries from newly added tests
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
138 if 'testsuite' in file.path and file.is_added_file:
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
139 for line in list(file)[0]:
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
140 m = pr_regex.search(line.value)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
141 if m:
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
142 pr = m.group('pr')
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
143 if pr not in prs:
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
144 prs.append(pr)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
145 else:
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
146 m = dr_regex.search(line.value)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
147 if m:
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
148 dr = m.group('dr')
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
149 if dr not in prs:
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
150 prs.append(dr)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
151 else:
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
152 break
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
153
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
154 if fill_pr_titles:
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
155 out += get_pr_titles(prs)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
156
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
157 # sort ChangeLog so that 'testsuite' is at the end
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
158 for changelog in sorted(changelog_list, key=lambda x: 'testsuite' in x):
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
159 files = changelogs[changelog]
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
160 out += '%s:\n' % os.path.join(changelog, 'ChangeLog')
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
161 out += '\n'
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
162 for pr in prs:
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
163 out += '\t%s\n' % pr
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
164 # new and deleted files should be at the end
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
165 for file in sorted(files, key=sort_changelog_files):
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
166 assert file.path.startswith(changelog)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
167 in_tests = 'testsuite' in changelog or 'testsuite' in file.path
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
168 relative_path = file.path[len(changelog):].lstrip('/')
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
169 functions = []
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
170 if file.is_added_file:
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
171 msg = 'New test' if in_tests else 'New file'
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
172 out += '\t* %s: %s.\n' % (relative_path, msg)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
173 elif file.is_removed_file:
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
174 out += '\t* %s: Removed.\n' % (relative_path)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
175 else:
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
176 if not no_functions:
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
177 for hunk in file:
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
178 # Do not add function names for testsuite files
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
179 extension = os.path.splitext(relative_path)[1]
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
180 if not in_tests and extension in function_extensions:
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
181 last_fn = None
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
182 modified_visited = False
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
183 success = False
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
184 for line in hunk:
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
185 m = identifier_regex.match(line.value)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
186 if line.is_added or line.is_removed:
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
187 if not line.value.strip():
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
188 continue
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
189 modified_visited = True
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
190 if m and try_add_function(functions,
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
191 m.group(1)):
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
192 last_fn = None
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
193 success = True
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
194 elif line.is_context:
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
195 if last_fn and modified_visited:
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
196 try_add_function(functions, last_fn)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
197 last_fn = None
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
198 modified_visited = False
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
199 success = True
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
200 elif m:
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
201 last_fn = m.group(1)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
202 modified_visited = False
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
203 if not success:
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
204 try_add_function(functions,
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
205 hunk.section_header)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
206 if functions:
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
207 out += '\t* %s (%s):\n' % (relative_path, functions[0])
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
208 for fn in functions[1:]:
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
209 out += '\t(%s):\n' % fn
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
210 else:
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
211 out += '\t* %s:\n' % relative_path
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
212 out += '\n'
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
213 return out
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
214
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
215
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
216 if __name__ == '__main__':
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
217 parser = argparse.ArgumentParser(description=help_message)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
218 parser.add_argument('input', nargs='?',
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
219 help='Patch file (or missing, read standard input)')
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
220 parser.add_argument('-s', '--no-functions', action='store_true',
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
221 help='Do not generate function names in ChangeLogs')
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
222 parser.add_argument('-p', '--fill-up-bug-titles', action='store_true',
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
223 help='Download title of mentioned PRs')
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
224 args = parser.parse_args()
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
225 if args.input == '-':
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
226 args.input = None
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
227
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
228 input = open(args.input) if args.input else sys.stdin
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
229 data = input.read()
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
230 output = generate_changelog(data, args.no_functions,
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
231 args.fill_up_bug_titles)
2b5abeee2509 update gcc11
anatofuz
parents:
diff changeset
232 print(output, end='')