aboutsummaryrefslogtreecommitdiffstats
path: root/packaging-tools/create_installer.py
diff options
context:
space:
mode:
authorPatrik Teivonen <patrik.teivonen@qt.io>2023-01-09 15:47:55 +0200
committerPatrik Teivonen <patrik.teivonen@qt.io>2023-01-10 08:23:42 +0000
commit4c538bc5df0fed0c23e86825fdfbea27fb352883 (patch)
treebce3ffaa0db684395b23c6ea0c3b58a486b5dd5b /packaging-tools/create_installer.py
parent247822c72adcfe3099152ffbb95ed44b85d52203 (diff)
create_installer: Fix substitutions being overridden by common substs
In release_task_reader.py:parse_data(), the common substitutions are added to the end of the list making it so that they will override any substitutions set in individual components. This behavior should be changed so that substitutions from individual components are preferred over the ones set in common.substitutions. Disallow the overriding of substitution values in create_installer.py and log a warning when attempting to do so. Fixes: QTBUG-109957 Change-Id: I096502fc7f0070efd0819f518267bd7d857f286b Reviewed-by: Antti Kokko <antti.kokko@qt.io>
Diffstat (limited to 'packaging-tools/create_installer.py')
-rw-r--r--packaging-tools/create_installer.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/packaging-tools/create_installer.py b/packaging-tools/create_installer.py
index 91297024f..59ae18f6d 100644
--- a/packaging-tools/create_installer.py
+++ b/packaging-tools/create_installer.py
@@ -1205,6 +1205,9 @@ class QtInstallerTask(Generic[QtInstallerTaskType]):
def _parse_substitutions(self) -> None:
for item in self.substitution_list: # pylint: disable=not-an-iterable
key, value = item.split("=", maxsplit=1)
+ if self.substitutions.get(key) is not None: # Do not override already present substs
+ log.warning("Duplicate substitution string given, ignoring: %s", item)
+ continue
if not value:
log.warning("Empty value for substitution string given, substituting anyway: %s", item)
self.substitutions[key] = value # pylint: disable=unsupported-assignment-operation