mirror of
https://github.com/PCRE2Project/pcre2.git
synced 2025-10-19 02:16:30 +08:00

The workflow shall be: * When the release number is bumped, all references to that release number need to be bumped immediately. (For example, when the source code moves from 10.45 → 10.46, the man pages must do so as well.) * When documentation is updated, there's no need to update the "last modified" dates by hand. We can sweep those all up during the release process. Or update them immediately - there's no harm in it; we simply aren't obliged to.
30 lines
773 B
Python
Executable File
30 lines
773 B
Python
Executable File
#! /usr/bin/env python3
|
|
|
|
# Script to update all the hardcoded release numbers in the source tree.
|
|
# - Documentation manpages.
|
|
# - Bazel MODULE file.
|
|
|
|
# This script should be run in the main PCRE2 directory.
|
|
|
|
import glob
|
|
|
|
from UpdateCommon import update_file, CURRENT_RELEASE
|
|
|
|
def update_man_version(filename):
|
|
print(' Updating %s' % filename)
|
|
update_file(filename, r'(.TH.*? )"PCRE2 .*?"', '\\1"PCRE2 %s"' % CURRENT_RELEASE)
|
|
|
|
print('Updating man pages')
|
|
|
|
# doc/*.1
|
|
for filename in glob.glob('doc/*.1'):
|
|
update_man_version(filename)
|
|
|
|
# doc/*.3
|
|
for filename in glob.glob('doc/*.3'):
|
|
update_man_version(filename)
|
|
|
|
# MODULE.bazel
|
|
print('Updating MODULE.bazel')
|
|
update_file('MODULE.bazel', r'(?m)^ version = ".*?"', ' version = "%s"' % CURRENT_RELEASE)
|