aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2015-04-19 10:29:12 +0200
committerKarel Kočí <cynerd@email.cz>2015-04-19 10:29:12 +0200
commit58cc393c7dba864439e90a8528741e8c310a3e52 (patch)
tree2cde0b79e7b399e1bef5dfb4a27fdeeb25799559 /scripts
parent9cba4d981c00f868ce43673cc0927807d4111689 (diff)
downloadlinux-conf-perf-58cc393c7dba864439e90a8528741e8c310a3e52.tar.gz
linux-conf-perf-58cc393c7dba864439e90a8528741e8c310a3e52.tar.bz2
linux-conf-perf-58cc393c7dba864439e90a8528741e8c310a3e52.zip
write-config now checking for inconsistency in config
Diffstat (limited to 'scripts')
-rw-r--r--scripts/write_config/solution.c13
-rw-r--r--scripts/write_config/write.c99
2 files changed, 53 insertions, 59 deletions
diff --git a/scripts/write_config/solution.c b/scripts/write_config/solution.c
index fd3d2cf..03e3f53 100644
--- a/scripts/write_config/solution.c
+++ b/scripts/write_config/solution.c
@@ -26,17 +26,18 @@ void solution_set(struct symlist *sl, FILE * f) {
continue;
if (sl->array[id - 1].sym == NULL)
continue;
- tristate val = sym_get_tristate_value(sl->array[id - 1].sym);
- sym_set_tristate_value(sl->array[id - 1].sym, neg ? no : yes);
- sym_calc_value(sl->array[id - 1].sym);
+ //tristate val = sym_get_tristate_value(sl->array[id - 1].sym);
+ //sym_set_tristate_value(sl->array[id - 1].sym, neg ? no : yes);
+ //sym_calc_value(sl->array[id - 1].sym);
if (neg ==
(sym_get_tristate_value(sl->array[id - 1].sym) ==
no ? true : false))
printf("Ok\n");
else
- printf("Problem %s\n", sl->array[id - 1].sym->name);
- if (sym_get_tristate_value(sl->array[id - 1].sym) != val)
- printf("Change\n");
+ printf("Problem %s=%d/%d\n", sl->array[id - 1].sym->name,
+ !neg, sym_get_tristate_value(sl->array[id - 1].sym));
+ //if (sym_get_tristate_value(sl->array[id - 1].sym) != val)
+ //printf("Change\n");
} else {
if (w_pos >= w_size) {
w_size *= 2;
diff --git a/scripts/write_config/write.c b/scripts/write_config/write.c
index 9ba95ab..d9d10b5 100644
--- a/scripts/write_config/write.c
+++ b/scripts/write_config/write.c
@@ -12,66 +12,59 @@ int verbose_level;
char *file, *folder;
int main(int argc, char **argv) {
+ verbose_level = 1;
+ int i;
+ for (i = 1; i < argc; i++) {
+ if (!strcmp(argv[i], "-v"))
+ verbose_level++;
+ else if (file == NULL)
+ file = argv[i];
+ else if (folder == NULL)
+ folder = argv[i];
+ else {
+ Eprintf("Unknown parameter: %s\n", argv[i]);
+ exit(1);
+ }
+ }
+
+ if (file == NULL) {
+ Eprintf("No Kconfig input file specified\n");
+ exit(2);
+ }
+ if (folder == NULL) {
+ Eprintf("No output folder specified\n");
+ exit(3);
+ }
+
+ char *rules_file, *symbol_map_file, *def_config_file, *solution_file;
+ asprintf(&rules_file, "%s/%s", folder, DEFAULT_RULES_FILE);
+ asprintf(&symbol_map_file, "%s/%s", folder, DEFAULT_SYMBOL_MAP_FILE);
+ asprintf(&def_config_file, "%s/%s", folder, DEFAULT_DEF_CONFIG_FILE);
+ asprintf(&solution_file, "%s/%s", folder, DEFAULT_SOLUTION_FILE);
+
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
- conf_parse("Kconfig");
+ conf_parse(file);
+ //conf_read(def_config_file);
conf_read(".config");
- //conf_write(".config");
- /* verbose_level = 1;
- int i;
- for (i = 1; i < argc; i++) {
- if (!strcmp(argv[i], "-v"))
- verbose_level++;
- else if (file == NULL)
- file = argv[i];
- else if (folder == NULL)
- folder = argv[i];
- else {
- Eprintf("Unknown parameter: %s\n", argv[i]);
- exit(1);
- }
- }
-
- if (file == NULL) {
- Eprintf("No Kconfig input file specified\n");
- exit(2);
- }
- if (folder == NULL) {
- Eprintf("No output folder specified\n");
- exit(3);
- }
-
- char *rules_file, *symbol_map_file, *def_config_file, *solution_file;
- asprintf(&rules_file, "%s/%s", folder, DEFAULT_RULES_FILE);
- asprintf(&symbol_map_file, "%s/%s", folder, DEFAULT_SYMBOL_MAP_FILE);
- asprintf(&def_config_file, "%s/%s", folder, DEFAULT_DEF_CONFIG_FILE);
- asprintf(&solution_file, "%s/%s", folder, DEFAULT_SOLUTION_FILE);
-
- setlocale(LC_ALL, "");
- bindtextdomain(PACKAGE, LOCALEDIR);
- textdomain(PACKAGE);
-
- conf_parse(file);
- conf_read(def_config_file);
- FILE *f = fopen(symbol_map_file, "r");
- if (f == NULL) {
- Eprintf("Can't open file: %s\n", symbol_map_file);
- exit(1);
- }
- struct symlist *sl = symlist_read(f);
- fclose(f);
+ FILE *f = fopen(symbol_map_file, "r");
+ if (f == NULL) {
+ Eprintf("Can't open file: %s\n", symbol_map_file);
+ exit(1);
+ }
+ struct symlist *sl = symlist_read(f);
+ fclose(f);
- f = fopen(solution_file, "r");
- if (f == NULL) {
- Eprintf("Can't open file: %s\n", solution_file);
- exit(2);
- }
- solution_set(sl, f);
- fclose(f);
- */
+ f = fopen(solution_file, "r");
+ if (f == NULL) {
+ Eprintf("Can't open file: %s\n", solution_file);
+ exit(2);
+ }
+ solution_set(sl, f);
+ fclose(f);
return 0;
}