summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/createlocalrepositoryoperation.cpp
diff options
context:
space:
mode:
authorKatja Marttila <katja.marttila@qt.io>2019-08-23 11:05:07 +0300
committerKatja Marttila <katja.marttila@qt.io>2019-08-23 11:05:07 +0300
commit516492370b95e9c07cad4080ef713d5b2b3f2f94 (patch)
treec094d82a3cebf3aaff4182ae7824c3efbce6d3a3 /src/libs/installer/createlocalrepositoryoperation.cpp
parent3b310a3ec13a743ae2258bc43d92a5df42c6ad37 (diff)
parent8f7af86198935849c74c71add7c9ca081347fb85 (diff)
Merge remote-tracking branch 'origin/3.1' into master
Diffstat (limited to 'src/libs/installer/createlocalrepositoryoperation.cpp')
-rw-r--r--src/libs/installer/createlocalrepositoryoperation.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/libs/installer/createlocalrepositoryoperation.cpp b/src/libs/installer/createlocalrepositoryoperation.cpp
index a2f7806a3..0eabc8c35 100644
--- a/src/libs/installer/createlocalrepositoryoperation.cpp
+++ b/src/libs/installer/createlocalrepositoryoperation.cpp
@@ -38,6 +38,7 @@
#include "lib7z_facade.h"
#include "packagemanagercore.h"
#include "productkeycheck.h"
+#include "constants.h"
#include "updateoperations.h"
@@ -183,6 +184,23 @@ bool CreateLocalRepositoryOperation::performOperation()
}
setValue(QLatin1String("createddir"), mkDirOp.value(QLatin1String("createddir")));
+#if QT_VERSION >= QT_VERSION_CHECK(5,10,0)
+ // Internal changes to QTemporaryFile break copying Qt resources through
+ // QInstaller::RemoteFileEngine. We do not register resources to be handled by
+ // RemoteFileEngine, instead copying using 5.9 succeeded because QFile::copy()
+ // creates a QTemporaryFile object internally that is handled by the remote engine.
+ //
+ // This will not work with Qt 5.10 and above as QTemporaryFile introduced a new
+ // rename() implementation that explicitly uses its own QTemporaryFileEngine.
+ //
+ // Fail and return early if we are working on an elevated permission directory.
+ if (core && !core->directoryWritable(repoPath)) {
+ setError(UserDefinedError);
+ setErrorString(tr("Creating local repository into elevated permissions "
+ "directory: %1 is not supported.").arg(repoPath));
+ return false;
+ }
+#endif
// copy the whole meta data into local repository
CopyDirectoryOperation copyDirOp(core);
copyDirOp.setArguments(QStringList() << QLatin1String(":/metadata/") << repoPath);