]> git.sur5r.net Git - kconfig-frontends/commitdiff
Synchronise with 3.6-rc1
authorYann E. MORIN" <yann.morin.1998@free.fr>
Fri, 3 Aug 2012 21:49:37 +0000 (23:49 +0200)
committerYann E. MORIN" <yann.morin.1998@free.fr>
Fri, 3 Aug 2012 21:49:37 +0000 (23:49 +0200)
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
.version
frontends/mconf/mconf.c
frontends/nconf/nconf.c
frontends/nconf/nconf.gui.c
libs/lxdialog/textbox.c
libs/parser/confdata.c
scripts/ksync.log
utils/tweak.in
utils/tweak.in.patch

index 1aaa947489afd67d4a4002a6e2f7559cf6c22aad..4bc8c40a0ac7d67e3fabdebdde17ffe6f7c0fed3 100644 (file)
--- a/.version
+++ b/.version
@@ -1,2 +1,2 @@
-3.5.0 28a33cbc24e4256c143dce96c7d93bf423229f92 Saber-toothed Squirrel
+3.6.0-rc1 0d7614f09c1ebdbaa1599a5aba7593f147bf96ee Saber-toothed Squirrel
 hg
index f606738d421d99c29f7321236e3eebcd2ac6a760..f584a281bb4c94d240b135ba6943fe75a433b3ec 100644 (file)
@@ -105,10 +105,10 @@ static const char mconf_readme[] = N_(
 "Text Box    (Help Window)\n"
 "--------\n"
 "o  Use the cursor keys to scroll up/down/left/right.  The VI editor\n"
-"   keys h,j,k,l function here as do <SPACE BAR> and <B> for those\n"
-"   who are familiar with less and lynx.\n"
+"   keys h,j,k,l function here as do <u>, <d>, <SPACE BAR> and <B> for \n"
+"   those who are familiar with less and lynx.\n"
 "\n"
-"o  Press <E>, <X>, <Enter> or <Esc><Esc> to exit.\n"
+"o  Press <E>, <X>, <q>, <Enter> or <Esc><Esc> to exit.\n"
 "\n"
 "\n"
 "Alternate Configuration Files\n"
index 8c0eb65978c95aecedb73a7e71c6c4d788fe2255..1704a8562a5dc40ae09c23cd355958814b6976a8 100644 (file)
@@ -83,10 +83,10 @@ static const char nconf_readme[] = N_(
 "Text Box    (Help Window)\n"
 "--------\n"
 "o  Use the cursor keys to scroll up/down/left/right.  The VI editor\n"
-"   keys h,j,k,l function here as do <SPACE BAR> for those\n"
-"   who are familiar with less and lynx.\n"
+"   keys h,j,k,l function here as do <u>, <d> and <SPACE BAR> for\n"
+"   those who are familiar with less and lynx.\n"
 "\n"
-"o  Press <Enter>, <F1>, <F5>, <F7> or <Esc> to exit.\n"
+"o  Press <Enter>, <F1>, <F5>, <F9>, <q> or <Esc> to exit.\n"
 "\n"
 "\n"
 "Alternate Configuration Files\n"
@@ -1503,7 +1503,11 @@ int main(int ac, char **av)
        }
 
        notimeout(stdscr, FALSE);
+#if NCURSES_REENTRANT
+       set_escdelay(1);
+#else
        ESCDELAY = 1;
+#endif
 
        /* set btns menu */
        curses_menu = new_menu(curses_menu_items);
index 3b18dd839668b295cd3d06b1c4cac3d4c941ddf3..379003c7a2b4d8cef60e25548fcb9567ca3656c5 100644 (file)
@@ -604,9 +604,11 @@ void show_scroll_win(WINDOW *main_window,
                switch (res) {
                case KEY_NPAGE:
                case ' ':
+               case 'd':
                        start_y += text_lines-2;
                        break;
                case KEY_PPAGE:
+               case 'u':
                        start_y -= text_lines+2;
                        break;
                case KEY_HOME:
@@ -632,10 +634,10 @@ void show_scroll_win(WINDOW *main_window,
                        start_x++;
                        break;
                }
-               if (res == 10 || res == 27 || res == 'q'
-                   || res == KEY_F(F_BACK) || res == KEY_F(F_EXIT)) {
+               if (res == 10 || res == 27 || res == 'q' ||
+                       res == KEY_F(F_HELP) || res == KEY_F(F_BACK) ||
+                       res == KEY_F(F_EXIT))
                        break;
-               }
                if (start_y < 0)
                        start_y = 0;
                if (start_y >= total_lines-text_lines)
index 154c2dd245b77536de60fd344d46e49dfbe41520..4e5de60a0c0d35765d1cfb8f67a06c852c892e8a 100644 (file)
@@ -129,6 +129,7 @@ do_resize:
                case 'e':
                case 'X':
                case 'x':
+               case 'q':
                        delwin(box);
                        delwin(dialog);
                        return 0;
@@ -190,6 +191,7 @@ do_resize:
                        break;
                case 'B':       /* Previous page */
                case 'b':
+               case 'u':
                case KEY_PPAGE:
                        if (begin_reached)
                                break;
@@ -214,6 +216,7 @@ do_resize:
                        break;
                case KEY_NPAGE: /* Next page */
                case ' ':
+               case 'd':
                        if (end_reached)
                                break;
 
index 52577f052bc12d06503aa9d6459eaa578fb0fd4b..13ddf1126c2a05d82eaa8171c75ee8949d4092cc 100644 (file)
@@ -182,10 +182,66 @@ static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p)
        return 0;
 }
 
+#define LINE_GROWTH 16
+static int add_byte(int c, char **lineptr, size_t slen, size_t *n)
+{
+       char *nline;
+       size_t new_size = slen + 1;
+       if (new_size > *n) {
+               new_size += LINE_GROWTH - 1;
+               new_size *= 2;
+               nline = realloc(*lineptr, new_size);
+               if (!nline)
+                       return -1;
+
+               *lineptr = nline;
+               *n = new_size;
+       }
+
+       (*lineptr)[slen] = c;
+
+       return 0;
+}
+
+static ssize_t compat_getline(char **lineptr, size_t *n, FILE *stream)
+{
+       char *line = *lineptr;
+       size_t slen = 0;
+
+       for (;;) {
+               int c = getc(stream);
+
+               switch (c) {
+               case '\n':
+                       if (add_byte(c, &line, slen, n) < 0)
+                               goto e_out;
+                       slen++;
+                       /* fall through */
+               case EOF:
+                       if (add_byte('\0', &line, slen, n) < 0)
+                               goto e_out;
+                       *lineptr = line;
+                       if (slen == 0)
+                               return -1;
+                       return slen;
+               default:
+                       if (add_byte(c, &line, slen, n) < 0)
+                               goto e_out;
+                       slen++;
+               }
+       }
+
+e_out:
+       line[slen-1] = '\0';
+       *lineptr = line;
+       return -1;
+}
+
 int conf_read_simple(const char *name, int def)
 {
        FILE *in = NULL;
-       char line[1024];
+       char   *line = NULL;
+       size_t  line_asize = 0;
        char *p, *p2;
        struct symbol *sym;
        int i, def_flags;
@@ -247,7 +303,7 @@ load:
                }
        }
 
