From 48a43de0be59639b16962ec04f1a4e07141abaf0 Mon Sep 17 00:00:00 2001 From: Katja Marttila Date: Wed, 29 May 2019 14:04:57 +0300 Subject: List available packages from command line Available packages can be listed from command line with --listPackages . 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 --- src/sdk/installerbase.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/sdk/installerbase.cpp') 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); -- cgit v1.2.3