Skip to content
This repository was archived by the owner on May 1, 2022. It is now read-only.

script/setup does not inherit prior setup parameters #3

Closed
urbasus opened this issue Jun 14, 2020 · 4 comments
Closed

script/setup does not inherit prior setup parameters #3

urbasus opened this issue Jun 14, 2020 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@urbasus
Copy link
Contributor

urbasus commented Jun 14, 2020

If setting macros by script/setup and then rerun the setup, the macros set in previous setup is overwritten by new guesses. I don't think it should be like that. Inherit old setup by default (if any), and add a button for manually guessing the macros from within the setup.

@thindil thindil self-assigned this Jun 14, 2020
@thindil thindil added the enhancement New feature or request label Jun 14, 2020
@thindil
Copy link
Owner

thindil commented Jun 14, 2020

Hello, and good idea. Hmm, just not sure if I should mark it as enhancement or bug report :) I will try to do it "soon" (I hope before next Sunday)

@thindil
Copy link
Owner

thindil commented Jun 19, 2020

So, this one is added too, just in a bit different way - there is option to save settings to the file (by default it is disabled). When the setup script starts, it looking for a file settings.txt. If it found it, then load saved settings instead of guessing. I hope it can work in that way :)

@thindil thindil closed this as completed Jun 19, 2020
@urbasus
Copy link
Contributor Author

urbasus commented Jun 19, 2020

Nice! A few thoughts:

settings.txt is looked for and saved into current working directory, which is in the repository. I think it'll work just fine for my part, but it's a little unconventional. The conventional solution being to save it under .tashy in user home directory. One benefit being it'll be preserved on git clean, git clone, and download.

Second, using "file exists settings.txt" opens for a race condition on settings.txt being added or removed in between exists and open command. The solution being to open the file on script start (read-only), then see if the file handle is open. Not a big deal in this case, but best not make a habit of introducing race conditions.

@thindil
Copy link
Owner

thindil commented Jun 19, 2020

  1. Maybe another idea: default setting as is now, but allow user to set location of config file (to write and read) via console arguments. Something like wish setup.tcl --config=/put/me/here/myconf.cnf
  2. Yes, this is my bad habit from old C times :( It is not only race condition, but also slower than exception (1 I/O call instead of 2)

For now I don't want to change it for one reason: I plan to rewrite completely setup script and probably all that things will be corrected/added. For now I mostly gather information what will be need to do. I should add this task to TODO list. Unfortunately, at this moment I don't have any ETA when rewriting will starts, I'm afraid for now it is not the most important task for me.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants