linux-kbuild.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kbuild: Fix missing '\n' for NEW symbols in yes "" | make oldconfig >conf.new
@ 2013-02-19  0:24 Regid Ichira
  2013-02-19  3:37 ` Jonathan Nieder
  2013-02-19  5:39 ` Bug#636029: " Ben Hutchings
  0 siblings, 2 replies; 4+ messages in thread
From: Regid Ichira @ 2013-02-19  0:24 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Michal Marek, Ben Hutchings, Jonathan Nieder, 636029

From: Ben Hutchings <ben@decadent.org.uk>

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
Reported-by: 636029-submitter@bugs.debian.org
[regid23@nt1.in: Adjusted Ben's work to apply cleanly to this tree]
Tested-by: Regid Ichira <regid23@nt1.in>

Applied and tested to 3.8.0-rc4, on top of commit
5da1f88 - Linus Torvalds, 2013-01-18 : Merge tag 'usb-3.8-rc4' of git:/
---
 scripts/kconfig/conf.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index 4da3b4a..e39fcd8 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -36,6 +36,7 @@ enum input_mode {
 } input_mode = oldaskconfig;
 
 static int indent = 1;
+static int tty_stdio;
 static int valid_stdin = 1;
 static int sync_kconfig;
 static int conf_cnt;
@@ -108,6 +109,8 @@ static int conf_askvalue(struct symbol *sym, const char *def)
 	case oldaskconfig:
 		fflush(stdout);
 		xfgets(line, 128, stdin);
+		if (!tty_stdio)
+			printf("\n");
 		return 1;
 	default:
 		break;
@@ -495,6 +498,8 @@ int main(int ac, char **av)
 	bindtextdomain(PACKAGE, LOCALEDIR);
 	textdomain(PACKAGE);
 
+	tty_stdio = isatty(0) && isatty(1) && isatty(2);
+
 	while ((opt = getopt_long(ac, av, "", long_opts, NULL)) != -1) {
 		input_mode = (enum input_mode)opt;
 		switch (opt) {
@@ -621,7 +626,7 @@ int main(int ac, char **av)
 				return 1;
 			}
 		}
-		valid_stdin = isatty(0) && isatty(1) && isatty(2);
+		valid_stdin = tty_stdio;
 	}
 
 	switch (input_mode) {
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] kbuild: Fix missing '\n' for NEW symbols in yes "" | make oldconfig >conf.new
  2013-02-19  0:24 [PATCH] kbuild: Fix missing '\n' for NEW symbols in yes "" | make oldconfig >conf.new Regid Ichira
@ 2013-02-19  3:37 ` Jonathan Nieder
  2013-02-19  5:39 ` Bug#636029: " Ben Hutchings
  1 sibling, 0 replies; 4+ messages in thread
From: Jonathan Nieder @ 2013-02-19  3:37 UTC (permalink / raw)
  To: Regid Ichira; +Cc: linux-kbuild, Michal Marek, Ben Hutchings, 636029

Regid Ichira wrote:

> Applied and tested to 3.8.0-rc4, on top of commit
> 5da1f88 - Linus Torvalds, 2013-01-18 : Merge tag 'usb-3.8-rc4' of git:/

Thanks, Regid.  This looks like a good change, correctly implemented, so
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Bug#636029: [PATCH] kbuild: Fix missing '\n' for NEW symbols in yes "" | make oldconfig >conf.new
  2013-02-19  0:24 [PATCH] kbuild: Fix missing '\n' for NEW symbols in yes "" | make oldconfig >conf.new Regid Ichira
  2013-02-19  3:37 ` Jonathan Nieder
@ 2013-02-19  5:39 ` Ben Hutchings
  2013-02-19 12:49   ` Michal Marek
  1 sibling, 1 reply; 4+ messages in thread
From: Ben Hutchings @ 2013-02-19  5:39 UTC (permalink / raw)
  To: Regid Ichira, 636029; +Cc: linux-kbuild, Michal Marek, Jonathan Nieder

[-- Attachment #1: Type: text/plain, Size: 1118 bytes --]

On Tue, 2013-02-19 at 02:24 +0200, Regid Ichira wrote:
> From: Ben Hutchings <ben@decadent.org.uk>
> 
> 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>
> ---

Don't put a '---' here, as the following pseudo-headers should go into
the commit message.

> Reference: http://bugs.debian.org/636029
> Reported-by: 636029-submitter@bugs.debian.org

Well that's you, isn't it?

> [regid23@nt1.in: Adjusted Ben's work to apply cleanly to this tree]
> Tested-by: Regid Ichira <regid23@nt1.in>
[...]

So it should be Reported-and-tested-by: Regid Ichira <regid23@nt1.in>

Anyway, thanks for moving this forward.

Ben.

-- 
Ben Hutchings
Sturgeon's Law: Ninety percent of everything is crap.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Bug#636029: [PATCH] kbuild: Fix missing '\n' for NEW symbols in yes "" | make oldconfig >conf.new
  2013-02-19  5:39 ` Bug#636029: " Ben Hutchings
@ 2013-02-19 12:49   ` Michal Marek
  0 siblings, 0 replies; 4+ messages in thread
From: Michal Marek @ 2013-02-19 12:49 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: Regid Ichira, 636029, linux-kbuild, Jonathan Nieder

On 19.2.2013 06:39, Ben Hutchings wrote:
> On Tue, 2013-02-19 at 02:24 +0200, Regid Ichira wrote:
>> From: Ben Hutchings <ben@decadent.org.uk>
>>
>> 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>
>> ---
> 
> Don't put a '---' here, as the following pseudo-headers should go into
> the commit message.
> 
>> Reference: http://bugs.debian.org/636029
>> Reported-by: 636029-submitter@bugs.debian.org
> 
> Well that's you, isn't it?
> 
>> [regid23@nt1.in: Adjusted Ben's work to apply cleanly to this tree]
>> Tested-by: Regid Ichira <regid23@nt1.in>
> [...]
> 
> So it should be Reported-and-tested-by: Regid Ichira <regid23@nt1.in>

I applied the patch with this tag to kbuild.git#kconfig.

Michal

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-02-19 12:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-19  0:24 [PATCH] kbuild: Fix missing '\n' for NEW symbols in yes "" | make oldconfig >conf.new Regid Ichira
2013-02-19  3:37 ` Jonathan Nieder
2013-02-19  5:39 ` Bug#636029: " Ben Hutchings
2013-02-19 12:49   ` Michal Marek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).