Fix parsing of .cmake.conf in generate_expected_output.py

It relied on the set(QT_REPO_MODULE_VERSION ...) line being the first
thing in the file. It no longer is, and the variable is referenced in
an earlier condition.

Change-Id: I2bd2abd2a5680782ddd61f4bf4a4a3265b444d52
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Edward Welbourne 2022-03-23 17:22:58 +01:00
parent 1f0063cd8d
commit a8a7f6c4e6
1 changed files with 7 additions and 3 deletions

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python3
#############################################################################
##
## Copyright (C) 2020 The Qt Company Ltd.
## Copyright (C) 2022 The Qt Company Ltd.
## Contact: https://www.qt.io/licensing/
##
## This file is part of the release tools of the Qt Toolkit.
@ -99,8 +99,12 @@ class Cleaner (object):
def _read_qt_version(qtbase_dir):
cmake_conf_file = os.path.join(qtbase_dir, '.cmake.conf')
with open(cmake_conf_file) as f:
qtver = f.readline().strip()
return qtver.split('"')[1] # set(QT_REPO_MODULE_VERSION "6.1.0")
for line in f:
# set(QT_REPO_MODULE_VERSION "6.1.0")
if 'set(QT_REPO_MODULE_VERSION' in line:
return line.strip().split('"')[1]
raise RuntimeError("Someone broke .cmake.conf formatting again")
@staticmethod
def __getPatterns(patterns = (