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/packagemanagercore.cpp103
-rw-r--r--src/libs/installer/packagemanagercore.h3
-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/sdk/commandlineparser.cpp3
-rw-r--r--src/sdk/sdkapp.h3
-rw-r--r--tools/repogen/repogen.cpp9
15 files changed, 148 insertions, 102 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/packagemanagercore.cpp b/src/libs/installer/packagemanagercore.cpp
index a1ba7e1f2..8a0ee2585 100644
--- a/src/libs/installer/packagemanagercore.cpp
+++ b/src/libs/installer/packagemanagercore.cpp
@@ -2288,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 1ca0e05ef..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;
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/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/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()) {