diff options
author | Eike Ziller <eike.ziller@qt.io> | 2019-05-06 12:10:38 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2019-05-06 10:59:06 +0000 |
commit | 2bfa47c01b20710cac699bd749a498ac8c9faea6 (patch) | |
tree | bfada06c8dc367bc8381b3878c81242bcdea0efe | |
parent | cf86c3e36fff40fff09bacecbd4310baa5757ea2 (diff) |
Qt Creator: Fix "No such file or directory: '/..../qtcreator_ide_branding.pri'"
For Qt Creator 4.9
Change-Id: I0d07fb0c7ff191b75d158ff31e9abd3123f7eb2e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
-rw-r--r-- | packaging-tools/build_wrapper.py | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/packaging-tools/build_wrapper.py b/packaging-tools/build_wrapper.py index 6a081e1bc..554fab4bf 100644 --- a/packaging-tools/build_wrapper.py +++ b/packaging-tools/build_wrapper.py @@ -534,15 +534,18 @@ def build_qtcreator_plugins(plugins, qtcreator_path, qtcreator_dev_path, icu_url def get_qtcreator_version(path_to_qtcreator_src, optionDict): expr = re.compile(r'\s*QTCREATOR_DISPLAY_VERSION\s*=\s*([^\s]+)') - possible_version_locations = [optionDict.get('IDE_BRANDING_PRI'), # optional - os.path.join(path_to_qtcreator_src, 'qtcreator_ide_branding.pri'), # used since QtCreator 4.10 - os.path.join(path_to_qtcreator_src, 'qtcreator.pri')]# old path till 4.9, can be removed in the future - for path in [p for p in possible_version_locations if p]: - with open(path, 'r') as f: - for line in f: - match = expr.match(line) - if match: - return match.group(1) + + default_version_locations = [os.path.join(path_to_qtcreator_src, 'qtcreator_ide_branding.pri'), # used since QtCreator 4.10 + os.path.join(path_to_qtcreator_src, 'qtcreator.pri')] # old path till 4.9, can be removed in the future + default_version_location = next(p for p in default_version_locations if os.path.exists(p)) + branding_version_location = optionDict.get('IDE_BRANDING_PRI'), # optional + version_location = branding_version_location if branding_version_location else default_version_location + + with open(version_location, 'r') as f: + for line in f: + match = expr.match(line) + if match: + return match.group(1) return None def make_QtcPlugin_from_json(plugin_json): |