summaryrefslogtreecommitdiffstats
path: root/src/libs/installer
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/installer')
-rw-r--r--src/libs/installer/createlocalrepositoryoperation.cpp15
-rw-r--r--src/libs/installer/packagemanagercore_p.cpp3
2 files changed, 12 insertions, 6 deletions
diff --git a/src/libs/installer/createlocalrepositoryoperation.cpp b/src/libs/installer/createlocalrepositoryoperation.cpp
index 87db3a472..e74536b0c 100644
--- a/src/libs/installer/createlocalrepositoryoperation.cpp
+++ b/src/libs/installer/createlocalrepositoryoperation.cpp
@@ -153,15 +153,20 @@ bool CreateLocalRepositoryOperation::performOperation()
return false;
}
- QString repoPath;
try {
- QString binaryPath = QFileInfo(args.at(0)).absoluteFilePath();
+ const QString binaryPath = QFileInfo(args.at(0)).absoluteFilePath();
// Note the "/" at the end, important to make copy directory operation behave well
- repoPath = QFileInfo(args.at(1)).absoluteFilePath() + QLatin1String("/repository/");
+ const QString repoPath = QFileInfo(args.at(1)).absoluteFilePath() + QLatin1Char('/');
- // if we're running as installer and install into an existing target, remove possible previous repos
+ // check if this is an offline version, otherwise there will be no binary data
PackageManagerCore *core = qVariantValue<PackageManagerCore*>(value(QLatin1String("installer")));
- if (core && core->isOfflineOnly() && QFile::exists(repoPath)) {
+ if (core && !core->isOfflineOnly()) {
+ throw QInstaller::Error(tr("Installer needs to be an offline version: %1.")
+ .arg(QDir::toNativeSeparators(binaryPath)));
+ }
+
+ // if we're running as installer and install into an existing target, remove possible previous repos
+ if (QFile::exists(repoPath)) {
Static::fixPermissions(repoPath);
QInstaller::removeDirectory(repoPath);
}
diff --git a/src/libs/installer/packagemanagercore_p.cpp b/src/libs/installer/packagemanagercore_p.cpp
index 994c5bbeb..561553fb4 100644
--- a/src/libs/installer/packagemanagercore_p.cpp
+++ b/src/libs/installer/packagemanagercore_p.cpp
@@ -1420,7 +1420,8 @@ bool PackageManagerCorePrivate::runInstaller()
if (createRepo) {
createRepo->setValue(QLatin1String("uninstall-only"), true);
createRepo->setValue(QLatin1String("installer"), QVariant::fromValue(m_core));
- createRepo->setArguments(QStringList() << QCoreApplication::applicationFilePath() << target);
+ createRepo->setArguments(QStringList() << QCoreApplication::applicationFilePath()
+ << target + QLatin1String("/repository"));
connectOperationToInstaller(createRepo, progressOperationSize);