-       while (fgets(line, sizeof(line), in)) {
+       while (compat_getline(&line, &line_asize, in) != -1) {
                conf_lineno++;
                sym = NULL;
                if (line[0] == '#') {
@@ -335,6 +391,7 @@ setsym:
                        cs->def[def].tri = EXPR_OR(cs->def[def].tri, sym->def[def].tri);
                }
        }
+       free(line);
        fclose(in);
 
        if (modules_sym)
index 03dadd54417c5d1cc7c00ab40e8779384b839e7b..22d1e09725df4b8c9ad99b5e90ae6cbdec25fc36 100644 (file)
@@ -2,3 +2,11 @@ MCA: delete all remaining traces of microchannel bus support.
 scripts/config: properly report and set string options
 kbuild: all{no,yes,mod,def,rand}config only read files when instructed to.
 kconfig: Add error handling to KCONFIG_ALLCONFIG
+nconf: add u, d command keys in scroll windows
+menuconfig: add u, d, q command keys in text boxes
+scripts/config: fix double-quotes un-escaping
+kconfig: allow long lines in config file
+kconfig/nconf: fix compile with ncurses reentrant API
+scripts/config: add option to undef a symbol
+scripts/config: allow alternate prefix to config option symbol
+scripts/config: add option to not upper-case symbols
index ef7a64a08d2335ddab5504670b839d10242d632c..743dc54ca27743acea3e479340d7742e0f603ef3 100644 (file)
@@ -1,7 +1,8 @@
 #!/bin/bash
 # Manipulate options in a .config file from the command line
 
-CONFIG_="@CONFIG_@"
+# If no prefix forced, use the default @CONFIG_@
+CONFIG_="${CONFIG_-@CONFIG_@}"
 
 usage() {
        cat >&2 <<EOL
@@ -16,6 +17,7 @@ commands:
                             Set option to "string"
        --set-val option value
                             Set option to value
+       --undefine|-u option Undefine option
        --state|-s option    Print state of option (n,y,m,undef)
 
        --enable-after|-E beforeopt option
@@ -28,10 +30,17 @@ commands:
        commands can be repeated multiple times
 
 options:
-       --file .config file to change (default .config)
+       --file config-file   .config file to change (default .config)
+       --keep-case|-k       Keep next symbols' case (dont' upper-case it)
 
 config doesn't check the validity of the .config file. This is done at next
- make time.
+make time.
+
+By default, config will upper-case the given symbol. Use --keep-case to keep
+the case of all following symbols unchanged.
+
+config uses '@CONFIG_@' as the default symbol prefix. Set the environment
+variable CONFIG_ to the prefix to use. Eg.: CONFIG_="FOO_" config ...
 EOL
        exit 1
 }
