[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#636029: [PATCH] kconfig: Fix missing line breaks in non-interactive oldconfig



reassign 636029 src:linux linux-2.6/3.0.0-1
found 636029 linux-2.6/3.1.1-1
tags 636029 + upstream patch moreinfo
quit

Hi Regid,

In July, 2011, Ben Hutchings wrote[1]:

> 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.

Sounds reasonable to me.  If you are still interested in pursuing
this, please send the patch to linux-kbuild@vger.kernel.org, cc-ing
Michal Marek <mmarek@suse.cz>, Ben, and me, in the format described in
Documentation/SubmittingPatches section 15 ("The canonical patch
format") so everyone can benefit from it.

Patch left unsnipped for reference.

Thanks,
Jonathan

[1] http://bugs.debian.org/636029

> Reported-by: Regid Ichira <regid23@yahoo.com>
> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> ---
>  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 006ad81..7ff4c6e 100644
> --- a/scripts/kconfig/conf.c
> +++ b/scripts/kconfig/conf.c
> @@ -38,6 +38,7 @@ enum input_mode {
>  char *defconfig_file;
>  
>  static int indent = 1;
> +static int tty_stdio;
>  static int valid_stdin = 1;
>  static int sync_kconfig;
>  static int conf_cnt;
> @@ -109,6 +110,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;
> @@ -466,6 +469,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) {
> @@ -572,7 +577,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.5.4


Reply to: