package/config: rebase from upstream (2.6.23.14)
authorPeter Korsgaard <jacmet@sunsite.dk>
Thu, 19 Jun 2008 08:11:43 +0000 (08:11 -0000)
committerPeter Korsgaard <jacmet@sunsite.dk>
Thu, 19 Jun 2008 08:11:43 +0000 (08:11 -0000)
From Bernhards tree (2737cfdd)

16 files changed:
package/config/Makefile.kconfig
package/config/README.buildroot2
package/config/conf.c
package/config/confdata.c
package/config/expr.h
package/config/gconf.c
package/config/kconfig-language.txt
package/config/kconfig-to-buildroot2.patch
package/config/kxgettext.c
package/config/lkc_proto.h
package/config/lxdialog/check-lxdialog.sh
package/config/mconf.c
package/config/menu.c
package/config/qconf.cc
package/config/zconf.tab.c_shipped
package/config/zconf.y

index 3288a2c604735fe17451802d2de030e396791246..0b70e63d240fbb1bdd8266bdff92c75e9183a1ff 100644 (file)
@@ -22,24 +22,25 @@ oldconfig: $(obj)/conf
 silentoldconfig: $(obj)/conf
        $< -s arch/$(ARCH)/Kconfig
 
+# Create new linux.po file
+# Adjust charset to UTF-8 in .po file to accept UTF-8 in Kconfig files
+# The symlink is used to repair a deficiency in arch/um
 update-po-config: $(obj)/kxgettext
-       xgettext --default-domain=linux \
-          --add-comments --keyword=_ --keyword=N_ \
-          --files-from=scripts/kconfig/POTFILES.in \
-          --output scripts/kconfig/config.pot
-       $(Q)ln -fs Kconfig_i386 arch/um/Kconfig_arch
-       $(Q)for i in `ls arch/`; \
-       do \
-         scripts/kconfig/kxgettext arch/$$i/Kconfig \
-           | msguniq -o scripts/kconfig/linux_$${i}.pot; \
-       done
-       $(Q)msgcat scripts/kconfig/config.pot \
-         `find scripts/kconfig/ -type f -name linux_*.pot` \
-         --output scripts/kconfig/linux_raw.pot
-       $(Q)msguniq --sort-by-file scripts/kconfig/linux_raw.pot \
-           --output scripts/kconfig/linux.pot
-       $(Q)rm -f arch/um/Kconfig_arch
-       $(Q)rm -f scripts/kconfig/linux_*.pot scripts/kconfig/config.pot
+       xgettext --default-domain=linux                  \
+           --add-comments --keyword=_ --keyword=N_      \
+           --from-code=UTF-8                            \
+           --files-from=scripts/kconfig/POTFILES.in     \
+           --output $(obj)/config.pot
+       $(Q)sed -i s/CHARSET/UTF-8/ $(obj)/config.pot
+       $(Q)ln -fs Kconfig.i386 arch/um/Kconfig.arch
+       (for i in `ls arch/`;                            \
+       do                                               \
+           $(obj)/kxgettext arch/$$i/Kconfig;           \
+       done ) >> $(obj)/config.pot
+       msguniq --sort-by-file --to-code=UTF-8 $(obj)/config.pot \
+           --output $(obj)/linux.pot
+       $(Q)rm -f arch/um/Kconfig.arch
+       $(Q)rm -f $(obj)/config.pot
 
 PHONY += randconfig allyesconfig allnoconfig allmodconfig defconfig
 
index 776d4fad8a3f9d9a01dad7b4706d8d75773ad4dc..8f3af624d4c8b9ed5c992b2cbc8c37e84afa1e2f 100644 (file)
@@ -1,15 +1,16 @@
-This is a copy of the kconfig code in the kernel (currently 2.6.22.7) tweaked to
-suit Buildroot.
+This is a copy of the kconfig code in the kernel (currently 2.6.23.14) tweaked
+to suit Buildroot.
 
 To update:
        cp -r /usr/src/linux/scripts/kconfig package/config.new
        cd package/config.new
        cp /usr/src/linux/Documentation/kbuild/kconfig-language.txt .
-       mv Makefile Makefile.kconfig
        patch -p1 < ../config/kconfig-to-buildroot2.patch