@@ -46,6 +55,9 @@ checkarg() {
                ARG="${ARG/${CONFIG_}/}"
                ;;
        esac
+       if [ "$MUNGE_CASE" = "yes" ] ; then
+               ARG="`echo $ARG | tr a-z A-Z`"
+       fi
 }
 
 set_var() {
@@ -62,6 +74,12 @@ set_var() {
        fi
 }
 
+undef_var() {
+       local name=$1
+
+       sed -ri "/^($name=|# $name is not set)/d" "$FN"
+}
+
 if [ "$1" = "--file" ]; then
        FN="$2"
        if [ "$FN" = "" ] ; then
@@ -76,10 +94,16 @@ if [ "$1" = "" ] ; then
        usage
 fi
 
+MUNGE_CASE=yes
 while [ "$1" != "" ] ; do
        CMD="$1"
        shift
        case "$CMD" in
+       --keep-case|-k)
+               MUNGE_CASE=no
+               shift
+               continue
+               ;;
        --refresh)
                ;;
        --*-after)
@@ -117,6 +141,9 @@ while [ "$1" != "" ] ; do
                set_var "${CONFIG_}$ARG" "${CONFIG_}$ARG=$1"
                shift
                ;;
+       --undefine|-u)
+               undef_var "${CONFIG_}$ARG"
+               ;;
 
        --state|-s)
                if grep -q "# ${CONFIG_}$ARG is not set" $FN ; then
@@ -129,7 +156,7 @@ while [ "$1" != "" ] ; do
                                V="${V/#${CONFIG_}$ARG=/}"
                                V="${V/#\"/}"
                                V="${V/%\"/}"
-                               V="${V/\\\"/\"}"
+                               V="${V//\\\"/\"}"
                                echo "${V}"
                        fi
                fi
index fe8ca6836e3ca0523435a3d7c544ee5a29bec689..db365143f2c87d4493fe72ac5169f52e7c9a3ebf 100644 (file)
@@ -1,90 +1,23 @@
---- a/utils/tweak.in   2012-06-03 22:13:16.901125538 +0200
-+++ b/utils/tweak.in   2012-06-03 22:12:59.024523108 +0200
-@@ -1,6 +1,8 @@
+diff --git a/utils/tweak.in b/utils/tweak.in
+--- a/utils/tweak.in
++++ b/utils/tweak.in
+@@ -1,8 +1,8 @@
  #!/bin/bash
  # Manipulate options in a .config file from the command line
  
