Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow saving and loading activation state #277

Open
nephros opened this issue Feb 22, 2022 · 3 comments
Open

Allow saving and loading activation state #277

nephros opened this issue Feb 22, 2022 · 3 comments
Labels
enhancement this improves something

Comments

@nephros
Copy link
Contributor

nephros commented Feb 22, 2022

See also #272 (comment)

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.

@Olf0
Copy link
Contributor

Olf0 commented Feb 22, 2022

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.

@nephros
Copy link
Contributor Author

nephros commented Feb 25, 2022

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).

@Olf0
Copy link
Contributor

Olf0 commented Feb 25, 2022

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).

👍

nephros pushed a commit to nephros/patchmanager that referenced this issue May 26, 2023
nephros pushed a commit to nephros/patchmanager that referenced this issue Jul 10, 2023
commit 9627714
Merge: 50d3293 e74cf3e
Author: nephros <nemo@pgxperiiia10>
Date:   Tue Jun 13 23:54:10 2023 +0200

    Merge branch 'master' into recover-failures

commit 50d3293
Author: nephros <nemo@pgxperiiia10>
Date:   Thu Jun 1 08:29:02 2023 +0200

    [tool]: fix syntax

commit ac9b31c
Merge: d24ee1e 3974d0f
Author: nephros <nemo@pgxperiiia10>
Date:   Thu Jun 1 08:25:36 2023 +0200

    Merge branch 'recover-failures' of git+ssh://github.com/nephros/patchmanager into recover-failures

commit 3974d0f
Merge: 7c6611a ae85a89
Author: Peter G <[email protected]>
Date:   Tue May 30 05:16:55 2023 +0000

    Merge branch 'master' into recover-failures

commit d24ee1e
Author: nephros <nemo@pgxperiiia10>
Date:   Fri May 26 12:24:40 2023 +0200

    refresh after setting good list

commit 0fe5d47
Author: nephros <nemo@pgxperiiia10>
Date:   Fri May 26 12:24:11 2023 +0200

    only set good patches if we have any

commit 7c6611a
Author: nephros <nemo@pgxperiiia10>
Date:   Fri May 26 12:14:47 2023 +0200

    [trivial] whitespace-align help output

commit a73a4fc
Author: nephros <nemo@pgxperiiia10>
Date:   Fri May 26 12:14:20 2023 +0200

    Add "load known-good" to command line options

commit 3acc095
Author: nephros <nemo@pgxperiiia10>
Date:   Fri May 26 10:37:34 2023 +0200

    fixup! Add call to save current set as KnownGood

commit adaed74
Author: nephros <nemo@pgxperiiia10>
Date:   Fri May 26 10:27:46 2023 +0200

    Add "save as good" to command line options

commit 9c1f07d
Author: nephros <nemo@pgxperiiia10>
Date:   Fri May 26 10:19:18 2023 +0200

    Add call to save current set as KnownGood

commit 2b04ab6
Author: nephros <nemo@pgxperiiia10>
Date:   Fri May 26 09:40:44 2023 +0200

    Add option to load last-know-good patch list

    Contributes-To: sailfishos-patches#277

commit 777d43d
Author: nephros <nemo@pgxperiiia10>
Date:   Fri May 26 09:23:28 2023 +0200

    if auto applying succeded, save a known good state
nephros pushed a commit to nephros/patchmanager that referenced this issue Jul 14, 2023
commit 9627714
Merge: 50d3293 e74cf3e
Author: nephros <nemo@pgxperiiia10>
Date:   Tue Jun 13 23:54:10 2023 +0200

    Merge branch 'master' into recover-failures

commit 50d3293
Author: nephros <nemo@pgxperiiia10>
Date:   Thu Jun 1 08:29:02 2023 +0200

    [tool]: fix syntax

commit ac9b31c
Merge: d24ee1e 3974d0f
Author: nephros <nemo@pgxperiiia10>
Date:   Thu Jun 1 08:25:36 2023 +0200

    Merge branch 'recover-failures' of git+ssh://github.com/nephros/patchmanager into recover-failures

commit 3974d0f
Merge: 7c6611a ae85a89
Author: Peter G <[email protected]>
Date:   Tue May 30 05:16:55 2023 +0000

    Merge branch 'master' into recover-failures

commit d24ee1e
Author: nephros <nemo@pgxperiiia10>
Date:   Fri May 26 12:24:40 2023 +0200

    refresh after setting good list

commit 0fe5d47
Author: nephros <nemo@pgxperiiia10>
Date:   Fri May 26 12:24:11 2023 +0200

    only set good patches if we have any

commit 7c6611a
Author: nephros <nemo@pgxperiiia10>
Date:   Fri May 26 12:14:47 2023 +0200

    [trivial] whitespace-align help output

commit a73a4fc
Author: nephros <nemo@pgxperiiia10>
Date:   Fri May 26 12:14:20 2023 +0200

    Add "load known-good" to command line options

commit 3acc095
Author: nephros <nemo@pgxperiiia10>
Date:   Fri May 26 10:37:34 2023 +0200

    fixup! Add call to save current set as KnownGood

commit adaed74
Author: nephros <nemo@pgxperiiia10>
Date:   Fri May 26 10:27:46 2023 +0200

    Add "save as good" to command line options

commit 9c1f07d
Author: nephros <nemo@pgxperiiia10>
Date:   Fri May 26 10:19:18 2023 +0200

    Add call to save current set as KnownGood

commit 2b04ab6
Author: nephros <nemo@pgxperiiia10>
Date:   Fri May 26 09:40:44 2023 +0200

    Add option to load last-know-good patch list

    Contributes-To: sailfishos-patches#277

commit 777d43d
Author: nephros <nemo@pgxperiiia10>
Date:   Fri May 26 09:23:28 2023 +0200

    if auto applying succeded, save a known good state
nephros pushed a commit to nephros/patchmanager that referenced this issue Nov 26, 2024
nephros added a commit that referenced this issue Nov 27, 2024
* If auto applying succeded, save a known good state
* Add option to load last-know-good patch list
* Add call to save current set as KnownGood
* Add "save as good" to command line options
* Add "load known-good" to command line options

Contributes-To: #277

---------

Co-authored-by: nephros <nemo@pgxperiiia10>
Co-authored-by: olf <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement this improves something
Projects
None yet
Development

No branches or pull requests

2 participants