summaryrefslogtreecommitdiffstats
path: root/src/sdk
diff options
context:
space:
mode:
authorKatja Marttila <katja.marttila@qt.io>2020-09-23 19:37:31 +0300
committerKatja Marttila <katja.marttila@qt.io>2020-09-25 10:32:30 +0300
commit02f8711dc250b4c4f07ea7b43cbb0904496b1cb3 (patch)
tree91357567cd4dfe0c0df14e2b21f5ef871fcce14e /src/sdk
parent557feae54796a861f6076d30df17958e14debb4c (diff)
CLI: Give more meaningfull return value for installs
Instead of returning just true or false when running installer or maintenancetool, utilize the PackagemanagerCore status message. Added also a new status enum, EssentialUpdated, which is returned when calling command 'update' and only essential components are updated. Also fixed a bug when components could be installed even when there were an essential update available. Task-number: QTIFW-1969 Change-Id: I43826301656573b34e1338b49566d199bdcd7468 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
Diffstat (limited to 'src/sdk')
-rw-r--r--src/sdk/commandlineinterface.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/sdk/commandlineinterface.cpp b/src/sdk/commandlineinterface.cpp
index 942faaf31..bfb4ea75a 100644
--- a/src/sdk/commandlineinterface.cpp
+++ b/src/sdk/commandlineinterface.cpp
@@ -159,8 +159,7 @@ int CommandLineInterface::updatePackages()
if (!checkLicense())
return EXIT_FAILURE;
try {
- return m_core->updateComponentsSilently(m_positionalArguments)
- ? EXIT_SUCCESS : EXIT_FAILURE;
+ return m_core->updateComponentsSilently(m_positionalArguments);
} catch (const QInstaller::Error &err) {
qCCritical(QInstaller::lcInstallerInstallLog) << err.message();
return EXIT_FAILURE;
@@ -179,12 +178,10 @@ int CommandLineInterface::installPackages()
return EXIT_FAILURE;
}
// No packages provided, install default components
- return m_core->installDefaultComponentsSilently()
- ? EXIT_SUCCESS : EXIT_FAILURE;
+ return m_core->installDefaultComponentsSilently();
}
// Normal installation
- return m_core->installSelectedComponentsSilently(m_positionalArguments)
- ? EXIT_SUCCESS : EXIT_FAILURE;
+ return m_core->installSelectedComponentsSilently(m_positionalArguments);
} catch (const QInstaller::Error &err) {
qCCritical(QInstaller::lcInstallerInstallLog) << err.message();
return EXIT_FAILURE;
@@ -201,8 +198,7 @@ int CommandLineInterface::uninstallPackages()
}
m_core->setPackageManager();
try {
- return m_core->uninstallComponentsSilently(m_positionalArguments)
- ? EXIT_SUCCESS : EXIT_FAILURE;
+ return m_core->uninstallComponentsSilently(m_positionalArguments);
} catch (const QInstaller::Error &err) {
qCCritical(QInstaller::lcInstallerInstallLog) << err.message();
return EXIT_FAILURE;
@@ -219,7 +215,7 @@ int CommandLineInterface::removeInstallation()
}
m_core->setUninstaller();
try {
- return m_core->removeInstallationSilently() ? EXIT_SUCCESS : EXIT_FAILURE;
+ return m_core->removeInstallationSilently();
} catch (const QInstaller::Error &err) {
qCCritical(QInstaller::lcInstallerInstallLog) << err.message();
return EXIT_FAILURE;