diff options
author | kh1 <karsten.heimrich@digia.com> | 2012-11-13 12:24:49 +0100 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@digia.com> | 2012-11-14 12:06:25 +0100 |
commit | 207cfebb778b77bc5308189d8e3a8d34019f1c72 (patch) | |
tree | 37bc8464aef62ed6b0499f90242510f5313f26b9 /src/libs/installer | |
parent | 0507fa96513a0542936644415efe4e14010b81c8 (diff) |
Implement cmd option to dump binary content into given dir.
Reuse already existing functionality, just fix the hard coded
"repository" path name. Also check if we are running offline only,
as otherwise there will be no data section.
Change-Id: Iac45d89822fceee9e527afe0dc9eb589e39e16e7
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
Diffstat (limited to 'src/libs/installer')
-rw-r--r-- | src/libs/installer/createlocalrepositoryoperation.cpp | 15 | ||||
-rw-r--r-- | src/libs/installer/packagemanagercore_p.cpp | 3 |
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); |