GNOME Bugzilla – Bug 785515
Let apt/dpkg in a corrupted state when interrupting an installc
Last modified: 2017-08-16 15:41:31 UTC
Using 3.25.4 on Ubuntu - select a deb package (e.g gnome-dictionary) - click on install - interrupt the install before it's finish by clicking on the corresponding button -> the system is let in a state when apt refuses to work until "dpkg --configure -a" is used
I'm guessing the allow-cancel stuff should bubble down into the GNOME UI.
Created attachment 357195 [details] [review] ok, here we go. I'm not sure about the name - what do you think? For me, it also went back to being cancellable at the end for like 0.5 seconds, but I'm not sure what that means. It's way too late to cancel at that point. I guess that was after the PkTran --- Allow plugins to say that installation can/cannot be cancelled For example - it's not safe to cancel a distro package installation after it has gone past a certain point, or else you'll end up with a broken system. Also implement this for the PackageKit plugin by propagating the allow-cancel property up.
ffs, sorry about that ...I guess that was after the PkTransaction had finished, but does it ever make sense to go from TRUE to FALSE and then back again here? We could fix it in GS so that you can't flip flop - once you say you're uncancellable that is for life.
Created attachment 357213 [details] [review] Allow plugins to say that installation can/cannot be cancelled For example - it's not safe to cancel a distro package installation after it has gone past a certain point, or else you'll end up with a broken system. Also implement this for the PackageKit plugin by propagating the allow-cancel property up. -- Take #2. This time I made the PK plugin never go from FALSE to TRUE, because I don't think that makes sense. The plugins can handle this themselves, I think, rather than trying to do it centrally. Also I remembered to set it back to TRUE after the installation is finished - maybe *that* does make sense to do centrally? In here I do it in the plugin.
The following fix has been pushed: 82bd6c4 Allow plugins to say that installation can/cannot be cancelled
Created attachment 357736 [details] [review] Allow plugins to say that installation can/cannot be cancelled For example - it's not safe to cancel a distro package installation after it has gone past a certain point, or else you'll end up with a broken system. Also implement this for the PackageKit plugin by propagating the allow-cancel property up.
This should fix the reported problem in gnome-software by not allowing you to cancel any more - the PackageKit task is tracked at https://github.com/hughsie/PackageKit/issues/209