7432|Not savin changes on config block(included)to main file

Forum closed. All further discussion to be discussed at https://github.com/OpenKore/

Moderators: Moderators, Developers

Message
Author
Mushroom
Perl Monk
Perl Monk
Posts: 427
Joined: 04 Apr 2008, 14:04
Noob?: No
Location: Brazil

7432|Not savin changes on config block(included)to main file

#1 Post by Mushroom »

Kore is not saving changes on the values of config blocks from included file to main file. However, when config blocks from included file are not in block syntax (ex. test_0_blabla) it saves the changes normally o.O
Ex.
Main file

Code: Select all

!include test.txt
Include file (test.txt)

Code: Select all

test_config ok
test2_0_config ok2
test3 {
	config ok3
}
When openkore is running

Code: Select all

conf test_config fine
conf test2_0_config fine2
conf test2_0_config fine3
Log from above actions

Code: Select all

[Jul 31 18:13:41 2010.62] Config 'test_config' set to fine (was ok)
[Jul 31 18:13:58 2010.24] Config 'test2_0_config' set to fine2 (was ok2)
[Jul 31 18:14:07 2010.90] Config 'test3_0_config' set to fine3 (was ok3)
[Jul 31 18:14:12 2010.31] Config 'test_config' is fine
[Jul 31 18:14:17 2010.14] Config 'test2_0_config' is fine2
[Jul 31 18:14:23 2010.13] Config 'test3_0_config' is fine3
Now on main file

Code: Select all

!include test.txt
test_config fine
test2_0_config fine2
New value of test3_0_config was not saved in main file.
Quit.

EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: 7432|Not savin changes on config block(included)to main file

#2 Post by EternalHarvest »

Turns out it's done like this. Block numbering isn't something that's persistent, so creating entries like block_number_option to override block options from another file doesn't seem to be a great idea.

Possible solutions:
  • save changes into the included file directly (can break other files using the same included one)
  • create entries for blocks from anywhere, but only when block has a label and use block label instead of number (allow "blocklabel.blockoption value" syntax in config itself)
  • something completely different to provide a way to override blocks and block options

Technology
Super Moderators
Super Moderators
Posts: 801
Joined: 06 May 2008, 12:47
Noob?: No

Re: 7432|Not savin changes on config block(included)to main file

#3 Post by Technology »

So yea, maybe the numbering of blocks wasn't the best idea.
It seems like the specs that were set out years ago don't meet our expectations now.
If we don't specify the numbering ourself, kore will do this magically for us and we lose control. (using block statements)
The overriding of config.txt blocks with those in included files, however possible, is not very convenient. (as demonstrated)

I'd like to refer to the config idea that solves this problem by labeling the blocks to allow (custom) overriding.
While its just an idea, i want to see more problems we are experiencing and future idea's from you guys.
So we can develop an actual specification and code towards it.

You can compare the rather arbitrary numbering to a regular array, while you can compare the constant text labeling to an associative array (hash).
In the regular array, the order in which elements are added matters.
In a hash, the order in which elements are added doesn't matter.
One ST0 to rule them all? One PE viewer to find them!
One ST_kRO to bring them all and in the darkness bind them...

Mount Doom awaits us, fellowship of OpenKore!

Locked