File size: 773 Bytes
864071c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#! /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)