Skip to content

Commit

Permalink
Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/g…
Browse files Browse the repository at this point in the history
…it/mmarek/kbuild

Pull kconfig changes from Michal Marek:
 "kconfig in v3.7 is going to
   - initialize ncurses only once in menuconfig
   - be able to jump to a search result in menuconfig
   - change the misnomer oldnoconfig to a more meaningful name
     olddefconfig, keeping the old name as alias"

* 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
  kconfig: replace 'oldnoconfig' with 'olddefconfig', and keep the old name as an alias
  menuconfig: Assign jump keys per-page instead of globally
  menuconfig: Do not open code textbox scroll up/down
  menuconfig: Add jump keys to search results
  menuconfig: Extend dialog_textbox so that it can return to a scrolled position
  menuconfig: Extend dialog_textbox so that it can exit on arbitrary keypresses
  menuconfig: Remove superfluous conditionnal
  kconfig: document oldnoconfig to what it really does in conf.c
  kconfig/mconf.c: revision of curses initialization.
  • Loading branch information
torvalds committed Oct 12, 2012
2 parents ae3e462 + fb16d89 commit 35e9a27
Show file tree
Hide file tree
Showing 11 changed files with 296 additions and 138 deletions.
12 changes: 9 additions & 3 deletions scripts/kconfig/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,17 @@ PHONY += allnoconfig allyesconfig allmodconfig alldefconfig randconfig
allnoconfig allyesconfig allmodconfig alldefconfig randconfig: $(obj)/conf
$< --$@ $(Kconfig)

PHONY += listnewconfig oldnoconfig savedefconfig defconfig
PHONY += listnewconfig olddefconfig oldnoconfig savedefconfig defconfig

listnewconfig oldnoconfig: $(obj)/conf
listnewconfig olddefconfig: $(obj)/conf
$< --$@ $(Kconfig)

# oldnoconfig is an alias of olddefconfig, because people already are dependent
# on its behavior(sets new symbols to their default value but not 'n') with the
# counter-intuitive name.
oldnoconfig: $(obj)/conf
$< --olddefconfig $(Kconfig)

savedefconfig: $(obj)/conf
$< --$@=defconfig $(Kconfig)

Expand Down Expand Up @@ -114,7 +120,7 @@ help:
@echo ' alldefconfig - New config with all symbols set to default'
@echo ' randconfig - New config with random answer to all options'
@echo ' listnewconfig - List new options'
@echo ' oldnoconfig - Same as silentoldconfig but sets new symbols to their default value'
@echo ' olddefconfig - Same as silentoldconfig but sets new symbols to their default value'

# lxdialog stuff
check-lxdialog := $(srctree)/$(src)/lxdialog/check-lxdialog.sh
Expand Down
25 changes: 16 additions & 9 deletions scripts/kconfig/conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ enum input_mode {
defconfig,
savedefconfig,
listnewconfig,
oldnoconfig,
olddefconfig,
} input_mode = oldaskconfig;

