kconfig: fix new choices being skipped upon config update
authorArnaud Lacombe <lacombar@gmail.com>
Mon, 23 Jan 2012 22:29:05 +0000 (17:29 -0500)
committerChristian Lamparter <chunkeey@googlemail.com>
Sat, 5 May 2012 13:04:55 +0000 (15:04 +0200)
commit5d731b07c48892c5384e5c87e192c3385ce2fb90
tree8a3cdefbce7d022dde1d5002fd1e584b4d3f41e3
parentbb8077d7e3a3b8cab3fb3c3065c99fce9aeed2bc
kconfig: fix new choices being skipped upon config update

Running `oldconfig' after any of the following configuration change:

either trivial addition, such as:

config A
bool "A"

choice
prompt "Choice ?"
depends on A

config CHOICE_B
bool "Choice B"

config CHOICE_C
bool "Choice C"
endchoice

or more tricky change:

OLD KCONFIG                      |  NEW KCONFIG
                                 |
                                 |  config A
                                 |          bool "A"
                                 |
choice                           |  choice
        prompt "Choice ?"        |          prompt "Choice ?"
                                 |
        config CHOICE_C          |          config CHOICE_C
                bool "Choice C"  |                  bool "Choice C"
                                 |
        config CHOICE_D          |          config CHOICE_D
                bool "Choice D"  |                  bool "Choice D"
endchoice                        |
                                 |          config CHOICE_E
                                 |                  bool "Choice E"
                                 |                  depends on A
                                 |  endchoice

will not cause the choice to be considered as NEW, and thus not be
asked. The cause of this behavior is that choice's novelty are computed
statically right after the saved configuration has been read. At this
point, the new dependency's value is still unknown and asserted to be
`no'. Moreover, no update to this decision is made afterward.

Correct this by dynamically evaluating a choice's novelty, and removing the
static evaluation.

Reported-and-tested-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
config/confdata.c
config/symbol.c