From 4c538bc5df0fed0c23e86825fdfbea27fb352883 Mon Sep 17 00:00:00 2001 From: Patrik Teivonen Date: Mon, 9 Jan 2023 15:47:55 +0200 Subject: 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 --- packaging-tools/create_installer.py | 3 +++ 1 file changed, 3 insertions(+) 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 -- cgit v1.2.3