From 3324152db41b5c422368fad701a98c09f9c49d14 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sat, 30 Dec 2023 06:53:20 -0800 Subject: [PATCH] Update the release script --- support/manage.py | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/support/manage.py b/support/manage.py index 36f61d9b517c..408d10620819 100755 --- a/support/manage.py +++ b/support/manage.py @@ -229,12 +229,17 @@ def release(args): if not fmt_repo.update('-b', branch, fmt_repo_url): clean_checkout(fmt_repo, branch) - # Convert changelog from RST to GitHub-flavored Markdown and get the - # version. + # Update the date in the changelog. changelog = 'ChangeLog.md' changelog_path = os.path.join(fmt_repo.dir, changelog) - import rst2md - changes, version = rst2md.convert(changelog_path) + title_len = 0 + for line in fileinput.input(changelog_path, inplace=True): + m = re.match(r'# (.*) - TBD', line) + if m: + version = m.group(1) + line = version + ' - ' + datetime.date.today().isoformat() + '\n' + sys.stdout.write(line) + cmakelists = 'CMakeLists.txt' for line in fileinput.input(os.path.join(fmt_repo.dir, cmakelists), inplace=True): @@ -243,18 +248,6 @@ def release(args): line = prefix + version + ')\n' sys.stdout.write(line) - # Update the version in the changelog. - title_len = 0 - for line in fileinput.input(changelog_path, inplace=True): - if line.startswith(version + ' - TBD'): - line = version + ' - ' + datetime.date.today().isoformat() - title_len = len(line) - line += '\n' - elif title_len: - line = '-' * title_len + '\n' - title_len = 0 - sys.stdout.write(line) - # Add the version to the build script. script = os.path.join('doc', 'build.py') script_path = os.path.join(fmt_repo.dir, script)