aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorThomas Schwinge <tschwinge@baylibre.com>2024-03-10 23:54:17 +0100
committerThomas Schwinge <tschwinge@baylibre.com>2024-03-10 23:54:17 +0100
commitd0bf4b8fcb3e9b39d376f34c7f97591a9462ce63 (patch)
tree2814bcffa42ce91190aa2d465c2d5084bd41b136 /contrib
parent9267ffafb35e8dc3e68f58c6e137c8aad824d9ef (diff)
parent432c6f05b00702303730b212c14f364b263ba4b1 (diff)
downloadgcc-d0bf4b8fcb3e9b39d376f34c7f97591a9462ce63.zip
gcc-d0bf4b8fcb3e9b39d376f34c7f97591a9462ce63.tar.gz
gcc-d0bf4b8fcb3e9b39d376f34c7f97591a9462ce63.tar.bz2
Merge commit '126f707efbb5184178701cbdc753a10fd831374e^' into HEAD
Diffstat (limited to 'contrib')
-rw-r--r--contrib/ChangeLog9
-rwxr-xr-xcontrib/gcc-changelog/git_update_version.py2
-rwxr-xr-xcontrib/mklog.py27
3 files changed, 36 insertions, 2 deletions
diff --git a/contrib/ChangeLog b/contrib/ChangeLog
index 92af01d..0baf78d 100644
--- a/contrib/ChangeLog
+++ b/contrib/ChangeLog
@@ -1,3 +1,12 @@
+2023-07-13 Lehua Ding <lehua.ding@rivai.ai>
+
+ * mklog.py: Add --append option.
+
+2023-07-07 Richard Biener <rguenther@suse.de>
+
+ * gcc-changelog/git_update_version.py: Remove GCC 10 from
+ active_refs.
+
2023-06-22 David Malcolm <dmalcolm@redhat.com>
* unicode/gen-box-drawing-chars.py: New file.
diff --git a/contrib/gcc-changelog/git_update_version.py b/contrib/gcc-changelog/git_update_version.py
index df16797..3c438bb 100755
--- a/contrib/gcc-changelog/git_update_version.py
+++ b/contrib/gcc-changelog/git_update_version.py
@@ -74,7 +74,7 @@ def prepend_to_changelog_files(repo, folder, git_commit, add_to_git):
repo.git.add(full_path)
-active_refs = ['master', 'releases/gcc-10',
+active_refs = ['master',
'releases/gcc-11', 'releases/gcc-12', 'releases/gcc-13']
parser = argparse.ArgumentParser(description='Update DATESTAMP and generate '
diff --git a/contrib/mklog.py b/contrib/mklog.py
index 9ab59b6..4967808 100755
--- a/contrib/mklog.py
+++ b/contrib/mklog.py
@@ -382,6 +382,8 @@ if __name__ == '__main__':
'file')
parser.add_argument('--update-copyright', action='store_true',
help='Update copyright in ChangeLog files')
+ parser.add_argument('-a', '--append', action='store_true',
+ help='Append the generate ChangeLog to the patch file')
args = parser.parse_args()
if args.input == '-':
args.input = None
@@ -394,7 +396,30 @@ if __name__ == '__main__':
else:
output = generate_changelog(data, args.no_functions,
args.fill_up_bug_titles, args.pr_numbers)
- if args.changelog:
+ if args.append:
+ if (not args.input):
+ raise Exception("`-a or --append` option not support standard input")
+ lines = []
+ with open(args.input, 'r', newline='\n') as f:
+ # 1 -> not find the possible start of diff log
+ # 2 -> find the possible start of diff log
+ # 3 -> finish add ChangeLog to the patch file
+ maybe_diff_log = 1
+ for line in f:
+ if maybe_diff_log == 1 and line == "---\n":
+ maybe_diff_log = 2
+ elif maybe_diff_log == 2 and \
+ re.match("\s[^\s]+\s+\|\s\d+\s[+\-]+\n", line):
+ lines += [output, "---\n", line]
+ maybe_diff_log = 3
+ else:
+ # the possible start is not the true start.
+ if maybe_diff_log == 2:
+ maybe_diff_log = 1
+ lines.append(line)
+ with open(args.input, "w") as f:
+ f.writelines(lines)
+ elif args.changelog:
lines = open(args.changelog).read().split('\n')
start = list(takewhile(skip_line_in_changelog, lines))
end = lines[len(start):]