aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-05-28 13:37:56 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-28 13:37:56 -0400
commitda85d3426f52b3728671b1b1a67c6bed16915c0e (patch)
tree167d36f5ade387e77969241f6ed9ee98eca2cf86 /scripts
parent1347a2cebcb4cd6ca94eda0ebc8c5c6825bc4544 (diff)
parentd6686da814c884e341d3bd8aa54947c91cb678be (diff)
Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
Pull kconfig changes from Michal Marek: - Error handling for make KCONFIG_ALLCONFIG=<...> all*config plus a fix for a bug that was exposed by this - Fix for the script/config utility. * 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild: 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
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/config11
-rw-r--r--scripts/kconfig/conf.c22
2 files changed, 23 insertions, 10 deletions
diff --git a/scripts/config b/scripts/config
index a7c7c4b8e957..ed6653ef9702 100755
--- a/scripts/config
+++ b/scripts/config
@@ -107,7 +107,8 @@ while [ "$1" != "" ] ; do
107 ;; 107 ;;
108 108
109 --set-str) 109 --set-str)
110 set_var "CONFIG_$ARG" "CONFIG_$ARG=\"$1\"" 110 # sed swallows one level of escaping, so we need double-escaping
111 set_var "CONFIG_$ARG" "CONFIG_$ARG=\"${1//\"/\\\\\"}\""
111 shift 112 shift
112 ;; 113 ;;
113 114
@@ -124,9 +125,11 @@ while [ "$1" != "" ] ; do
124 if [ $? != 0 ] ; then 125 if [ $? != 0 ] ; then
125 echo undef 126 echo undef
126 else 127 else
127 V="${V/CONFIG_$ARG=/}" 128 V="${V/#CONFIG_$ARG=/}"
128 V="${V/\"/}" 129 V="${V/#\"/}"
129 echo "$V" 130 V="${V/%\"/}"
131 V="${V/\\\"/\"}"
132 echo "${V}"
130 fi 133 fi
131 fi 134 fi
132 ;; 135 ;;
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index f208f900ed3a..0dc4a2c779b1 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -574,8 +574,15 @@ int main(int ac, char **av)
574 case alldefconfig: 574 case alldefconfig:
575 case randconfig: 575 case randconfig:
576 name = getenv("KCONFIG_ALLCONFIG"); 576 name = getenv("KCONFIG_ALLCONFIG");
577 if (name && !stat(name, &tmpstat)) { 577 if (!name)
578 conf_read_simple(name, S_DEF_USER); 578 break;
579 if ((strcmp(name, "") != 0) && (strcmp(name, "1") != 0)) {
580 if (conf_read_simple(name, S_DEF_USER)) {
581 fprintf(stderr,
582 _("*** Can't read seed configuration \"%s\"!\n"),
583 name);
584 exit(1);
585 }
579 break; 586 break;
580 } 587 }
581 switch (input_mode) { 588 switch (input_mode) {
@@ -586,10 +593,13 @@ int main(int ac, char **av)
586 case randconfig: name = "allrandom.config"; break; 593 case randconfig: name = "allrandom.config"; break;
587 default: break; 594 default: break;
588 } 595 }
589 if (!stat(name, &tmpstat)) 596 if (conf_read_simple(name, S_DEF_USER) &&
590 conf_read_simple(name, S_DEF_USER); 597 conf_read_simple("all.config", S_DEF_USER)) {
591 else if (!stat("all.config", &tmpstat)) 598 fprintf(stderr,
592 conf_read_simple("all.config", S_DEF_USER); 599 _("*** KCONFIG_ALLCONFIG set, but no \"%s\" or \"all.config\" file found\n"),
600 name);
601 exit(1);
602 }
593 break; 603 break;
594 default: 604 default:
595 break; 605 break;