-+CONFIG_="@CONFIG_@"
-+
+-# If no prefix forced, use the default CONFIG_
+-CONFIG_="${CONFIG_-CONFIG_}"
++# If no prefix forced, use the default @CONFIG_@
++CONFIG_="${CONFIG_-@CONFIG_@}"
  usage() {
        cat >&2 <<EOL
- Manipulate options in a .config file from the command line.
-@@ -40,11 +43,10 @@
-               usage
-       fi
-       case "$ARG" in
--      CONFIG_*)
--              ARG="${ARG/CONFIG_/}"
-+      ${CONFIG_}*)
-+              ARG="${ARG/${CONFIG_}/}"
-               ;;
-       esac
--      ARG="`echo $ARG | tr a-z A-Z`"
- }
- set_var() {
-@@ -95,37 +97,37 @@
-       esac
-       case "$CMD" in
-       --enable|-e)
--              set_var "CONFIG_$ARG" "CONFIG_$ARG=y"
-+              set_var "${CONFIG_}$ARG" "${CONFIG_}$ARG=y"
-               ;;
-       --disable|-d)
--              set_var "CONFIG_$ARG" "# CONFIG_$ARG is not set"
-+              set_var "${CONFIG_}$ARG" "# ${CONFIG_}$ARG is not set"
-               ;;
-       --module|-m)
--              set_var "CONFIG_$ARG" "CONFIG_$ARG=m"
-+              set_var "${CONFIG_}$ARG" "${CONFIG_}$ARG=m"
-               ;;
-       --set-str)
-               # sed swallows one level of escaping, so we need double-escaping
--              set_var "CONFIG_$ARG" "CONFIG_$ARG=\"${1//\"/\\\\\"}\""
-+              set_var "${CONFIG_}$ARG" "${CONFIG_}$ARG=\"${1//\"/\\\\\"}\""
-               shift
-               ;;
-       --set-val)
--              set_var "CONFIG_$ARG" "CONFIG_$ARG=$1"
-+              set_var "${CONFIG_}$ARG" "${CONFIG_}$ARG=$1"
-               shift
-               ;;
-       --state|-s)
--              if grep -q "# CONFIG_$ARG is not set" $FN ; then
-+              if grep -q "# ${CONFIG_}$ARG is not set" $FN ; then
-                       echo n
-               else
--                      V="$(grep "^CONFIG_$ARG=" $FN)"
-+                      V="$(grep "^${CONFIG_}$ARG=" $FN)"
-                       if [ $? != 0 ] ; then
-                               echo undef
-                       else
--                              V="${V/#CONFIG_$ARG=/}"
-+                              V="${V/#${CONFIG_}$ARG=/}"
-                               V="${V/#\"/}"
-                               V="${V/%\"/}"
-                               V="${V/\\\"/\"}"
-@@ -135,15 +137,15 @@
-               ;;
-       --enable-after|-E)
--              set_var "CONFIG_$B" "CONFIG_$B=y" "CONFIG_$A"
-+              set_var "${CONFIG_}$B" "${CONFIG_}$B=y" "${CONFIG_}$A"
-               ;;
-       --disable-after|-D)
--              set_var "CONFIG_$B" "# CONFIG_$B is not set" "CONFIG_$A"
-+              set_var "${CONFIG_}$B" "# ${CONFIG_}$B is not set" "${CONFIG_}$A"
-               ;;
-       --module-after|-M)
--              set_var "CONFIG_$B" "CONFIG_$B=m" "CONFIG_$A"
-+              set_var "${CONFIG_}$B" "${CONFIG_}$B=m" "${CONFIG_}$A"
-               ;;
-       # undocumented because it ignores --file (fixme)
+@@ -39,7 +39,7 @@
+ By default, config will upper-case the given symbol. Use --keep-case to keep
+ the case of all following symbols unchanged.
+-config uses 'CONFIG_' as the default symbol prefix. Set the environment
++config uses '@CONFIG_@' as the default symbol prefix. Set the environment
+ variable CONFIG_ to the prefix to use. Eg.: CONFIG_="FOO_" config ...
+ EOL
+       exit 1