Fix set-verion.py script to update version.h.in file as well.

This fixes #4899 and #4502.

Signed-off-by: Vitalii Koshura <lestat.de.lionkur@gmail.com>
This commit is contained in:
Vitalii Koshura 2022-08-22 20:37:35 +02:00
parent b37f2ac23a
commit dd5043c68c
No known key found for this signature in database
GPG Key ID: CE0DB1726070A5A3
1 changed files with 14 additions and 0 deletions

View File

@ -62,6 +62,19 @@ def set_version_h(version):
line = '#define BOINC_PRERELEASE 1\n' line = '#define BOINC_PRERELEASE 1\n'
f.write(line) f.write(line)
def set_version_h_in(version):
_, minor, _ = split_version(version)
with open('version.h.in', 'r') as f:
lines = f.readlines()
with open('version.h.in', 'w') as f:
for line in lines:
if line.find('#define BOINC_PRERELEASE 1') != -1:
if is_release(minor):
line = '//#define BOINC_PRERELEASE 1\n'
else:
line = '#define BOINC_PRERELEASE 1\n'
f.write(line)
def set_version_log(version): def set_version_log(version):
with open('version.log', 'w') as f: with open('version.log', 'w') as f:
line = f'{version}\n' line = f'{version}\n'
@ -123,6 +136,7 @@ print(f'Setting BOINC version to {version}...')
set_configure_ac(version) set_configure_ac(version)
set_version_h(version) set_version_h(version)
set_version_h_in(version)
set_version_log(version) set_version_log(version)
set_build_gradle(version) set_build_gradle(version)
set_vcpkg_json(version) set_vcpkg_json(version)