From bab0b0cbcc61c3ae37463928716d2ac68dff9a67 Mon Sep 17 00:00:00 2001 From: David Neto Date: Wed, 21 Jan 2026 17:36:28 -0500 Subject: [PATCH] CHANGES file must have a valid version and date It must appear on the third line. This will prevent accidentally dropping the date. The missing dates have been messing up the version number generation for pkg-config processing. See #1529 --- utils/update_build_version.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/utils/update_build_version.py b/utils/update_build_version.py index b7ce5b84e..7adcefcc8 100755 --- a/utils/update_build_version.py +++ b/utils/update_build_version.py @@ -72,14 +72,16 @@ def deduce_software_version(directory): """ # Match the first well-formed version-and-date line. + # It must be on the third line, and it must have an ISO date. # Allow trailing whitespace in the checked-out source code has # unexpected carriage returns on a linefeed-only system such as # Linux. pattern = re.compile(r'^(v\d+\.\d+(-dev|[\.-]rc\d+)?) \d\d\d\d-\d\d-\d\d\s*$') changes_file = os.path.join(directory, 'CHANGES') with open(changes_file, errors='replace') as f: - for line in f.readlines(): - match = pattern.match(line) + lines = f.readlines()[2:] + if len(lines) > 0: + match = pattern.match(lines[0]) if match: return match.group(1) raise Exception('No version number found in {}'.format(changes_file))