Bug 394327

Summary: Discover fails to warn about reverse dependences to be removed
Product: [Applications] Discover Reporter: eemantsal <infmtk>
Component: PackageKitAssignee: Aleix Pol <aleixpol>
Status: RESOLVED FIXED    
Severity: normal CC: arojas, nate
Priority: NOR    
Version: 5.12.5   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 5.13.0
Attachments: Proof

Description eemantsal 2018-05-16 13:45:34 UTC
Using Discover to uninstall Kirigami Gallery leads to the uninstallation of half of KDE without warning about packages compiled to depend on Kirigami Gallery (Arch -Antergos, to be exact- here) being taken off if proceeding; instead, an unnoticed uninstallation of said packages takes place.
Among those various packages there are several important ones like plasma-desktop, plasma-workspace, plasma-framework, kwin...

So far I haven only noticed this behavior with the aforesaid Kirigamy Gallery package; don't know if it happes with others as well.
Comment 1 Aleix Pol 2018-05-18 15:31:01 UTC
Created attachment 112734 [details]
Proof

I've tried it and I do get a confirmation dialog. Can you please try again or give some more information?
Comment 2 Antonio Rojas 2018-05-18 17:17:30 UTC
This can be reproduced by trying to remove a package which is an *optional* dependency of another one. Packagekit will then throw an error since it can't handle the pacman warning:

PackageKit error: PackageKit::Transaction::Error(ErrorDepResolutionFailed) "Dependency resolution failed" "calligra\noptionally requires kirigami2: for Calligra Gemini\n"

and then discover will proceed to uninstall the package and all reverse dependencies anyway!
Comment 3 Antonio Rojas 2018-05-26 07:14:27 UTC
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 it anyway (potentially breaking the user's installation).
This is far from ideal, but prevents Discover from performing destructive operations while the PackageKit issues are fixed
Differential Revision: https://phabricator.kde.org/D13119

M  +6    -2    libdiscover/backends/PackageKitBackend/PKTransaction.cpp

https://commits.kde.org/discover/ee8e49422118895f0c75b5ea67308ac15d69a476
Comment 4 Aleix Pol 2018-05-28 16:06:14 UTC
Git commit c0277f806a6eab8e9850e4d022ebc0419dd8efc1 by Aleix Pol, on behalf of Antonio Rojas.
Committed on 28/05/2018 at 16:05.
Pushed by apol into branch 'Plasma/5.12'.

Abort transaction on PackageKit errors

If PackageKit throws an error, abort the transaction instead of finishing it anyway (potentially breaking the user's installation).
This is far from ideal, but prevents Discover from performing destructive operations while the PackageKit issues are fixed
Differential Revision: https://phabricator.kde.org/D13119

M  +6    -2    libdiscover/backends/PackageKitBackend/PKTransaction.cpp

https://commits.kde.org/discover/c0277f806a6eab8e9850e4d022ebc0419dd8efc1