diff options
Diffstat (limited to 'src/sdk/installerbase.cpp')
-rw-r--r-- | src/sdk/installerbase.cpp | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/src/sdk/installerbase.cpp b/src/sdk/installerbase.cpp index 247b4ab57..8ae6861a5 100644 --- a/src/sdk/installerbase.cpp +++ b/src/sdk/installerbase.cpp @@ -138,11 +138,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); @@ -312,13 +318,22 @@ int InstallerBase::run() if (parser.isSet(QLatin1String(CommandLineOptions::SilentUpdate))) { if (m_core->isInstaller()) throw QInstaller::Error(QLatin1String("Cannot start installer binary as updater.")); - const ProductKeyCheck *const productKeyCheck = ProductKeyCheck::instance(); - if (!productKeyCheck->hasValidLicense()) - throw QInstaller::Error(QLatin1String("Silent update not allowed.")); + checkLicense(); m_core->setUpdater(); m_core->updateComponentsSilently(); - } - else { + } else if (parser.isSet(QLatin1String(CommandLineOptions::ListInstalledPackages))){ + if (m_core->isInstaller()) + throw QInstaller::Error(QLatin1String("Cannot start installer binary as package manager.")); + 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); controller.setManager(m_core); @@ -392,3 +407,12 @@ QStringList InstallerBase::repositories(const QString &list) const qDebug().noquote() << "Adding custom repository:" << item; return items; } + +void InstallerBase::checkLicense() +{ + const ProductKeyCheck *const productKeyCheck = ProductKeyCheck::instance(); + if (!productKeyCheck->hasValidLicense()) { + qDebug() << "No valid license found."; + throw QInstaller::Error(QLatin1String("No valid license found.")); + } +} |