Git commit ee8e49422118895f0c75b5ea67308ac15d69a476 by Antonio Rojas. Committed on 26/05/2018 at 07:13. Pushed by arojas into branch 'Plasma/5.13'. Abort transaction on PackageKit errors If PackageKit throws an error, abort the transaction instead of finishing i= t anyway (potentially breaking the user's installation). This is far from ideal, but prevents Discover from performing destructive o= perations while the PackageKit issues are fixed BUG: 394327 Differential Revision: https://phabricator.kde.org/D13119 M +6 -2 libdiscover/backends/PackageKitBackend/PKTransaction.cpp https://commits.kde.org/discover/ee8e49422118895f0c75b5ea67308ac15d69a476 diff --git a/libdiscover/backends/PackageKitBackend/PKTransaction.cpp b/lib= discover/backends/PackageKitBackend/PKTransaction.cpp index 5ceefad6..1431b039 100644 --- a/libdiscover/backends/PackageKitBackend/PKTransaction.cpp +++ b/libdiscover/backends/PackageKitBackend/PKTransaction.cpp @@ -137,6 +137,7 @@ void PKTransaction::cleanup(PackageKit::Transaction::Ex= it exit, uint runtime) { Q_UNUSED(runtime) const bool cancel =3D !m_proceedFunctions.isEmpty() || exit =3D=3D Pac= kageKit::Transaction::ExitCancelled; + const bool failed =3D exit =3D=3D PackageKit::Transaction::ExitFailed; const bool simulate =3D m_trans->transactionFlags() & PackageKit::Tran= saction::TransactionFlagSimulate; = disconnect(m_trans, nullptr, this, nullptr); @@ -144,7 +145,7 @@ void PKTransaction::cleanup(PackageKit::Transaction::Ex= it exit, uint runtime) = const auto backend =3D qobject_cast(resource()->ba= ckend()); = - if (!cancel && simulate) { + if (!cancel && !failed && simulate) { auto packagesToRemove =3D m_newPackageStates.value(PackageKit::Tra= nsaction::InfoRemoving); QMutableListIterator i(packagesToRemove); QSet removedResources; @@ -175,7 +176,10 @@ void PKTransaction::cleanup(PackageKit::Transaction::E= xit exit, uint runtime) } = this->submitResolve(); - setStatus(Transaction::CancelledStatus); + if (failed) + setStatus(Transaction::DoneWithErrorStatus); + else + setStatus(Transaction::CancelledStatus); } = void PKTransaction::processProceedFunction()