patchmanager icon indicating copy to clipboard operation
patchmanager copied to clipboard

Allow saving and loading activation state

Open nephros opened this issue 3 years ago • 3 comments

See also https://github.com/sailfishos-patches/patchmanager/pull/272#issuecomment-1047192225

For users who have a lot of patches it would be useful to have the option to restore a certain configuration of active patches.

So one can get out of failure mode quickly and with minimal hassle, and just in general.

For the first iteration I think saving a single configuration is enough, managing a list of favorite combinations is not necessary.

nephros avatar Feb 22 '22 11:02 nephros

That would be really cool, I considered to document that multiple times in the last five years. I did refrain from doing so, because it believe it is not easy to implement: The user may have uninstalled, updated or installed new Patches since writing that list.

I see two basic approaches:

  1. Either that list is permanently kept up-to-date by Patchmanager (i.e., the list is updated after activating or deactivating any Patches, but also after uninstalling an activated or updating an activated Patch, assuming only activated Patches are denoted on this list) and handled transparently, i.e., there is simply a "Restore former activation state of all Patches" after issuing a patchmanager --unapply-all at the command line or Patchmanager detecting a failure and entering "failure mode" (which also deactivates all Patches), but no other user visible interface at the GUI.
  2. Or the user explicitly saves and restores this list, but then there might be a different set of Patches and Patch versions installed when the restore action takes place, which must be handled well.

IMO approach 1 is much more usable, but might be harder to implement.

Olf0 avatar Feb 22 '22 23:02 Olf0

The list of currently active patches is already saved in the config file and updated when anything about activation state changes.

See the applied key in the [settings] section of /etc/patchmanager2.conf.

What remains is to improve the "go out of failure state" actions to restore state correctly, and the option to restore the state from that list on demand (i.e. after unapply all).

nephros avatar Feb 25 '22 08:02 nephros

The list of currently active patches is already saved in the config file and updated when anything about activation state changes. See the applied key in the [settings] section of /etc/patchmanager2.conf.

This is what I also realised after thinking about it: The "applied" state must already be stored somewhere.

What remains is to improve the "go out of failure state" actions to restore state correctly, and the option to restore the state from that list on demand (i.e. after unapply all).

:+1:

Olf0 avatar Feb 25 '22 19:02 Olf0