summaryrefslogtreecommitdiff
path: root/contrib/mklog.py
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2022-12-12 13:24:25 +0100
committerMartin Liska <mliska@suse.cz>2022-12-12 13:24:25 +0100
commit14d0f82cab37b66e2998b8d0d664711bd1e1371b (patch)
treeebdedb6cb808113d758b194f459b5cdd6da6b498 /contrib/mklog.py
parent688f4eb28186daf333f7a7f5b1bdc1df43bb6c47 (diff)
downloadgcc-14d0f82cab37b66e2998b8d0d664711bd1e1371b.tar.gz
mklog: do not parse binary file for PR entry
contrib/ChangeLog: * mklog.py: Do not search PR entry in a file that is binary.
Diffstat (limited to 'contrib/mklog.py')
-rwxr-xr-xcontrib/mklog.py34
1 files changed, 18 insertions, 16 deletions
diff --git a/contrib/mklog.py b/contrib/mklog.py
index 3a6ec681b65..358b7fc6b8b 100755
--- a/contrib/mklog.py
+++ b/contrib/mklog.py
@@ -186,23 +186,25 @@ def generate_changelog(data, no_functions=False, fill_pr_titles=False,
# contains commented code which a note that it
# has not been tested due to a certain PR or DR.
this_file_prs = []
- for line in list(file)[0][0:10]:
- m = pr_regex.search(line.value)
- if m:
- pr = m.group('pr')
- if pr not in prs:
- prs.append(pr)
- this_file_prs.append(pr.split('/')[-1])
- else:
- m = dr_regex.search(line.value)
+ if not file.is_binary_file:
+ for line in list(file)[0][0:10]:
+ m = pr_regex.search(line.value)
if m:
- dr = m.group('dr')
- if dr not in prs:
- prs.append(dr)
- this_file_prs.append(dr.split('/')[-1])
- elif dg_regex.search(line.value):
- # Found dg-warning/dg-error line
- break
+ pr = m.group('pr')
+ if pr not in prs:
+ prs.append(pr)
+ this_file_prs.append(pr.split('/')[-1])
+ else:
+ m = dr_regex.search(line.value)
+ if m:
+ dr = m.group('dr')
+ if dr not in prs:
+ prs.append(dr)
+ this_file_prs.append(dr.split('/')[-1])
+ elif dg_regex.search(line.value):
+ # Found dg-warning/dg-error line
+ break
+
# PR number in the file name
fname = os.path.basename(file.path)
m = pr_filename_regex.search(fname)