diff options
author | Katja Marttila <katja.marttila@qt.io> | 2018-02-19 12:28:07 +0200 |
---|---|---|
committer | Katja Marttila <katja.marttila@qt.io> | 2018-02-21 07:34:23 +0000 |
commit | 0a842140f5d7cc7383c5266acbbc74428dd82014 (patch) | |
tree | 4df9330144c39a1ad84757a4acbd712bcf5151c2 | |
parent | c0b2007d2002055f92f3c7dea2e5df55bd40b2c6 (diff) |
Fix Mkdir operation in uninstall
If Mkdir generates directories to target dir, then uninstall will fail to
remove those as targetDir is replaced with @RELOCATABLE_PATH@ when the
operations are written to dat file. Fixed so that @RELOCATABLE_PATH@ is
replaced with targetDir.
Task-number: QTIFW-1099
Change-Id: I52a0330a2645e2d4a5371ce0d6f1fb296878752f
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
-rw-r--r-- | src/libs/kdtools/updateoperations.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libs/kdtools/updateoperations.cpp b/src/libs/kdtools/updateoperations.cpp index 1620a36c4..856431f84 100644 --- a/src/libs/kdtools/updateoperations.cpp +++ b/src/libs/kdtools/updateoperations.cpp @@ -29,6 +29,8 @@ #include "updateoperations.h" #include "errors.h" #include "fileutils.h" +#include "constants.h" +#include "packagemanagercore.h" #include <QDir> #include <QFile> @@ -462,6 +464,11 @@ bool MkdirOperation::undoOperation() Q_ASSERT(arguments().count() == 1); QString createdDirValue = value(QLatin1String("createddir")).toString(); + if (packageManager()) { + createdDirValue = QInstaller::replacePath(createdDirValue, + QLatin1String(QInstaller::scRelocatable), packageManager()->value(QInstaller::scTargetDir)); + } + if (createdDirValue.isEmpty()) createdDirValue = arguments().first(); QDir createdDir = QDir(createdDirValue); |