2015-09-07 19:36:45 +02:00
|
|
|
#include "./upgradelookup.h"
|
|
|
|
#include "./manager.h"
|
|
|
|
#include "./alpmdatabase.h"
|
|
|
|
#include "./config.h"
|
|
|
|
#include "./utilities.h"
|
2015-09-04 14:37:01 +02:00
|
|
|
|
|
|
|
#include <QtConcurrent/QtConcurrent>
|
|
|
|
|
|
|
|
#include <assert.h>
|
2015-09-07 19:36:45 +02:00
|
|
|
#include <iostream>
|
2015-09-04 14:37:01 +02:00
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
2015-09-05 17:25:05 +02:00
|
|
|
namespace RepoIndex {
|
2015-09-04 14:37:01 +02:00
|
|
|
|
2015-09-07 19:36:45 +02:00
|
|
|
using namespace Utilities;
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \class UpgradeResult
|
|
|
|
* \brief The UpgradeResult class wraps and upgrade/downgrade package and the current version.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Returns a JSON object for the current instance.
|
|
|
|
*/
|
2015-09-27 19:29:45 +02:00
|
|
|
QJsonObject UpgradeResult::toJson() const
|
2015-09-04 14:37:01 +02:00
|
|
|
{
|
|
|
|
QJsonObject obj;
|
2015-09-21 22:16:19 +02:00
|
|
|
obj.insert(QStringLiteral("name"), package->name());
|
|
|
|
if(package->repository()) {
|
|
|
|
obj.insert(QStringLiteral("repo"), package->repository()->name());
|
|
|
|
}
|
|
|
|
obj.insert(QStringLiteral("pkg"), package->basicInfo());
|
2015-09-07 19:36:45 +02:00
|
|
|
obj.insert(QStringLiteral("curVer"), currentVersion);
|
2015-09-04 14:37:01 +02:00
|
|
|
return obj;
|
|
|
|
}
|
|
|
|
|
2015-09-07 19:36:45 +02:00
|
|
|
/*!
|
|
|
|
* \class UpgradeLookupProcess
|
|
|
|
* \brief The UpgradeLookupProcess class performs an async upgrade lookup for a particular upgrade source.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Constructs a new upgrade lookup process. The upgrade lookup process is started immediately.
|
2015-11-03 18:19:24 +01:00
|
|
|
* \remarks \a upgradeLookup and \a upgradeSource musted be locked by caller
|
2015-09-07 19:36:45 +02:00
|
|
|
*/
|
2015-09-27 19:29:45 +02:00
|
|
|
UpgradeLookupProcess::UpgradeLookupProcess(UpgradeLookup *upgradeLookup, Repository *upgradeSource) :
|
2015-09-04 14:37:01 +02:00
|
|
|
QObject(upgradeLookup),
|
|
|
|
m_toCheck(upgradeLookup->toCheck()),
|
|
|
|
m_upgradeSource(upgradeSource),
|
|
|
|
m_reply(nullptr),
|
|
|
|
m_watcher(new QFutureWatcher<void>(this))
|
|
|
|
{
|
|
|
|
connect(this, &UpgradeLookupProcess::finished, upgradeLookup, &UpgradeLookup::processFinished);
|
2016-02-25 22:53:33 +01:00
|
|
|
requestSources();
|
2015-09-04 14:37:01 +02:00
|
|
|
}
|
|
|
|
|
2015-09-07 19:36:45 +02:00
|
|
|
/*!
|
|
|
|
* \brief Returns the results. Results are available, after the finished() signal has been emitted.
|
|
|
|
*/
|
2015-11-03 18:19:24 +01:00
|
|
|
inline const UpgradeLookupResults &UpgradeLookupProcess::results() const
|
2015-09-04 14:37:01 +02:00
|
|
|
{
|
|
|
|
return m_results;
|
|
|
|
}
|
|
|
|
|
2016-02-25 22:53:33 +01:00
|
|
|
/*!
|
|
|
|
* \brief Internally called to request the sources.
|
|
|
|
*/
|
|
|
|
void UpgradeLookupProcess::requestSources()
|
|
|
|
{
|
2016-02-26 01:27:57 +01:00
|
|
|
if(ensureNotBusy()) {
|
|
|
|
return;
|
2016-02-25 22:53:33 +01:00
|
|
|
}
|
|
|
|
// request sources if required
|
|
|
|
switch(m_upgradeSource->requestsRequired()) {
|
|
|
|
case PackageDetailAvailability::Request:
|
|
|
|
m_reply = m_upgradeSource->requestPackageInfo(m_toCheck->packageNames());
|
|
|
|
break;
|
|
|
|
case PackageDetailAvailability::FullRequest:
|
|
|
|
m_reply = m_upgradeSource->requestFullPackageInfo(m_toCheck->packageNames());
|
|
|
|
break;
|
|
|
|
case PackageDetailAvailability::Never:
|
|
|
|
m_results.errors << QStringLiteral("Repository \"%1\" does not provide the required information.").arg(m_upgradeSource->name());
|
|
|
|
emit finished();
|
|
|
|
return;
|
|
|
|
case PackageDetailAvailability::Immediately:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if(m_reply) {
|
|
|
|
// a request is required -> wait until results are available
|
|
|
|
m_reply->setParent(this);
|
|
|
|
connect(m_reply, &PackageReply::resultsAvailable, this, &UpgradeLookupProcess::sourceReady);
|
|
|
|
} else {
|
|
|
|
// no request required -> call sourceReady immidiately
|
|
|
|
sourceReady();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-09-07 19:36:45 +02:00
|
|
|
/*!
|
|
|
|
* \brief Internally called when the upgrade source is ready.
|
|
|
|
*/
|
2015-09-04 14:37:01 +02:00
|
|
|
void UpgradeLookupProcess::sourceReady()
|
|
|
|
{
|
2016-02-26 01:27:57 +01:00
|
|
|
if(ensureNotBusy()) {
|
|
|
|
return;
|
|
|
|
}
|
2016-02-25 22:53:33 +01:00
|
|
|
// if a request was required, check whether an error occured
|
2015-09-04 14:37:01 +02:00
|
|
|
if(m_reply && !m_reply->error().isEmpty()) {
|
|
|
|
m_results.errors << m_reply->error();
|
|
|
|
emit finished();
|
|
|
|
} else {
|
2016-02-25 22:53:33 +01:00
|
|
|
// invoke the actual upgrade lookup
|
2015-09-04 14:37:01 +02:00
|
|
|
connect(m_watcher, &QFutureWatcher<void>::finished, this, &UpgradeLookupProcess::finished);
|
|
|
|
m_watcher->setFuture(QtConcurrent::run(this, &UpgradeLookupProcess::checkUpgrades));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-09-07 19:36:45 +02:00
|
|
|
/*!
|
|
|
|
* \brief Internally called to perform the upgrade lookup.
|
|
|
|
*/
|
2015-09-04 14:37:01 +02:00
|
|
|
void UpgradeLookupProcess::checkUpgrades()
|
|
|
|
{
|
2015-11-03 18:19:24 +01:00
|
|
|
QReadLocker toCheckLocker(m_toCheck->lock()), srcLocker(m_upgradeSource->lock());
|
2015-09-27 19:29:45 +02:00
|
|
|
m_toCheck->checkForUpgrades(m_results, QList<Repository *>() << m_upgradeSource);
|
2015-09-04 14:37:01 +02:00
|
|
|
}
|
|
|
|
|
2016-02-26 01:27:57 +01:00
|
|
|
/*!
|
|
|
|
* \brief Ensures the repository to check and the upgrade source are both not busy.
|
|
|
|
* \returns Returns whether the repositories are busy. In this case the lookup will
|
|
|
|
* continue with the "step" requestSources() when the repos are available again.
|
|
|
|
*/
|
|
|
|
bool UpgradeLookupProcess::ensureNotBusy()
|
|
|
|
{
|
|
|
|
if(m_toCheck->isBusy()) {
|
|
|
|
connect(m_toCheck, &Repository::available, this, &UpgradeLookupProcess::requestSources);
|
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
disconnect(m_toCheck, nullptr, this, nullptr);
|
|
|
|
}
|
|
|
|
if(m_upgradeSource->isBusy()) {
|
|
|
|
connect(m_upgradeSource, &Repository::available, this, &UpgradeLookupProcess::requestSources);
|
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
disconnect(m_upgradeSource, nullptr, this, nullptr);
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-09-07 19:36:45 +02:00
|
|
|
/*!
|
|
|
|
* \class UpgradeLookup
|
|
|
|
* \brief The UpgradeLookup class performs an async upgrade lookup for using multiple upgrade sources.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Constructs a new upgrade lookup (protected since this is a pure virtual class).
|
|
|
|
*/
|
|
|
|
UpgradeLookup::UpgradeLookup(QObject *parent) :
|
2015-09-04 14:37:01 +02:00
|
|
|
QObject(parent),
|
|
|
|
m_toCheck(nullptr),
|
|
|
|
m_remainingProcesses(0),
|
|
|
|
m_firstFinished(false)
|
2015-09-07 19:36:45 +02:00
|
|
|
{}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \fn UpgradeLookup::processFinished()
|
|
|
|
* \brief Internally called when the finished() signal of an UpgradeLookupProcess instance is emitted.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \class UpgradeLookupJson
|
2015-09-11 21:59:47 +02:00
|
|
|
* \remarks The object deletes itself after the lookup is done (hence it must be created using new).
|
2015-09-07 19:36:45 +02:00
|
|
|
* \brief The UpgradeLookupJson class performs an async upgrade lookup for using multiple upgrade sources.
|
|
|
|
*
|
|
|
|
* The request and the results are in JSON.
|
|
|
|
*
|
|
|
|
* Example request:
|
|
|
|
* {
|
|
|
|
* db: "repo", repository to be checked
|
|
|
|
* syncdbs: ["extra", "community"] upgrade sources to be used
|
|
|
|
* }
|
|
|
|
*
|
|
|
|
* Example result:
|
|
|
|
* {
|
|
|
|
* softwareUpdates: [ software upgrades
|
|
|
|
* {pkg: ..., basic info of package providing upgrade
|
|
|
|
* curVer: current version
|
|
|
|
* ],
|
|
|
|
* packageOnlyUpdates: [ package-only upgrades
|
|
|
|
* {pkg: ..., basic info of package providing upgrade
|
|
|
|
* curVer: current version
|
|
|
|
* ],
|
|
|
|
* downgrades: [ downgrades
|
|
|
|
* {pkg: ..., basic info of package providing downgrade
|
|
|
|
* curVer: current version
|
|
|
|
* ]
|
|
|
|
* orphanedPackages: [ ... ] basic info of orphaned packages
|
|
|
|
* warnings: [ ... ] warnings
|
|
|
|
* errors: [ ... ] errors
|
|
|
|
* }
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \fn UpgradeLookupJson::resultsAvailable()
|
|
|
|
* \brief Emitted when all results are availabe (also in the error case).
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Constructs a new upgrade lookup for the specified \a request using the specified \a manager.
|
|
|
|
*/
|
2015-09-27 19:29:45 +02:00
|
|
|
UpgradeLookupJson::UpgradeLookupJson(Manager &manager, const QJsonObject &request, QObject *parent) :
|
2015-09-07 19:36:45 +02:00
|
|
|
UpgradeLookup(parent),
|
|
|
|
m_request(request)
|
2015-09-04 14:37:01 +02:00
|
|
|
{
|
|
|
|
const auto toCheckName = request.value(QStringLiteral("db")).toString();
|
|
|
|
if((m_toCheck = manager.repositoryByName(toCheckName))) {
|
2015-11-03 18:19:24 +01:00
|
|
|
QReadLocker toCheckLocker(m_toCheck->lock());
|
2015-09-04 14:37:01 +02:00
|
|
|
// construct upgrade lookup processes
|
|
|
|
const auto syncDbsArray = request.value(QStringLiteral("syncdbs")).toArray();
|
|
|
|
if(syncDbsArray.isEmpty()) {
|
2015-09-27 19:29:45 +02:00
|
|
|
for(auto *src : m_toCheck->upgradeSources()) {
|
2015-11-03 18:19:24 +01:00
|
|
|
QReadLocker srcLocker(src->lock());
|
2015-09-04 14:37:01 +02:00
|
|
|
new UpgradeLookupProcess(this, src);
|
|
|
|
++m_remainingProcesses;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
for(const auto &syncDbValue : syncDbsArray) {
|
|
|
|
const auto syncDbName = syncDbValue.toString();
|
2015-09-27 19:29:45 +02:00
|
|
|
if(auto *src = manager.repositoryByName(syncDbName)) {
|
2015-11-03 18:19:24 +01:00
|
|
|
QReadLocker srcLocker(src->lock());
|
2015-09-04 14:37:01 +02:00
|
|
|
new UpgradeLookupProcess(this, src);
|
|
|
|
++m_remainingProcesses;
|
|
|
|
} else {
|
|
|
|
m_warningsArray << QStringLiteral("The specified upgrade source \"%1\" can not be found.").arg(syncDbName);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// check whether any processes could be constructed
|
|
|
|
if(!m_remainingProcesses) {
|
|
|
|
m_errorsArray << QStringLiteral("No upgrade sources associated for repository \"%1\".").arg(m_toCheck->name());
|
|
|
|
} else {
|
|
|
|
return; // no errors so far
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
m_errorsArray << QStringLiteral("Repository \"%1\" can not be found.").arg(toCheckName);
|
|
|
|
}
|
|
|
|
deleteLater();
|
|
|
|
}
|
|
|
|
|
2015-09-07 19:36:45 +02:00
|
|
|
void UpgradeLookupJson::processFinished()
|
2015-09-04 14:37:01 +02:00
|
|
|
{
|
2016-02-25 22:53:33 +01:00
|
|
|
#ifdef DEBUG_BUILD
|
2015-09-04 14:37:01 +02:00
|
|
|
assert(m_remainingProcesses);
|
2016-02-25 22:53:33 +01:00
|
|
|
#endif
|
2015-09-04 14:37:01 +02:00
|
|
|
// add results
|
|
|
|
const auto &results = static_cast<UpgradeLookupProcess *>(sender())->results();
|
2015-09-07 19:36:45 +02:00
|
|
|
for(const auto &res : results.newVersions) {
|
2015-09-27 19:29:45 +02:00
|
|
|
m_softwareUpgradesArray << res.toJson();
|
2015-09-04 14:37:01 +02:00
|
|
|
}
|
2015-09-07 19:36:45 +02:00
|
|
|
for(const auto &res : results.newReleases) {
|
2015-09-27 19:29:45 +02:00
|
|
|
m_packageOnlyUpgradesArray << res.toJson();
|
2015-09-04 14:37:01 +02:00
|
|
|
}
|
2015-09-07 19:36:45 +02:00
|
|
|
for(const auto &res : results.downgrades) {
|
2015-09-27 19:29:45 +02:00
|
|
|
m_downgradesArray << res.toJson();
|
2015-09-04 14:37:01 +02:00
|
|
|
}
|
|
|
|
for(const auto &warning : results.warnings) {
|
|
|
|
m_warningsArray << warning;
|
|
|
|
}
|
|
|
|
for(const auto &error : results.errors) {
|
|
|
|
m_errorsArray << error;
|
|
|
|
}
|
|
|
|
if(m_firstFinished) {
|
|
|
|
m_orphanedPackages = m_orphanedPackages.intersect(results.orphaned);
|
|
|
|
} else {
|
|
|
|
m_firstFinished = true;
|
|
|
|
m_orphanedPackages = results.orphaned;
|
|
|
|
}
|
|
|
|
// check whether all processes are finished
|
|
|
|
if(--m_remainingProcesses == 0) {
|
|
|
|
// finally make info for orphanded packages
|
|
|
|
for(const auto *pkg : m_orphanedPackages) {
|
2015-09-21 22:16:19 +02:00
|
|
|
QJsonObject obj;
|
|
|
|
obj.insert(QStringLiteral("name"), pkg->name());
|
|
|
|
if(pkg->repository()) {
|
|
|
|
obj.insert(QStringLiteral("repo"), pkg->repository()->name());
|
|
|
|
}
|
|
|
|
obj.insert(QStringLiteral("pkg"), pkg->basicInfo());
|
|
|
|
m_orphanedPackagesArray << obj;
|
2015-09-04 14:37:01 +02:00
|
|
|
}
|
|
|
|
// add results to results QJsonObject
|
|
|
|
QJsonObject results;
|
2015-09-12 20:37:04 +02:00
|
|
|
results.insert(QStringLiteral("softwareUpgrades"), m_softwareUpgradesArray);
|
|
|
|
results.insert(QStringLiteral("packageOnlyUpgrades"), m_packageOnlyUpgradesArray);
|
2015-09-04 14:37:01 +02:00
|
|
|
results.insert(QStringLiteral("downgrades"), m_downgradesArray);
|
|
|
|
results.insert(QStringLiteral("orphanedPackages"), m_orphanedPackagesArray);
|
|
|
|
if(!m_warningsArray.isEmpty()) {
|
|
|
|
results.insert(QStringLiteral("warnings"), m_warningsArray);
|
|
|
|
}
|
|
|
|
if(!m_errorsArray.isEmpty()) {
|
|
|
|
results.insert(QStringLiteral("errors"), m_errorsArray);
|
|
|
|
}
|
2016-02-26 01:27:57 +01:00
|
|
|
emit resultsAvailable(m_request.value(QStringLiteral("w")), m_request.value(QStringLiteral("id")), results);
|
2015-09-04 14:37:01 +02:00
|
|
|
// lookup done, delete this helper object
|
|
|
|
deleteLater();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-09-07 19:36:45 +02:00
|
|
|
/*!
|
|
|
|
* \class UpgradeLookupCli
|
|
|
|
* \brief The UpgradeLookupJson class performs an async upgrade lookup for using multiple upgrade sources.
|
|
|
|
*
|
|
|
|
* The repository to be checked is specified as string. Results are printed to cerr/cout.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Constructs a new upgrade lookup for the specified \a db using the specified \a manager.
|
|
|
|
*/
|
2015-09-27 19:29:45 +02:00
|
|
|
UpgradeLookupCli::UpgradeLookupCli(Manager &manager, const string &repo, QObject *parent) :
|
2015-09-07 19:36:45 +02:00
|
|
|
UpgradeLookup(parent)
|
|
|
|
{
|
|
|
|
cerr << shchar << "Checking upgrades for \"" << repo << "\" ..." << endl;
|
|
|
|
const auto toCheckName = qstr(repo);
|
|
|
|
if((m_toCheck = manager.repositoryByName(toCheckName))) {
|
2015-11-03 18:19:24 +01:00
|
|
|
QReadLocker toCheckLocker(m_toCheck->lock());
|
2015-09-07 19:36:45 +02:00
|
|
|
// construct upgrade lookup processes
|
2015-09-27 19:29:45 +02:00
|
|
|
for(auto *src : m_toCheck->upgradeSources()) {
|
2015-11-03 18:19:24 +01:00
|
|
|
QReadLocker srcLocker(src->lock());
|
2015-09-07 19:36:45 +02:00
|
|
|
new UpgradeLookupProcess(this, src);
|
|
|
|
++m_remainingProcesses;
|
|
|
|
}
|
|
|
|
// check whether any processes could be constructed
|
|
|
|
if(!m_remainingProcesses) {
|
|
|
|
m_errorsArray << QStringLiteral("No upgrade sources associated for repository \"%1\".").arg(m_toCheck->name());
|
|
|
|
} else {
|
|
|
|
return; // no errors so far
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
m_errorsArray << QStringLiteral("Repository \"%1\" can not be found.").arg(toCheckName);
|
|
|
|
}
|
|
|
|
printResults(); // print errors
|
|
|
|
}
|
|
|
|
|
|
|
|
void UpgradeLookupCli::processFinished()
|
|
|
|
{
|
2016-02-25 22:53:33 +01:00
|
|
|
#ifdef DEBUG_BUILD
|
2015-09-07 19:36:45 +02:00
|
|
|
assert(m_remainingProcesses);
|
2016-02-25 22:53:33 +01:00
|
|
|
#endif
|
2015-09-07 19:36:45 +02:00
|
|
|
// add results
|
|
|
|
const auto &results = static_cast<UpgradeLookupProcess *>(sender())->results();
|
|
|
|
m_softwareUpgradesArray.reserve(m_softwareUpgradesArray.size() + results.newVersions.size());
|
|
|
|
m_packageOnlyUpgradesArray.reserve(m_packageOnlyUpgradesArray.size() + results.newReleases.size());
|
|
|
|
m_downgradesArray.reserve(m_downgradesArray.size() + results.downgrades.size());
|
|
|
|
m_warningsArray.reserve(m_warningsArray.size() + results.warnings.size());
|
|
|
|
m_errorsArray.reserve(m_errorsArray.size() + results.errors.size());
|
|
|
|
for(const auto &res : results.newVersions) {
|
|
|
|
m_softwareUpgradesArray << res.package->name();
|
|
|
|
}
|
|
|
|
for(const auto &res : results.newReleases) {
|
|
|
|
m_packageOnlyUpgradesArray << res.package->name();
|
|
|
|
}
|
|
|
|
for(const auto &res : results.downgrades) {
|
|
|
|
m_downgradesArray << res.package->name();
|
|
|
|
}
|
|
|
|
for(const auto &warning : results.warnings) {
|
|
|
|
m_warningsArray << warning;
|
|
|
|
}
|
|
|
|
for(const auto &error : results.errors) {
|
|
|
|
m_errorsArray << error;
|
|
|
|
}
|
|
|
|
if(m_firstFinished) {
|
|
|
|
m_orphanedPackages = m_orphanedPackages.intersect(results.orphaned);
|
|
|
|
} else {
|
|
|
|
m_firstFinished = true;
|
|
|
|
m_orphanedPackages = results.orphaned;
|
|
|
|
}
|
|
|
|
// check whether all processes are finished
|
|
|
|
if(--m_remainingProcesses == 0) {
|
|
|
|
// finally make info for orphanded packages
|
|
|
|
m_orphanedPackagesArray.reserve(m_orphanedPackages.size());
|
|
|
|
for(const auto *pkg : m_orphanedPackages) {
|
|
|
|
m_orphanedPackagesArray << pkg->name();
|
|
|
|
}
|
|
|
|
printResults();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void UpgradeLookupCli::printResults()
|
|
|
|
{
|
|
|
|
if(useShSyntax) {
|
|
|
|
if(!m_errorsArray.isEmpty()) {
|
|
|
|
Utilities::printBashArray(cerr, "REPOINDEX_ERRORS", m_errorsArray);
|
|
|
|
}
|
|
|
|
if(!m_warningsArray.isEmpty()) {
|
|
|
|
Utilities::printBashArray(cerr, "REPOINDEX_WARNINGS", m_warningsArray);
|
|
|
|
}
|
|
|
|
if(!m_softwareUpgradesArray.isEmpty()) {
|
|
|
|
Utilities::printBashArray(cout, "REPOINDEX_RESULTS_SOFTWARE_UPGRADES", m_softwareUpgradesArray);
|
|
|
|
}
|
|
|
|
if(!m_packageOnlyUpgradesArray.isEmpty()) {
|
|
|
|
Utilities::printBashArray(cout, "REPOINDEX_RESULTS_PACKAGE_UPGRADES", m_packageOnlyUpgradesArray);
|
|
|
|
}
|
|
|
|
if(!m_downgradesArray.isEmpty()) {
|
|
|
|
Utilities::printBashArray(cout, "REPOINDEX_RESULTS_DOWNGRADES", m_downgradesArray);
|
|
|
|
}
|
|
|
|
if(!m_orphanedPackagesArray.isEmpty()) {
|
|
|
|
Utilities::printBashArray(cout, "REPOINDEX_RESULTS_ORPHANED", m_orphanedPackagesArray);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if(!m_errorsArray.isEmpty()) {
|
|
|
|
Utilities::printValues(cerr, "Errors", m_errorsArray);
|
|
|
|
}
|
|
|
|
if(!m_warningsArray.isEmpty()) {
|
|
|
|
Utilities::printValues(cerr, "Warnings", m_warningsArray);
|
|
|
|
}
|
|
|
|
if(!m_softwareUpgradesArray.isEmpty()) {
|
|
|
|
Utilities::printValues(cout, "Software upgrades", m_softwareUpgradesArray);
|
|
|
|
}
|
|
|
|
if(!m_packageOnlyUpgradesArray.isEmpty()) {
|
|
|
|
Utilities::printValues(cout, "Package upgrades", m_packageOnlyUpgradesArray);
|
|
|
|
}
|
|
|
|
if(!m_downgradesArray.isEmpty()) {
|
|
|
|
Utilities::printValues(cout, "Downgrades", m_downgradesArray);
|
|
|
|
}
|
|
|
|
if(!m_orphanedPackagesArray.isEmpty()) {
|
|
|
|
Utilities::printValues(cout, "Orphaned packages", m_orphanedPackagesArray);
|
|
|
|
}
|
|
|
|
}
|
2015-09-21 22:16:19 +02:00
|
|
|
QCoreApplication::exit();
|
2015-09-07 19:36:45 +02:00
|
|
|
}
|
|
|
|
|
2015-09-04 14:37:01 +02:00
|
|
|
} // namespace PackageManagement
|