+       mv Makefile Makefile.kconfig
        cp ../config/README.buildroot2 .
        cp ../config/foo.h .
        cp ../config/Makefile .
+       cp ../config/kconfig-to-buildroot2.patch .
        cd ..
        rm -rf config
        mv config.new config
index bd2ca4bb61529e6cf6778100dba1d57f5f543a7a..b025d2d66bb468a7b05dd873aaa6ad770849a49e 100644 (file)
@@ -37,6 +37,14 @@ static struct menu *rootEntry;
 
 static char nohelp_text[] = N_("Sorry, no help available for this option yet.\n");
 
+static const char *get_help(struct menu *menu)
+{
+       if (menu_has_help(menu))
+               return menu_get_help(menu);
+       else
+               return nohelp_text;
+}
+
 static void strip(char *str)
 {
        char *p = str;
@@ -172,7 +180,7 @@ static int conf_askvalue(struct symbol *sym, const char *def)
 int conf_string(struct menu *menu)
 {
        struct symbol *sym = menu->sym;
-       const char *def, *help;
+       const char *def;
 
        while (1) {
                printf("%*s%s ", indent - 1, "", menu->prompt->text);
@@ -188,10 +196,7 @@ int conf_string(struct menu *menu)
                case '?':
                        /* print help */
                        if (line[1] == '\n') {
-                               help = nohelp_text;
-                               if (menu->sym->help)
-                                       help = menu->sym->help;
-                               printf("\n%s\n", menu->sym->help);
+                               printf("\n%s\n", get_help(menu));
                                def = NULL;
                                break;
                        }
@@ -209,7 +214,6 @@ static int conf_sym(struct menu *menu)
        struct symbol *sym = menu->sym;
        int type;
        tristate oldval, newval;
-       const char *help;
 
        while (1) {
                printf("%*s%s ", indent - 1, "", menu->prompt->text);
@@ -235,7 +239,7 @@ static int conf_sym(struct menu *menu)
                        printf("/m");
                if (oldval != yes && sym_tristate_within_range(sym, yes))
                        printf("/y");
-               if (sym->help)
+               if (menu_has_help(menu))
                        printf("/?");
                printf("] ");
                if (!conf_askvalue(sym, sym_get_string_value(sym)))
@@ -272,10 +276,7 @@ static int conf_sym(struct menu *menu)
                if (sym_set_tristate_value(sym, newval))
                        return 0;
 help:
-               help = nohelp_text;
-               if (sym->help)
-                       help = sym->help;
-               printf("\n%s\n", help);
+               printf("\n%s\n", get_help(menu));
        }
 }
 
@@ -345,7 +346,7 @@ static int conf_choice(struct menu *menu)
                        goto conf_childs;
                }
                printf("[1-%d", cnt);
-               if (sym->help)
+               if (menu_has_help(menu))
                        printf("?");
                printf("]: ");
                switch (input_mode) {
@@ -362,8 +363,7 @@ static int conf_choice(struct menu *menu)
                        fgets(line, 128, stdin);
                        strip(line);
                        if (line[0] == '?') {
-                               printf("\n%s\n", menu->sym->help ?
-                                       menu->sym->help : nohelp_text);
+                               printf("\n%s\n", get_help(menu));
                                continue;
                        }
                        if (!line[0])
@@ -394,8 +394,7 @@ static int conf_choice(struct menu *menu)
                if (!child)
                        continue;
                if (line[strlen(line) - 1] == '?') {
-                       printf("\n%s\n", child->sym->help ?
-                               child->sym->help : nohelp_text);
+                       printf("\n%s\n", get_help(child));
                        continue;
                }
                sym_set_choice_value(sym, child->sym);
index 838ead244f484325092de862ab83d0586d4c5688..c54c2855d5465293dda97c34735d48f77eacdb9d 100644 (file)
@@ -338,27 +338,42 @@ int conf_read(const char *name)
                conf_unsaved++;
                /* maybe print value in verbose mode... */
        sym_ok:
+               if (!sym_is_choice(sym))
+                       continue;
+               /* The choice symbol only has a set value (and thus is not new)
+                * if all its visible childs have values.
+                */
+               prop = sym_get_choice_prop(sym);
+               flags = sym->flags;
+               for (e = prop->expr; e; e = e->left.expr)
+                       if (e->right.sym->visible != no)
+                               flags &= e->right.sym->flags;
+               sym->flags &= flags | ~SYMBOL_DEF_USER;
+       }
+
+       for_all_symbols(i, sym) {
                if (sym_has_value(sym) && !sym_is_choice_value(sym)) {
-                       if (sym->visible == no)
+                       /* Reset values of generates values, so they'll appear
+                        * as new, if they should become visible, but that
+                        * doesn't quite work if the Kconfig and the saved
+                        * configuration disagree.
+                        */
+                       if (sym->visible == no && !conf_unsaved)
                                sym->flags &= ~SYMBOL_DEF_USER;
                        switch (sym->type) {
                        case S_STRING:
                        case S_INT:
                        case S_HEX:
-                               if (!sym_string_within_range(sym, sym->def[S_DEF_USER].val))
-                                       sym->flags &= ~(SYMBOL_VALID|SYMBOL_DEF_USER);
+                               /* Reset a string value if it's out of range */
+                               if (sym_string_within_range(sym, sym->def[S_DEF_USER].val))
+                                       break;
+                               sym->flags &= ~(SYMBOL_VALID|SYMBOL_DEF_USER);
+                               conf_unsaved++;
+                               break;
                        default:
                                break;
                        }
                }
-               if (!sym_is_choice(sym))
-                       continue;
-               prop = sym_get_choice_prop(sym);
-               flags = sym->flags;
-               for (e = prop->expr; e; e = e->left.expr)
-                       if (e->right.sym->visible != no)
-                               flags &= e->right.sym->flags;
-               sym->flags &= flags | ~SYMBOL_DEF_USER;
        }
 
        sym_add_change_count(conf_warnings || conf_unsaved);
index 7c047f73028f9cff815b66dff0a0731d66b62031..807e6f0440df3f3ee208559ebf1e78751ec74423 100644 (file)
@@ -71,14 +71,12 @@ enum {
 struct symbol {
        struct symbol *next;
        char *name;
-       char *help;
        enum symbol_type type;
        struct symbol_value curr;
        struct symbol_value def[4];
        tristate visible;
        int flags;
        struct property *prop;
-       struct expr *dep, *dep2;
        struct expr_value rev_dep;
 };
 
@@ -139,7 +137,7 @@ struct menu {
        struct property *prompt;
        struct expr *dep;
        unsigned int flags;
-       /*char *help; */
+       char *help;
        struct file *file;
        int lineno;
        void *data;
index 4d412709568b3fb359ab4b4e7ba9dd737465368e..afbddec65d0320e6fdff7c9f745c7db6504ff5ed 100644 (file)
@@ -38,9 +38,6 @@ static gboolean show_all = FALSE;
 static gboolean show_debug = FALSE;
 static gboolean resizeable = FALSE;
 
-static char nohelp_text[] =
-    N_("Sorry, no help available for this option yet.\n");
-
 GtkWidget *main_wnd = NULL;
 GtkWidget *tree1_w = NULL;     // left  frame
 GtkWidget *tree2_w = NULL;     // right frame
@@ -462,12 +459,9 @@ static void text_insert_help(struct menu *menu)
        GtkTextIter start, end;
        const char *prompt = menu_get_prompt(menu);
        gchar *name;
-       const char *help = _(nohelp_text);
+       const char *help;
 
-       if (!menu->sym)
-               help = "";
-       else if (menu->sym->help)
-               help = _(menu->sym->help);
+       help = _(menu_get_help(menu));
 
        if (menu->sym && menu->sym->name)
                name = g_strdup_printf(_(menu->sym->name));
index 536d5bfbdb8d390fa412d6e0b200ac980ecebecd..fe8b0c4892cf14e6f39e255ac368f150c41647c8 100644 (file)
@@ -98,6 +98,15 @@ applicable everywhere (see syntax).
   times, the limit is set to the largest selection.
   Reverse dependencies can only be used with boolean or tristate
   symbols.
+  Note:
+       select is evil.... select will by brute force set a symbol
+       equal to 'y' without visiting the dependencies. So abusing
+       select you are able to select a symbol FOO even if FOO depends
+       on BAR that is not set. In general use select only for
+       non-visible symbols (no promts anywhere) and for symbols with
+       no dependencies. That will limit the usefulness but on the
+       other hand avoid the illegal configurations all over. kconfig
+       should one day warn about such things.
 
 - numerical ranges: "range" <symbol> <symbol> ["if" <expr>]
   This allows to limit the range of possible input values for int
index d55f5ec6bf0ee5e98d29394e32a1b92ba2daff82..0132ce8d4ec8de16e8b37aa70e4757615f50b844 100644 (file)
@@ -501,15 +501,6 @@ diff -rdup kernel-config/expr.h config/expr.h
  };
  
  struct symbol {
-@@ -139,7 +139,7 @@ struct menu {
-       struct property *prompt;
-       struct expr *dep;
-       unsigned int flags;
--      //char *help;
-+      /*char *help; */
-       struct file *file;
-       int lineno;
-       void *data;
 diff -rdup kernel-config/gconf.c config/gconf.c
 --- kernel-config/gconf.c      2007-09-22 00:38:23.000000000 +0200
 +++ config/gconf.c     2007-09-23 15:33:26.000000000 +0200
index abee55ca6174ca8527476899c9ce87b5bf4a0020..6eb72a7f2562fc2d79847d8e4da2ad3ebb539a25 100644 (file)
@@ -170,8 +170,8 @@ void menu_build_message_list(struct menu *menu)
                     menu->file == NULL ? "Root Menu" : menu->file->name,
                     menu->lineno);
 
-       if (menu->sym != NULL && menu->sym->help != NULL)
-               message__add(menu->sym->help, menu->sym->name,
+       if (menu->sym != NULL && menu_has_help(menu))
+               message__add(menu_get_help(menu), menu->sym->name,
                             menu->file == NULL ? "Root Menu" : menu->file->name,
                             menu->lineno);
 
@@ -212,7 +212,9 @@ void menu__xgettext(void)
        struct message *m = message__list;
 
        while (m != NULL) {
-               message__print_gettext_msgid_msgstr(m);
+               /* skip empty lines ("") */
+               if (strlen(m->msg) > sizeof("\"\""))
+                       message__print_gettext_msgid_msgstr(m);
                m = m->next;
        }
 }
index 15030770d1ad4e937272a6f03d7d704ebad70dff..4d09f6ddefe3daa71bb9d5d8bcbe1b774b0b2821 100644 (file)
@@ -15,6 +15,8 @@ P(menu_is_visible,bool,(struct menu *menu));
 P(menu_get_prompt,const char *,(struct menu *menu));
 P(menu_get_root_menu,struct menu *,(struct menu *menu));
 P(menu_get_parent_menu,struct menu *,(struct menu *menu));
+P(menu_has_help,bool,(struct menu *menu));
+P(menu_get_help,const char *,(struct menu *menu));
 
 /* symbol.c */
 P(symbol_hash,struct symbol *,[SYMBOL_HASHSIZE]);
index cdca7388e0f1f982ae0a05994bbb7e22a6ef74b0..9681476b96e7fcf371840d78e17aa85657d327a1 100644 (file)
@@ -51,7 +51,7 @@ usage() {
        printf "Usage: $0 [-check compiler options|-header|-library]\n"
 }
 
-if [ $# == 0 ]; then
+if [ $# -eq 0 ]; then
        usage
        exit 1
 fi
index 1073f7a2929dc6b988032a75f17b1da8b66450f5..9283ac3d76ad7f49fcc00f5aba8e9b50a2d32d26 100644 (file)
@@ -417,11 +417,13 @@ static void search_conf(void)
 {
        struct symbol **sym_arr;
        struct gstr res;
+       char *dialog_input;
        int dres;
 again:
        dialog_clear();
        dres = dialog_inputbox(_("Search Configuration Parameter"),
-                             _("Enter CONFIG_ (sub)string to search for (omit CONFIG_)"),
+                             _("Enter CONFIG_ (sub)string to search for "
+                               "(with or without \"CONFIG\")"),
                              10, 75, "");
        switch (dres) {
        case 0:
@@ -433,7 +435,12 @@ again:
                return;
        }
 
-       sym_arr = sym_re_search(dialog_input_result);
+       /* strip CONFIG_ if necessary */
+       dialog_input = dialog_input_result;
+       if (strncasecmp(dialog_input_result, "CONFIG_", 7) == 0)
+               dialog_input += 7;
+
+       sym_arr = sym_re_search(dialog_input);
        res = get_relations_str(sym_arr);
        free(sym_arr);
        show_textbox(_("Search Results"), str_get(&res), 0, 0);
@@ -716,11 +723,11 @@ static void show_help(struct menu *menu)
        struct gstr help = str_new();
        struct symbol *sym = menu->sym;
 
-       if (sym->help)
+       if (menu_has_help(menu))
        {
                if (sym->name) {
                        str_printf(&help, "CONFIG_%s:\n\n", sym->name);
-                       str_append(&help, _(sym->help));
+                       str_append(&help, _(menu_get_help(menu)));
                        str_append(&help, "\n");
                }
        } else {
index f14aeac67d4f282e9e5c3edbe4a1398af1a7c4fb..f9d0d91a3fe44e2407761a60bb5a31dc22926b41 100644 (file)
@@ -417,3 +417,15 @@ struct menu *menu_get_parent_menu(struct menu *menu)
        return menu;
 }
 
+bool menu_has_help(struct menu *menu)
+{
+       return menu->help != NULL;
+}
+
+const char *menu_get_help(struct menu *menu)
+{
+       if (menu->help)
+               return menu->help;
+       else
+               return "";
+}
index f2a23a9c39386492773a9832603b13fb9ec7fb10..e4eeb59a8c24aae7065144f1618220d2f22b8cec 100644 (file)
@@ -1041,7 +1041,7 @@ void ConfigInfoView::menuInfo(void)
                if (showDebug())
                        debug = debug_info(sym);
 
-               help = print_filter(_(sym->help));
+               help = print_filter(_(menu_get_help(menu)));
        } else if (menu->prompt) {
                head += "<big><b>";
                head += print_filter(_(menu->prompt->text));
index b82ea09218ed501cb735b48000fcfc8e96ca5b67..f80c39db9f64fab7b0f1f2b59f7b8cadd59d1274 100644 (file)
@@ -1722,7 +1722,7 @@ yyreduce:
   case 83:
 
     {
-       current_entry->sym->help = (yyvsp[0].string);
+       current_entry->help = (yyvsp[0].string);
 ;}
     break;
 
@@ -2280,11 +2280,11 @@ void print_symbol(FILE *out, struct menu *menu)
                        break;
                }
        }
-       if (sym->help) {
-               int len = strlen(sym->help);
-               while (sym->help[--len] == '\n')
-                       sym->help[len] = 0;
-               fprintf(out, "  help\n%s\n", sym->help);
+       if (menu->help) {
+               int len = strlen(menu->help);
+               while (menu->help[--len] == '\n')
+                       menu->help[len] = 0;
+               fprintf(out, "  help\n%s\n", menu->help);
        }
        fputc('\n', out);
 }
index 13465c7667a0389cf31b5c4f4b160e17de2b7e62..ca435c5f971eaaf72801b2f14eb7232a6af8485b 100644 (file)
@@ -402,7 +402,7 @@ help_start: T_HELP T_EOL
 
 help: help_start T_HELPTEXT
 {
-       current_entry->sym->help = $2;
+       current_entry->help = $2;
 };
 
 /* depends option */
@@ -649,11 +649,11 @@ void print_symbol(FILE *out, struct menu *menu)
                        break;
                }
        }
-       if (sym->help) {
-               int len = strlen(sym->help);
-               while (sym->help[--len] == '\n')
-                       sym->help[len] = 0;
-               fprintf(out, "  help\n%s\n", sym->help);
+       if (menu->help) {
+               int len = strlen(menu->help);
+               while (menu->help[--len] == '\n')
+                       menu->help[len] = 0;
+               fprintf(out, "  help\n%s\n", menu->help);
        }
        fputc('\n', out);
 }