diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2013-02-18 19:24:26 -0500 |
---|---|---|
committer | Michal Marek <mmarek@suse.cz> | 2013-02-19 07:48:36 -0500 |
commit | 62dc989921df2a98d1a73aacd085abe941cb9828 (patch) | |
tree | 72702c0a12050ee4325f5cc8fe2a2ab8de60c362 /scripts | |
parent | 2c68115cb3d2863004f1dd5c01e3adbd54facd4c (diff) |
kbuild: Fix missing '\n' for NEW symbols in yes "" | make oldconfig >conf.new
According to Documentation/kbuild/kconfig.txt, the commands:
yes "" | make oldconfig >conf.new
grep "(NEW)" conf.new
should list the new config symbols with their default values.
However, currently there is no line break after each new symbol. When
kconfig is interactive the user will type a new-line at this point,
but when non-interactive kconfig must print it.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Reference: http://bugs.debian.org/636029
[regid23@nt1.in: Adjusted Ben's work to apply cleanly to this tree]
Reported-and-tested-by: Regid Ichira <regid23@nt1.in>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/kconfig/conf.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index 4da3b4adfad2..e39fcd8143ea 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c | |||
@@ -36,6 +36,7 @@ enum input_mode { | |||
36 | } input_mode = oldaskconfig; | 36 | } input_mode = oldaskconfig; |
37 | 37 | ||
38 | static int indent = 1; | 38 | static int indent = 1; |
39 | static int tty_stdio; | ||
39 | static int valid_stdin = 1; | 40 | static int valid_stdin = 1; |
40 | static int sync_kconfig; | 41 | static int sync_kconfig; |
41 | static int conf_cnt; | 42 | static int conf_cnt; |
@@ -108,6 +109,8 @@ static int conf_askvalue(struct symbol *sym, const char *def) | |||
108 | case oldaskconfig: | 109 | case oldaskconfig: |
109 | fflush(stdout); | 110 | fflush(stdout); |
110 | xfgets(line, 128, stdin); | 111 | xfgets(line, 128, stdin); |
112 | if (!tty_stdio) | ||
113 | printf("\n"); | ||
111 | return 1; | 114 | return 1; |
112 | default: | 115 | default: |
113 | break; | 116 | break; |
@@ -495,6 +498,8 @@ int main(int ac, char **av) | |||
495 | bindtextdomain(PACKAGE, LOCALEDIR); | 498 | bindtextdomain(PACKAGE, LOCALEDIR); |
496 | textdomain(PACKAGE); | 499 | textdomain(PACKAGE); |
497 | 500 | ||
501 | tty_stdio = isatty(0) && isatty(1) && isatty(2); | ||
502 | |||
498 | while ((opt = getopt_long(ac, av, "", long_opts, NULL)) != -1) { | 503 | while ((opt = getopt_long(ac, av, "", long_opts, NULL)) != -1) { |
499 | input_mode = (enum input_mode)opt; | 504 | input_mode = (enum input_mode)opt; |
500 | switch (opt) { | 505 | switch (opt) { |
@@ -621,7 +626,7 @@ int main(int ac, char **av) | |||
621 | return 1; | 626 | return 1; |
622 | } | 627 | } |
623 | } | 628 | } |
624 | valid_stdin = isatty(0) && isatty(1) && isatty(2); | 629 | valid_stdin = tty_stdio; |
625 | } | 630 | } |
626 | 631 | ||
627 | switch (input_mode) { | 632 | switch (input_mode) { |