make gconfig: fix the "(NEW)" string
PATCH 1/1 make gconfig: fix the "(NEW)" string
The string "(NEW)" is added to those options that are not present in the
current config file, thus looking as new features. Alas, the logic seem
s to be inverted.
------
diff -u linux-source-2.6.26-old/scripts/kconfig/gconf.c linux-source-2.6 .26/scripts/kconfig/gconf.c
--- linux-source-2.6.26-old/scripts/kconfig/gconf.c 2008-07-13 21:51:29.
000000000 +0000
+++ linux-source-2.6.26/scripts/kconfig/gconf.c 2009-01-03 00:52:57.0000
00000 +0000
@@ -1174,7 +1174,7 @@
row[COL_OPTION] =
g_strdup_printf("%s %s", _(menu_get_prompt(menu)),
- sym && sym_has_value(sym) ? "(NEW)" : "");
+ sym && !sym_has_value(sym) ? "(NEW)" : "");
if (show_all && !menu_is_visible(menu))
row[COL_COLOR] = g_strdup("DarkGray");
Quoted 3 lines · On Fri, 4 Dec 2009 19:38:24 +0100 (CET) [email protected] wrote:
The string "(NEW)" is added to those options that are not present in the
current config file, thus looking as new features. Alas, the logic seem
s to be inverted.
Did you just notice that thru source code inspection or via testing of gconfig?
Quoted 10 lines
Signed-off-by Matteo Cortese <[email protected]>------
diff -u
linux-source-2.6.26-old/scripts/kconfig/gconf.clinux-source-2.6.26/scripts/kconfig/gconf.c
---linux-source-2.6.26-old/scripts/kconfig/gconf.c2008-07-13 21:51:29.
000000000 +0000
+++linux-source-2.6.26/scripts/kconfig/gconf.c2009-01-03 00:52:57.0000
00000 +0000
Review
Quoted 10 lines
(quoted diff) +1
-2@@ -1174,7 +1174,7 @@ row[COL_OPTION] = g_strdup_printf("%s %s", _(menu_get_prompt(menu)), - sym && sym_has_value(sym) ? "(NEW)" : ""); + sym && !sym_has_value(sym) ? "(NEW)" : ""); if (show_all && !menu_is_visible(menu)) row[COL_COLOR] = g_strdup("DarkGray"); --
Well, for me, with just some random config file that has CONFIG_MODULES=yCONFIG_BLOCK=y
gconfig with this patch says:
Enable loadable module support
Enable the block layer (NEW)
and gconfig without this patch says:
Enable loadable module support (NEW)
Enable the block layer
I'm confuzed. Go figure.
---
~Randy
Quoted 2 lines · Randy Dunlap
Did you just notice that thru source code inspection or via testing of gconfig?
I noticed the problem with the following test case (with the patch NOT applied).
$ rm -f .config $ make clean && make gconfig
Select File->Save to save a "clean" version of .config and exit. Now let's target a specific option, e.g. CONFIG_MODULES, and check that it is present, either set to 'y' or commented out (mine is set to 'y'):
$ grep 'CONFIG_MODULES' .config CONFIG_MODULES=y $ make gconfig
At this point I see that module support has the NEW flag, but it shouldn't! Exit, then manually remove CONFIG_MODULES from the .config file:
$ sed -i '/CONFIG_MODULES/d' .config $ make clean && make gconfig
Now I see that module support is not flagged as NEW, but it should.
I concluded that the logic was inverted.
I looked up the string NEW in the source and found the piece of code cited below. Then I tried and figured out what that code was supposed to do, and thought that it made more sense that the NEW flag was added when an option (sym) had not been assigned a value yet (!sym_has_value). So I worked out this simple patch. I've been using it for some time, and it works for me, I mean, if I try the above test case, it gives the expected results.
Quoted 9 lines
Well, for me, with just some random config file that has
CONFIG_MODULES=yCONFIG_BLOCK=ygconfig with this patch says:
Enable loadable module support
Enable the block layer (NEW)
Quoted 7 lines
and gconfig without this patch says:
Enable loadable module support (NEW)
Enable the block layerI'm confuzed. Go figure.
Yes, it makes no sense. Unfortunately I have no experience with .config files generated in any other way than written by the GTK configurator...
Please bear in mind that I'm not a kernel developer, I just recompile my kernel when a new version is released. I usually copy my .config file from the previous kernel directory and then use the "NEW" flag to tell which options were added since my last compile and thus deserve my attention.
---
Matteo