LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: Masahiro Yamada <masahiroy@kernel.org>,
	Nico Schottelius <nico-linuxsetlocalversion@schottelius.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] scripts/setlocalversion: fix a bug when LOCALVERSION is empty
Date: Mon, 12 Jul 2021 20:15:09 +0200	[thread overview]
Message-ID: <YOyGrUvA4LjydcP3@kroah.com> (raw)
In-Reply-To: <alpine.LRH.2.02.2107120957300.14207@file01.intranet.prod.int.rdu2.redhat.com>

On Mon, Jul 12, 2021 at 10:00:59AM -0400, Mikulas Patocka wrote:
> The patch 042da426f8ebde012be9429ff705232af7ad7469 
> ("scripts/setlocalversion: simplify the short version part") reduces the 
> indentation. Unfortunatelly, it also changes behavior in a subtle way - if 
> the user has empty "LOCALVERSION" variable, the plus sign is appended to 
> the kernel version. It wasn't appended before.
> 
> This patch reverts to the old behavior - we append the plus sign only if
> the LOCALVERSION variable is not set.
> 
> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
> Fixes: 042da426f8eb ("scripts/setlocalversion: simplify the short version part")
> 
> ---
>  scripts/setlocalversion |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Index: linux-2.6/scripts/setlocalversion
> ===================================================================
> --- linux-2.6.orig/scripts/setlocalversion	2021-07-12 15:29:07.000000000 +0200
> +++ linux-2.6/scripts/setlocalversion	2021-07-12 15:50:29.000000000 +0200
> @@ -131,7 +131,7 @@ res="${res}${CONFIG_LOCALVERSION}${LOCAL
>  if test "$CONFIG_LOCALVERSION_AUTO" = "y"; then
>  	# full scm version string
>  	res="$res$(scm_version)"
> -elif [ -z "${LOCALVERSION}" ]; then
> +elif [ "${LOCALVERSION+set}" != "set" ]; then

That's really subtle, can you add a comment here that this handles an
empty file?

thanks,

greg k-h

  reply	other threads:[~2021-07-12 18:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-12 14:00 Mikulas Patocka
2021-07-12 18:15 ` Greg Kroah-Hartman [this message]
2021-07-12 19:06   ` [PATCH v2] " Mikulas Patocka
2021-07-12 19:16     ` Greg Kroah-Hartman
2021-07-12 19:35       ` [PATCH v3] " Mikulas Patocka
2021-07-12 21:17         ` Nico Schottelius
2021-07-13  8:59           ` Mikulas Patocka
2021-07-13  9:11             ` Nico Schottelius
2021-07-13 11:43               ` Mikulas Patocka
2021-07-14 11:54             ` Masahiro Yamada
2021-07-18 13:27               ` Masahiro Yamada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YOyGrUvA4LjydcP3@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=mpatocka@redhat.com \
    --cc=nico-linuxsetlocalversion@schottelius.org \
    --subject='Re: [PATCH] scripts/setlocalversion: fix a bug when LOCALVERSION is empty' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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