Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Package selection gets reset if update fails #120
Having an unstable connection, my update failed while it was trying to get packages. Once I clicked the Close button on the error message window, mintUpdate displayed the updates list with all of them selected, although I only had selected a few of them.
To reproduce this issue I clicked Clear to deselect all the updates, then I selected one package and I clicked Install updates. After entering my password I disabled my network and let mintUpdate fail like you see below.
W: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/b/bash-completion/bash-completion_2.1-4ubuntu0.1_all.deb
It happened just as before: I closed the error message window and all the updates were selected.
When the user clicks the Install button, Mint Update executes Synaptic to install the selected packages. We can check the last entry in the apt log to see if Synaptic actually installed any of them. If so, then we need to call the refresh thread to update the list of available packages.
On the other hand, if the connection times out or the user cancels before any packages are installed, we can skip the refresh thread and change the app status to "could not install the security updates". In this case, the packages the user had unchecked would remain unchecked.
I'll submit a PR for this...
More info: If any of the selected packages were successfully installed, then the last entry in the apt log will contain the temporary file name (f.name) and the string "End-Date".