static int indent = 1;
Expand Down Expand Up @@ -365,7 +365,7 @@ static void conf(struct menu *menu)
case P_MENU:
if ((input_mode == silentoldconfig ||
input_mode == listnewconfig ||
input_mode == oldnoconfig) &&
input_mode == olddefconfig) &&
rootEntry != menu) {
check_conf(menu);
return;
Expand Down Expand Up @@ -429,7 +429,7 @@ static void check_conf(struct menu *menu)
if (sym->name && !sym_is_choice_value(sym)) {
printf("%s%s\n", CONFIG_, sym->name);
}
} else if (input_mode != oldnoconfig) {
} else if (input_mode != olddefconfig) {
if (!conf_cnt++)
printf(_("*\n* Restart config...\n*\n"));
rootEntry = menu_get_parent_menu(menu);
Expand All @@ -454,7 +454,13 @@ static struct option long_opts[] = {
{"alldefconfig", no_argument, NULL, alldefconfig},
{"randconfig", no_argument, NULL, randconfig},
{"listnewconfig", no_argument, NULL, listnewconfig},
{"oldnoconfig", no_argument, NULL, oldnoconfig},
{"olddefconfig", no_argument, NULL, olddefconfig},
/*
* oldnoconfig is an alias of olddefconfig, because people already
* are dependent on its behavior(sets new symbols to their default
* value but not 'n') with the counter-intuitive name.
*/
{"oldnoconfig", no_argument, NULL, olddefconfig},
{NULL, 0, NULL, 0}
};

Expand All @@ -467,7 +473,8 @@ static void conf_usage(const char *progname)
printf(" --oldaskconfig Start a new configuration using a line-oriented program\n");
printf(" --oldconfig Update a configuration using a provided .config as base\n");
printf(" --silentoldconfig Same as oldconfig, but quietly, additionally update deps\n");
printf(" --oldnoconfig Same as silentoldconfig but set new symbols to no\n");
printf(" --olddefconfig Same as silentoldconfig but sets new symbols to their default value\n");
printf(" --oldnoconfig An alias of olddefconfig\n");
printf(" --defconfig <file> New config with default defined in <file>\n");
printf(" --savedefconfig <file> Save the minimal current configuration to <file>\n");
printf(" --allnoconfig New config where all options are answered with no\n");
Expand Down Expand Up @@ -520,7 +527,7 @@ int main(int ac, char **av)
case allmodconfig:
case alldefconfig:
case listnewconfig:
case oldnoconfig:
case olddefconfig:
break;
case '?':
conf_usage(progname);
Expand Down Expand Up @@ -565,7 +572,7 @@ int main(int ac, char **av)
case oldaskconfig:
case oldconfig:
case listnewconfig:
case oldnoconfig:
case olddefconfig:
conf_read(NULL);
break;
case allnoconfig:
Expand Down Expand Up @@ -645,15 +652,15 @@ int main(int ac, char **av)
/* fall through */
case oldconfig:
case listnewconfig:
case oldnoconfig:
case olddefconfig:
case silentoldconfig:
/* Update until a loop caused no more changes */
do {
conf_cnt = 0;
check_conf(&rootmenu);
} while (conf_cnt &&
(input_mode != listnewconfig &&
input_mode != oldnoconfig));
input_mode != olddefconfig));
break;
}

Expand Down
11 changes: 11 additions & 0 deletions scripts/kconfig/expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ extern "C" {

#include <assert.h>
#include <stdio.h>
#include <sys/queue.h>
#ifndef __cplusplus
#include <stdbool.h>
#endif
Expand Down Expand Up @@ -173,6 +174,16 @@ struct menu {
#define MENU_CHANGED 0x0001
#define MENU_ROOT 0x0002

struct jump_key {
CIRCLEQ_ENTRY(jump_key) entries;
size_t offset;
struct menu *target;
int index;
};
CIRCLEQ_HEAD(jk_head, jump_key);

#define JUMP_NB 9

extern struct file *file_list;
extern struct file *current_file;
struct file *lookup_file(const char *name);
Expand Down
6 changes: 4 additions & 2 deletions scripts/kconfig/lkc_proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ 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));
P(get_symbol_str, void, (struct gstr *r, struct symbol *sym));
P(get_relations_str, struct gstr, (struct symbol **sym_arr));
P(get_symbol_str, void, (struct gstr *r, struct symbol *sym, struct jk_head
*head));
P(get_relations_str, struct gstr, (struct symbol **sym_arr, struct jk_head
*head));
P(menu_get_ext_help,void,(struct menu *menu, struct gstr *help));

/* symbol.c */
Expand Down
9 changes: 8 additions & 1 deletion scripts/kconfig/lxdialog/dialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ struct dialog_info {
*/
extern struct dialog_info dlg;
extern char dialog_input_result[];
extern int saved_x, saved_y; /* Needed in signal handler in mconf.c */

/*
* Function prototypes
Expand Down Expand Up @@ -209,7 +210,13 @@ int first_alpha(const char *string, const char *exempt);
int dialog_yesno(const char *title, const char *prompt, int height, int width);
int dialog_msgbox(const char *title, const char *prompt, int height,
int width, int pause);
int dialog_textbox(const char *title, const char *file, int height, int width);


typedef void (*update_text_fn)(char *buf, size_t start, size_t end, void
*_data);
int dialog_textbox(const char *title, char *tbuf, int initial_height,
int initial_width, int *keys, int *_vscroll, int *_hscroll,
update_text_fn update_text, void *data);
int dialog_menu(const char *title, const char *prompt,
const void *selected, int *s_scroll);
int dialog_checklist(const char *title, const char *prompt, int height,
Expand Down
Loading

0 comments on commit 35e9a27

Please sign in to comment.