summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Changelog9
-rw-r--r--doc/installerfw.qdoc8
-rw-r--r--doc/operations.qdoc4
-rw-r--r--src/libs/installer/component.cpp6
-rw-r--r--src/libs/installer/constants.h1
-rw-r--r--src/libs/installer/environmentvariablesoperation.cpp2
-rw-r--r--src/libs/installer/extractarchiveoperation.cpp1
-rw-r--r--src/libs/installer/globals.cpp6
-rw-r--r--src/libs/installer/globals.h2
-rw-r--r--src/libs/installer/packagemanagercore.cpp121
-rw-r--r--src/libs/installer/packagemanagercore.h4
-rw-r--r--src/libs/installer/packagemanagercore_p.cpp2
-rw-r--r--src/libs/installer/packagemanagercore_p.h1
-rw-r--r--src/libs/installer/packagemanagergui.cpp95
-rw-r--r--src/libs/installer/progresscoordinator.cpp4
-rw-r--r--src/sdk/commandlineinterface.cpp12
-rw-r--r--src/sdk/commandlineparser.cpp3
-rw-r--r--src/sdk/sdkapp.h3
-rw-r--r--tests/auto/installer/cliinterface/data/components.xml24
-rw-r--r--tests/auto/installer/cliinterface/settings.qrc1
-rw-r--r--tests/auto/installer/cliinterface/tst_cliinterface.cpp21
-rw-r--r--tools/repogen/repogen.cpp9
22 files changed, 230 insertions, 109 deletions
diff --git a/Changelog b/Changelog
index 039972215..6d1867bae 100644
--- a/Changelog
+++ b/Changelog
@@ -1,3 +1,12 @@
+3.2.2
+- Using patched Qt5.12.4 for binary builds (QTIFW-1632)
+- Add a command line argument to disable size check (QTIFW-1602)
+- Show information about updated components in repogen (QTIFW-1543)
+- Fix EnvironmentVariableOp undo behavior with non-persistent variables
+- Fix building against Qt 5.14 and newer (QTIFW-1526)
+- Fix devtool documentation
+- Fix building with msvc2013
+
3.2.1
- Documentation fixes
- Fix QWizardPage title color (QTIFW-1557)
diff --git a/doc/installerfw.qdoc b/doc/installerfw.qdoc
index d8fc44266..2edc2977b 100644
--- a/doc/installerfw.qdoc
+++ b/doc/installerfw.qdoc
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the Qt Installer Framework.
@@ -1034,15 +1034,15 @@
\li --verbose
\li Display additional information.
\row
- \li --update <file>
+ \li update <binary> <installerbase>
\li Update an existing installer or maintenance tool with a new
installer base.
\row
- \li --dump <folder>
+ \li dump <binary> <folder>
\li Dump the binary content that belongs to an installer or
maintenance tool into the target.
\row
- \li --operation <mode,name,args,...>
+ \li operation <mode,name,args,...>
\li Execute an operation with a list of arguments.
\c mode can be \c DO or \c UNDO, depending on whether the step
diff --git a/doc/operations.qdoc b/doc/operations.qdoc
index 91a3cf04a..bdc4caa2c 100644
--- a/doc/operations.qdoc
+++ b/doc/operations.qdoc
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the Qt Installer Framework.
@@ -260,7 +260,7 @@
For example, to test copying a file:
\code
- devtool --operation DO,Copy,<source>,<target>
+ devtool operation <binary> DO,Copy,<source>,<target>
\endcode
*/
diff --git a/src/libs/installer/component.cpp b/src/libs/installer/component.cpp
index 7ad68d24d..503b9434c 100644
--- a/src/libs/installer/component.cpp
+++ b/src/libs/installer/component.cpp
@@ -50,7 +50,11 @@
#include <QtUiTools/QUiLoader>
+#if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
+#include <private/qv4engine_p.h>
+#else
#include <private/qv8engine_p.h>
+#endif
#include <private/qv4scopedvalue_p.h>
#include <private/qv4object_p.h>
@@ -552,7 +556,7 @@ void Component::loadComponentScript(const QString &fileName)
}
} catch (const Error &error) {
if (packageManagerCore()->settings().allowUnstableComponents()) {
- setUnstable(Component::Component::ScriptLoadingFailed, error.message());
+ setUnstable(Component::UnstableError::ScriptLoadingFailed, error.message());
qCWarning(QInstaller::lcInstallerInstallLog) << error.message();
} else {
throw error;
diff --git a/src/libs/installer/constants.h b/src/libs/installer/constants.h
index 7fd2a0eef..ad97227dc 100644
--- a/src/libs/installer/constants.h
+++ b/src/libs/installer/constants.h
@@ -113,6 +113,7 @@ const char Updater[] = "updater";
const char ManagePackages[] = "manage-packages";
const char Uninstaller[] = "uninstaller";
const char NoForceInstallation[] = "no-force-installations";
+const char NoSizeChecking[] = "no-size-checking";
const char ShowVirtualComponents[] = "show-virtual-components";
const char LoggingRules[] = "logging-rules";
const char CreateLocalRepository[] = "create-local-repository";
diff --git a/src/libs/installer/environmentvariablesoperation.cpp b/src/libs/installer/environmentvariablesoperation.cpp
index 953379ba7..95ea54800 100644
--- a/src/libs/installer/environmentvariablesoperation.cpp
+++ b/src/libs/installer/environmentvariablesoperation.cpp
@@ -239,7 +239,7 @@ bool EnvironmentVariableOperation::undoOperation()
const bool doUndo = actual == value;
if (doUndo)
Environment::instance().setTemporaryValue(name, oldvalue);
- return doUndo;
+ return true;
}
#ifdef Q_OS_WIN
diff --git a/src/libs/installer/extractarchiveoperation.cpp b/src/libs/installer/extractarchiveoperation.cpp
index d755a5320..9ae35cb77 100644
--- a/src/libs/installer/extractarchiveoperation.cpp
+++ b/src/libs/installer/extractarchiveoperation.cpp
@@ -34,6 +34,7 @@
#include <QEventLoop>
#include <QThreadPool>
#include <QFileInfo>
+#include <QDataStream>
namespace QInstaller {
diff --git a/src/libs/installer/globals.cpp b/src/libs/installer/globals.cpp
index 4c40492f0..358c79983 100644
--- a/src/libs/installer/globals.cpp
+++ b/src/libs/installer/globals.cpp
@@ -42,6 +42,8 @@ const char IFW_PACKAGE_DESCRIPTION[] = "ifw.package.description";
const char IFW_PACKAGE_VERSION[] = "ifw.package.version";
const char IFW_PACKAGE_INSTALLEDVERSION[] = "ifw.package.installedversion";
const char IFW_PACKAGE_RELEASEDATE[] = "ifw.package.releasedate";
+const char IFW_PACKAGE_INSTALLDATE[] = "ifw.package.installdate";
+const char IFW_PACKAGE_UPDATEDATE[] = "ifw.package.updatedate";
const char IFW_PACKAGE_NAME[] = "ifw.package.name";
const char IFW_PACKAGE_DEPENDENCIES[] = "ifw.package.dependencies";
const char IFW_PACKAGE_AUTODEPENDON[] = "ifw.package.autodependon";
@@ -76,6 +78,8 @@ Q_LOGGING_CATEGORY(lcPackageDescription, IFW_PACKAGE_DESCRIPTION)
Q_LOGGING_CATEGORY(lcPackageVersion, IFW_PACKAGE_VERSION)
Q_LOGGING_CATEGORY(lcPackageInstalledVersion, IFW_PACKAGE_INSTALLEDVERSION)
Q_LOGGING_CATEGORY(lcPackageReleasedate, IFW_PACKAGE_RELEASEDATE)
+Q_LOGGING_CATEGORY(lcPackageInstalldate, IFW_PACKAGE_INSTALLDATE)
+Q_LOGGING_CATEGORY(lcPackageUpdatedate, IFW_PACKAGE_UPDATEDATE)
Q_LOGGING_CATEGORY(lcPackageName, IFW_PACKAGE_NAME)
Q_LOGGING_CATEGORY(lcPackageDependencies, IFW_PACKAGE_DEPENDENCIES)
Q_LOGGING_CATEGORY(lcPackageAutodependon, IFW_PACKAGE_AUTODEPENDON)
@@ -107,6 +111,8 @@ QStringList loggingCategories()
<< QLatin1String(IFW_PACKAGE_VERSION)
<< QLatin1String(IFW_PACKAGE_INSTALLEDVERSION)
<< QLatin1String(IFW_PACKAGE_RELEASEDATE)
+ << QLatin1String(IFW_PACKAGE_INSTALLDATE)
+ << QLatin1String(IFW_PACKAGE_UPDATEDATE)
<< QLatin1String(IFW_PACKAGE_NAME)
<< QLatin1String(IFW_PACKAGE_DEPENDENCIES)
<< QLatin1String(IFW_PACKAGE_AUTODEPENDON)
diff --git a/src/libs/installer/globals.h b/src/libs/installer/globals.h
index e8f19130e..2cbb44430 100644
--- a/src/libs/installer/globals.h
+++ b/src/libs/installer/globals.h
@@ -47,6 +47,8 @@ INSTALLER_EXPORT Q_DECLARE_LOGGING_CATEGORY(lcPackageDescription)
INSTALLER_EXPORT Q_DECLARE_LOGGING_CATEGORY(lcPackageVersion)
INSTALLER_EXPORT Q_DECLARE_LOGGING_CATEGORY(lcPackageInstalledVersion)
INSTALLER_EXPORT Q_DECLARE_LOGGING_CATEGORY(lcPackageReleasedate)
+INSTALLER_EXPORT Q_DECLARE_LOGGING_CATEGORY(lcPackageInstallDate)
+INSTALLER_EXPORT Q_DECLARE_LOGGING_CATEGORY(lcPackageUpdateDate)
INSTALLER_EXPORT Q_DECLARE_LOGGING_CATEGORY(lcPackageName)
INSTALLER_EXPORT Q_DECLARE_LOGGING_CATEGORY(lcPackageDependencies)
INSTALLER_EXPORT Q_DECLARE_LOGGING_CATEGORY(lcPackageAutodependon)
diff --git a/src/libs/installer/packagemanagercore.cpp b/src/libs/installer/packagemanagercore.cpp
index 36c9935ce..8a0ee2585 100644
--- a/src/libs/installer/packagemanagercore.cpp
+++ b/src/libs/installer/packagemanagercore.cpp
@@ -2050,6 +2050,22 @@ void PackageManagerCore::printPackageInformation(const QString &name, const Pack
qCDebug(QInstaller::lcPackageInstalledVersion).noquote() << "\tInstalled version:" << installedPackages.value(name).version;
}
+void PackageManagerCore::printLocalPackageInformation(const KDUpdater::LocalPackage package) const
+{
+ qCDebug(QInstaller::lcPackageName).noquote() << "Id:" << package.name;
+ qCDebug(QInstaller::lcPackageDisplayname).noquote() << "\tDisplay name:" << package.title;
+ qCDebug(QInstaller::lcPackageVersion).noquote() << "\tVersion:" << package.version;
+ qCDebug(QInstaller::lcPackageDescription).noquote() << "\tDescription:" << package.description;
+ qCDebug(QInstaller::lcPackageDependencies).noquote() << "\tDependencies:" << package.dependencies;
+ qCDebug(QInstaller::lcPackageAutodependon).noquote() << "\tAutodependon:" << package.autoDependencies;
+ qCDebug(QInstaller::lcPackageVirtual).noquote() << "\tVirtual:" << package.virtualComp;
+ qCDebug(QInstaller::lcPackageForcedinstallation).noquote() << "\tForced installation:" << package.forcedInstallation;
+ qCDebug(QInstaller::lcPackageCheckable).noquote() << "\tCheckable:" << package.checkable;
+ qCDebug(QInstaller::lcPackageUncompressedSize).noquote() << "\tUncompressed size:" << package.uncompressedSize;
+ qCDebug(QInstaller::lcPackageInstallDate).noquote() << "\tInstalled:" << package.installDate;
+ qCDebug(QInstaller::lcPackageUpdateDate).noquote() << "\tLast updated:" << package.lastUpdateDate;
+}
+
bool PackageManagerCore::componentUninstallableFromCommandLine(const QString &componentName)
{
// We will do a recursive check for every child this component has.
@@ -2083,7 +2099,7 @@ void PackageManagerCore::listInstalledPackages()
const QStringList &keys = installedPackages.keys();
foreach (const QString &key, keys) {
KDUpdater::LocalPackage package = installedPackages.value(key);
- qCDebug(QInstaller::lcPackageName) << package.name;
+ printLocalPackageInformation(package);
}
}
@@ -2272,6 +2288,109 @@ void PackageManagerCore::dropAdminRights()
}
/*!
+ Sets checkAvailableSpace based on value of \c check.
+*/
+void PackageManagerCore::setCheckAvailableSpace(bool check)
+{
+ d->m_checkAvailableSpace = check;
+}
+
+/*!
+ Checks available disk space if the feature is not explicitly disabled. Informative
+ text about space status can be retrieved by passing \c message parameter. Returns
+ \a true if there is sufficient free space on installation and temporary volumes.
+*/
+bool PackageManagerCore::checkAvailableSpace(QString &message) const
+{
+ const quint64 extraSpace = 256 * 1024 * 1024LL;
+ quint64 required(requiredDiskSpace());
+ quint64 tempRequired(requiredTemporaryDiskSpace());
+ if (required < extraSpace) {
+ required += 0.1 * required;
+ tempRequired += 0.1 * tempRequired;
+ } else {
+ required += extraSpace;
+ tempRequired += extraSpace;
+ }
+
+ quint64 repositorySize = 0;
+ const bool createLocalRepository = createLocalRepositoryFromBinary();
+ if (createLocalRepository && isInstaller()) {
+ repositorySize = QFile(QCoreApplication::applicationFilePath()).size();
+ // if we create a local repository, take that space into account as well
+ required += repositorySize;
+ }
+
+ qDebug() << "Installation space required:" << humanReadableSize(required) << "Temporary space "
+ "required:" << humanReadableSize(tempRequired) << "Local repository size:"
+ << humanReadableSize(repositorySize);
+
+ if (d->m_checkAvailableSpace) {
+ const VolumeInfo tempVolume = VolumeInfo::fromPath(QDir::tempPath());
+ const VolumeInfo targetVolume = VolumeInfo::fromPath(value(scTargetDir));
+
+ const quint64 tempVolumeAvailableSize = tempVolume.availableSize();
+ const quint64 installVolumeAvailableSize = targetVolume.availableSize();
+
+ // at the moment there is no better way to check this
+ if (targetVolume.size() == 0 && installVolumeAvailableSize == 0) {
+ qDebug().nospace() << "Cannot determine available space on device. "
+ "Volume descriptor: " << targetVolume.volumeDescriptor()
+ << ", Mount path: " << targetVolume.mountPath() << ". Continue silently.";
+ return true;
+ }
+
+ const bool tempOnSameVolume = (targetVolume == tempVolume);
+ if (tempOnSameVolume) {
+ qDebug() << "Tmp and install directories are on the same volume. Volume mount point:"
+ << targetVolume.mountPath() << "Free space available:"
+ << humanReadableSize(installVolumeAvailableSize);
+ } else {
+ qDebug() << "Tmp is on a different volume than the installation directory. Tmp volume mount point:"
+ << tempVolume.mountPath() << "Free space available:"
+ << humanReadableSize(tempVolumeAvailableSize) << "Install volume mount point:"
+ << targetVolume.mountPath() << "Free space available:"
+ << humanReadableSize(installVolumeAvailableSize);
+ }
+
+ if (tempOnSameVolume && (installVolumeAvailableSize <= (required + tempRequired))) {
+ message = tr("Not enough disk space to store temporary files and the "
+ "installation. %1 are available, while %2 are at least required.").arg(
+ humanReadableSize(installVolumeAvailableSize), humanReadableSize(required + tempRequired));
+ return false;
+ }
+
+ if (installVolumeAvailableSize < required) {
+ message = tr("Not enough disk space to store all selected components! %1 are "
+ "available while %2 are at least required.").arg(humanReadableSize(installVolumeAvailableSize),
+ humanReadableSize(required));
+ return false;
+ }
+
+ if (tempVolumeAvailableSize < tempRequired) {
+ message = tr("Not enough disk space to store temporary files! %1 are available "
+ "while %2 are at least required.").arg(humanReadableSize(tempVolumeAvailableSize),
+ humanReadableSize(tempRequired));
+ return false;
+ }
+
+ if (installVolumeAvailableSize - required < 0.01 * targetVolume.size()) {
+ // warn for less than 1% of the volume's space being free
+ message = tr("The volume you selected for installation seems to have sufficient space for "
+ "installation, but there will be less than 1% of the volume's space available afterwards.");
+ } else if (installVolumeAvailableSize - required < 100 * 1024 * 1024LL) {
+ // warn for less than 100MB being free
+ message = tr("The volume you selected for installation seems to have sufficient "
+ "space for installation, but there will be less than 100 MB available afterwards.");
+ }
+ }
+ message = QString::fromLatin1("%1 %2").arg(message, tr("Installation will use %1 of disk space.")
+ .arg(humanReadableSize(requiredDiskSpace()))).simplified();
+
+ return true;
+}
+
+/*!
Returns \c true if a process with \a name is running. On Windows, the comparison
is case-insensitive.
diff --git a/src/libs/installer/packagemanagercore.h b/src/libs/installer/packagemanagercore.h
index 9d4cceaea..76a0a7341 100644
--- a/src/libs/installer/packagemanagercore.h
+++ b/src/libs/installer/packagemanagercore.h
@@ -249,6 +249,9 @@ public:
Q_INVOKABLE bool gainAdminRights();
Q_INVOKABLE void dropAdminRights();
+ void setCheckAvailableSpace(bool check);
+ bool checkAvailableSpace(QString &message) const;
+
Q_INVOKABLE quint64 requiredDiskSpace() const;
Q_INVOKABLE quint64 requiredTemporaryDiskSpace() const;
@@ -361,6 +364,7 @@ private:
bool fetchPackagesTree(const PackagesList &packages, const LocalPackagesHash installedPackages);
void printPackageInformation(const QString &name, const Package *update);
+ void printLocalPackageInformation(const KDUpdater::LocalPackage package) const;
bool componentUninstallableFromCommandLine(const QString &componentName);
diff --git a/src/libs/installer/packagemanagercore_p.cpp b/src/libs/installer/packagemanagercore_p.cpp
index b7c03c21a..190d297f0 100644
--- a/src/libs/installer/packagemanagercore_p.cpp
+++ b/src/libs/installer/packagemanagercore_p.cpp
@@ -218,6 +218,7 @@ PackageManagerCorePrivate::PackageManagerCorePrivate(PackageManagerCore *core)
, m_foundEssentialUpdate(false)
, m_commandLineInstance(false)
, m_userSetBinaryMarker(false)
+ , m_checkAvailableSpace(true)
{
}
@@ -251,6 +252,7 @@ PackageManagerCorePrivate::PackageManagerCorePrivate(PackageManagerCore *core, q
, m_foundEssentialUpdate(false)
, m_commandLineInstance(false)
, m_userSetBinaryMarker(false)
+ , m_checkAvailableSpace(true)
{
foreach (const OperationBlob &operation, performedOperations) {
QScopedPointer<QInstaller::Operation> op(KDUpdater::UpdateOperationFactory::instance()
diff --git a/src/libs/installer/packagemanagercore_p.h b/src/libs/installer/packagemanagercore_p.h
index 961822994..e246317cc 100644
--- a/src/libs/installer/packagemanagercore_p.h
+++ b/src/libs/installer/packagemanagercore_p.h
@@ -188,6 +188,7 @@ public:
bool m_launchedAsRoot;
bool m_commandLineInstance;
bool m_userSetBinaryMarker;
+ bool m_checkAvailableSpace;
bool m_completeUninstall;
bool m_needToWriteMaintenanceTool;
PackageManagerCoreData m_data;
diff --git a/src/libs/installer/packagemanagergui.cpp b/src/libs/installer/packagemanagergui.cpp
index 05f61ae18..793519416 100644
--- a/src/libs/installer/packagemanagergui.cpp
+++ b/src/libs/installer/packagemanagergui.cpp
@@ -2411,102 +2411,15 @@ void ReadyForInstallationPage::entering()
m_taskDetailsBrowser->setVisible(!componentsOk || isVerbose());
setComplete(componentsOk);
- const VolumeInfo tempVolume = VolumeInfo::fromPath(QDir::tempPath());
- const VolumeInfo targetVolume = VolumeInfo::fromPath(packageManagerCore()->value(scTargetDir));
-
- const quint64 tempVolumeAvailableSize = tempVolume.availableSize();
- const quint64 installVolumeAvailableSize = targetVolume.availableSize();
-
- // at the moment there is no better way to check this
- if (targetVolume.size() == 0 && installVolumeAvailableSize == 0) {
- qCWarning(QInstaller::lcInstallerInstallLog).nospace() << "Cannot determine available space on device. "
- "Volume descriptor: " << targetVolume.volumeDescriptor()
- << ", Mount path: " << targetVolume.mountPath() << ". Continue silently.";
- return; // TODO: Shouldn't this also disable the "Next" button?
- }
-
- const bool tempOnSameVolume = (targetVolume == tempVolume);
- if (tempOnSameVolume) {
- qCDebug(QInstaller::lcInstallerInstallLog) << "Tmp and install directories are on the same volume. "
- "Volume mount point:" << targetVolume.mountPath() << "Free space available:"
- << humanReadableSize(installVolumeAvailableSize);
- } else {
- qCDebug(QInstaller::lcInstallerInstallLog) << "Tmp is on a different volume than the installation "
- "directory. Tmp volume mount point:"
- << tempVolume.mountPath() << "Free space available:"
- << humanReadableSize(tempVolumeAvailableSize) << "Install volume mount point:"
- << targetVolume.mountPath() << "Free space available:"
- << humanReadableSize(installVolumeAvailableSize);
- }
-
- const quint64 extraSpace = 256 * 1024 * 1024LL;
- quint64 required(packageManagerCore()->requiredDiskSpace());
- quint64 tempRequired(packageManagerCore()->requiredTemporaryDiskSpace());
- if (required < extraSpace) {
- required += 0.1 * required;
- tempRequired += 0.1 * tempRequired;
+ QString spaceInfo;
+ if (packageManagerCore()->checkAvailableSpace(spaceInfo)) {
+ m_msgLabel->setText(QString::fromLatin1("%1 %2").arg(m_msgLabel->text(), spaceInfo));
} else {
- required += extraSpace;
- tempRequired += extraSpace;
- }
-
- quint64 repositorySize = 0;
- const bool createLocalRepository = packageManagerCore()->createLocalRepositoryFromBinary();
- if (createLocalRepository && packageManagerCore()->isInstaller()) {
- repositorySize = QFile(QCoreApplication::applicationFilePath()).size();
- // if we create a local repository, take that space into account as well
- required += repositorySize;
- }
-
- qCDebug(QInstaller::lcInstallerInstallLog) << "Installation space required:"
- << humanReadableSize(required) << "Temporary space "
- "required:" << humanReadableSize(tempRequired) << "Local repository size:"
- << humanReadableSize(repositorySize);
-
- if (tempOnSameVolume && (installVolumeAvailableSize <= (required + tempRequired))) {
- m_msgLabel->setText(tr("Not enough disk space to store temporary files and the "
- "installation. %1 are available, while %2 are at least required.")
- .arg(humanReadableSize(installVolumeAvailableSize),
- humanReadableSize(required + tempRequired)));
- setComplete(false);
- return;
- }
-
- if (installVolumeAvailableSize < required) {
- m_msgLabel->setText(tr("Not enough disk space to store all selected components! %1 are available "
- "while %2 are at least required.").arg(humanReadableSize(installVolumeAvailableSize),
- humanReadableSize(required)));
- setComplete(false);
- return;
- }
-
- if (tempVolumeAvailableSize < tempRequired) {
- m_msgLabel->setText(tr("Not enough disk space to store temporary files! %1 are available "
- "while %2 are at least required.").arg(humanReadableSize(tempVolumeAvailableSize),
- humanReadableSize(tempRequired)));
+ m_msgLabel->setText(spaceInfo);
setComplete(false);
- return;
- }
-
- if (installVolumeAvailableSize - required < 0.01 * targetVolume.size()) {
- // warn for less than 1% of the volume's space being free
- m_msgLabel->setText(tr("The volume you selected for installation seems to have sufficient "
- "space for installation, but there will be less than 1% of the volume's space "
- "available afterwards. %1").arg(m_msgLabel->text()));
- } else if (installVolumeAvailableSize - required < 100 * 1024 * 1024LL) {
- // warn for less than 100MB being free
- m_msgLabel->setText(tr("The volume you selected for installation seems to have sufficient "
- "space for installation, but there will be less than 100 MB available afterwards. %1")
- .arg(m_msgLabel->text()));
}
-
- m_msgLabel->setText(QString::fromLatin1("%1 %2").arg(m_msgLabel->text(),
- tr("Installation will use %1 of disk space.")
- .arg(humanReadableSize(packageManagerCore()->requiredDiskSpace()))));
}
-
-
/*!
Called when end users leave the page and the PackageManagerGui:currentPageChanged()
signal is triggered.
diff --git a/src/libs/installer/progresscoordinator.cpp b/src/libs/installer/progresscoordinator.cpp
index 333c9608e..a61c13a0e 100644
--- a/src/libs/installer/progresscoordinator.cpp
+++ b/src/libs/installer/progresscoordinator.cpp
@@ -34,6 +34,7 @@
#include <QtCore/QDebug>
#include "globals.h"
+#include "utils.h"
using namespace QInstaller;
@@ -311,6 +312,9 @@ void ProgressCoordinator::emitDownloadStatus(const QString &status)
void ProgressCoordinator::printProgressPercentage(int progress)
{
+ if (!isVerbose())
+ return;
+
Q_ASSERT(m_progressSpinner->currentIndex < m_progressSpinner->spinnerChars.size());
QString formatted = QString::fromLatin1("[%1 %2%] ").arg(
diff --git a/src/sdk/commandlineinterface.cpp b/src/sdk/commandlineinterface.cpp
index 26c4d216c..c7c02bf96 100644
--- a/src/sdk/commandlineinterface.cpp
+++ b/src/sdk/commandlineinterface.cpp
@@ -61,7 +61,7 @@ int CommandLineInterface::checkUpdates()
if (!initialize())
return EXIT_FAILURE;
if (m_core->isInstaller()) {
- qCWarning(QInstaller::lcInstallerInstallLog) << "Cannot start installer binary as updater.";
+ qCWarning(QInstaller::lcInstallerInstallLog) << "Cannot check updates with installer.";
return EXIT_FAILURE;
}
m_core->setUpdater();
@@ -98,7 +98,7 @@ int CommandLineInterface::silentUpdate()
if (!initialize())
return EXIT_FAILURE;
if (m_core->isInstaller()) {
- qCWarning(QInstaller::lcInstallerInstallLog) << "Cannot start installer binary as updater.";
+ qCWarning(QInstaller::lcInstallerInstallLog) << "Cannot perform update with installer.";
return EXIT_FAILURE;
}
if (!checkLicense())
@@ -112,7 +112,7 @@ int CommandLineInterface::listInstalledPackages()
if (!initialize())
return EXIT_FAILURE;
if (m_core->isInstaller()) {
- qCWarning(QInstaller::lcInstallerInstallLog) << "Cannot start installer binary as package manager.";
+ qCWarning(QInstaller::lcInstallerInstallLog) << "Cannot list installed packages with installer.";
return EXIT_FAILURE;
}
m_core->setPackageManager();
@@ -138,7 +138,7 @@ int CommandLineInterface::updatePackages()
if (!initialize())
return EXIT_FAILURE;
if (m_core->isInstaller()) {
- qCWarning(QInstaller::lcInstallerInstallLog) << "Cannot start installer binary as updater.";
+ qCWarning(QInstaller::lcInstallerInstallLog) << "Cannot update packages with installer.";
return EXIT_FAILURE;
}
if (!checkLicense())
@@ -168,7 +168,7 @@ int CommandLineInterface::installDefault()
if (!initialize())
return EXIT_FAILURE;
if (!m_core->isInstaller()) {
- qCWarning(QInstaller::lcInstallerInstallLog) << "Cannot start installer binary as updater.";
+ qCWarning(QInstaller::lcInstallerInstallLog) << "Cannot perform default installation with maintenance tool.";
return EXIT_FAILURE;
}
if (!setTargetDir() || !checkLicense())
@@ -182,7 +182,7 @@ int CommandLineInterface::uninstallPackages()
if (!initialize())
return EXIT_FAILURE;
if (m_core->isInstaller()) {
- qCWarning(QInstaller::lcInstallerInstallLog) << "Cannot start installer binary as package manager.";
+ qCWarning(QInstaller::lcInstallerInstallLog) << "Cannot uninstall packages with installer.";
return EXIT_FAILURE;
}
m_core->setPackageManager();
diff --git a/src/sdk/commandlineparser.cpp b/src/sdk/commandlineparser.cpp
index f39650872..dc9371216 100644
--- a/src/sdk/commandlineparser.cpp
+++ b/src/sdk/commandlineparser.cpp
@@ -74,6 +74,9 @@ CommandLineParser::CommandLineParser()
m_parser.addOption(QCommandLineOption(QLatin1String(CommandLineOptions::NoForceInstallation),
QLatin1String("Allow deselecting components that are marked as forced.")));
+ m_parser.addOption(QCommandLineOption(QLatin1String(CommandLineOptions::NoSizeChecking),
+ QLatin1String("Disable checking of free space for installation target.")));
+
m_parser.addOption(QCommandLineOption(QLatin1String(CommandLineOptions::ShowVirtualComponents),
QLatin1String("Show virtual components in installer and package manager.")));
diff --git a/src/sdk/sdkapp.h b/src/sdk/sdkapp.h
index 235486086..12a5aa830 100644
--- a/src/sdk/sdkapp.h
+++ b/src/sdk/sdkapp.h
@@ -268,6 +268,9 @@ public:
}
m_core->setTemporaryRepositories(repoList, false, true);
}
+ // Disable checking for free space on target
+ if (m_parser.isSet(QLatin1String(CommandLineOptions::NoSizeChecking)))
+ m_core->setCheckAvailableSpace(false);
QInstaller::PackageManagerCore::setNoForceInstallation(m_parser
.isSet(QLatin1String(CommandLineOptions::NoForceInstallation)));
diff --git a/tests/auto/installer/cliinterface/data/components.xml b/tests/auto/installer/cliinterface/data/components.xml
new file mode 100644
index 000000000..d5102787f
--- /dev/null
+++ b/tests/auto/installer/cliinterface/data/components.xml
@@ -0,0 +1,24 @@
+<Packages>
+ <ApplicationName>Online Installer Example</ApplicationName>
+ <ApplicationVersion>1.0.0</ApplicationVersion>
+ <Package>
+ <Name>A</Name>
+ <Title>A Title</Title>
+ <Description>Example component A</Description>
+ <Version>1.0.2-1</Version>
+ <LastUpdateDate></LastUpdateDate>
+ <InstallDate>2020-02-13</InstallDate>
+ <Size>74</Size>
+ <Checkable>true</Checkable>
+ </Package>
+ <Package>
+ <Name>B</Name>
+ <Title>B Title</Title>
+ <Description>Example component B</Description>
+ <Version>1.0.0-1</Version>
+ <LastUpdateDate></LastUpdateDate>
+ <InstallDate>2020-02-13</InstallDate>
+ <Size>74</Size>
+ <Checkable>true</Checkable>
+ </Package>
+</Packages> \ No newline at end of file
diff --git a/tests/auto/installer/cliinterface/settings.qrc b/tests/auto/installer/cliinterface/settings.qrc
index c0b643041..e95fff4a0 100644
--- a/tests/auto/installer/cliinterface/settings.qrc
+++ b/tests/auto/installer/cliinterface/settings.qrc
@@ -3,6 +3,7 @@
<file>data/config.xml</file>
<file>data/repository/Updates.xml</file>
<file>data/uninstallableComponentsRepository/Updates.xml</file>
+ <file>data/components.xml</file>
</qresource>
<qresource prefix="/metadata">
<file>installer-config/config.xml</file>
diff --git a/tests/auto/installer/cliinterface/tst_cliinterface.cpp b/tests/auto/installer/cliinterface/tst_cliinterface.cpp
index 48410311d..9480732a9 100644
--- a/tests/auto/installer/cliinterface/tst_cliinterface.cpp
+++ b/tests/auto/installer/cliinterface/tst_cliinterface.cpp
@@ -119,6 +119,27 @@ private slots:
core->installSelectedComponentsSilently(QStringList() << QLatin1String("MissingComponent"));
}
+ void testListInstalledPackages()
+ {
+ QString loggingRules = (QLatin1String("ifw.* = false\n"
+ "ifw.package.name = true\n"));
+ PackageManagerCore core;
+ core.setPackageManager();
+ QLoggingCategory::setFilterRules(loggingRules);
+
+ const QString testDirectory = QInstaller::generateTemporaryFileName();
+ QVERIFY(QDir().mkpath(testDirectory));
+ QVERIFY(QFile::copy(":/data/components.xml", testDirectory + "/components.xml"));
+
+ core.setValue(scTargetDir, testDirectory);
+
+ QTest::ignoreMessage(QtDebugMsg, "Id: A");
+ QTest::ignoreMessage(QtDebugMsg, "Id: B");
+ core.listInstalledPackages();
+ QDir dir(testDirectory);
+
+ QVERIFY(dir.removeRecursively());
+ }
};
diff --git a/tools/repogen/repogen.cpp b/tools/repogen/repogen.cpp
index bdbe00eae..e785ffd04 100644
--- a/tools/repogen/repogen.cpp
+++ b/tools/repogen/repogen.cpp
@@ -246,11 +246,14 @@ int main(int argc, char** argv)
// remove all components that have no update (decision based on the version tag)
for (int i = packages.count() - 1; i >= 0; --i) {
const QInstallerTools::PackageInfo info = packages.at(i);
- if (!hash.contains(info.name))
- continue; // the component is not there, keep it
- if (KDUpdater::compareVersion(info.version, hash.value(info.name).version) < 1)
+ // check if component already exists & version did not change
+ if (hash.contains(info.name) && KDUpdater::compareVersion(info.version, hash.value(info.name).version) < 1) {
packages.remove(i); // the version did not change, no need to update the component
+ continue;
+ }
+ std::cout << QString::fromLatin1("Update component \"%1\" in \"%2\".")
+ .arg(info.name, repositoryDir) << std::endl;
}
if (packages.isEmpty()) {