summaryrefslogtreecommitdiffstats
path: root/src/sdk/installerbase.cpp
diff options
context:
space:
mode:
authorKatja Marttila <katja.marttila@qt.io>2019-05-29 14:04:57 +0300
committerKatja Marttila <katja.marttila@qt.io>2019-11-19 09:38:04 +0000
commit48a43de0be59639b16962ec04f1a4e07141abaf0 (patch)
treee79773f2c5acfc974a65646ffe60ca0b7355c9a0 /src/sdk/installerbase.cpp
parent3bd4e7d632967b1bf77120918700c11f83318166 (diff)
List available packages from command line
Available packages can be listed from command line with --listPackages <regexp>. All packages can be listed with --listPackages . . By default package id, name and version are listed in output. In case you want to see all the packet information use logging category --logging-rules ifw.package.*=true. See --help for more detailed information on how to use logging category. Change-Id: Ic0815d2274643e3fb3f0670ed9036fe765805c0e Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
Diffstat (limited to 'src/sdk/installerbase.cpp')
-rw-r--r--src/sdk/installerbase.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/sdk/installerbase.cpp b/src/sdk/installerbase.cpp
index 918a846fc..1cf5765e1 100644
--- a/src/sdk/installerbase.cpp
+++ b/src/sdk/installerbase.cpp
@@ -122,11 +122,17 @@ int InstallerBase::run()
QString loggingRules(QLatin1String("ifw.* = false")); // disable all by default
if (QInstaller::isVerbose()) {
- loggingRules = QString(); // enable all in verbose mode
if (parser.isSet(QLatin1String(CommandLineOptions::LoggingRules))) {
loggingRules = parser.value(QLatin1String(CommandLineOptions::LoggingRules))
.split(QLatin1Char(','), QString::SkipEmptyParts)
.join(QLatin1Char('\n')); // take rules from command line
+ } else {
+ // enable all in verbose mode except detailed package information
+ loggingRules = QLatin1String("ifw.* = true\n"
+ "ifw.package.* = false\n"
+ "ifw.package.name = true\n"
+ "ifw.package.version = true\n"
+ "ifw.package.displayname = true\n");
}
}
QLoggingCategory::setFilterRules(loggingRules);
@@ -305,6 +311,12 @@ int InstallerBase::run()
checkLicense();
m_core->setPackageManager();
m_core->listInstalledPackages();
+ } else if (parser.isSet(QLatin1String(CommandLineOptions::ListPackages))){
+ if (!m_core->isInstaller())
+ m_core->setPackageManager();
+ checkLicense();
+ QString regexp = parser.value(QLatin1String(CommandLineOptions::ListPackages));
+ m_core->listAvailablePackages(regexp);
} else {
//create the wizard GUI
TabController controller(nullptr);