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

Feature-reqiest: Backup old options.cfg before upgrade #390

Open
hajo4 opened this issue Oct 6, 2024 · 4 comments
Open

Feature-reqiest: Backup old options.cfg before upgrade #390

hajo4 opened this issue Oct 6, 2024 · 4 comments

Comments

@hajo4
Copy link

hajo4 commented Oct 6, 2024

if installing a new version of pysol,
make a copy of the old file options.cfg to a filename like
options_old.cfg, options_v218.cfg or options_2024-09-30.cfg

@joeraz
Copy link
Collaborator

joeraz commented Oct 6, 2024

Not sure if this is needed:

  1. Most version updates do not contain any significant updates to the options.cfg file.
  2. Even when there are more significant updates, the changes are usually compatible with older versions. I tend to use both the last released version and current development version from time to time, and the options remain consistent. Worst case scenario, it's a single option that doesn't save right.
  3. The options.cfg file contains the version number it was saved from, so if there ever is a more significant update, we can catch that and handle it appropriately.

@hajo4
Copy link
Author

hajo4 commented Oct 6, 2024

well, this request is because installing pysol 3.0 lost my settings from 2.18, see
#385

@joeraz
Copy link
Collaborator

joeraz commented Oct 6, 2024

I know.

I believe it's more likely there was an issue with the file before the upgrade than it is that the upgrade itself caused it. No changes are made to the options.cfg file by the upgrade.

@joeraz
Copy link
Collaborator

joeraz commented Oct 26, 2024

So I'm going to change this one around a bit. This logic has nothing to do with the upgrade. The config will be overwritten if there's a fatal error when trying to read it (i.e. the file is corrupt), or it's missing outright. If the config file is present and valid but still treated as invalid, that is a bug, and the focus should be on fixing said bug.

I'll look into what would need to be done to duplicate the old config as a log/reference file if PySol determines it to be invalid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants