LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: Nico Schottelius <nico-linuxsetlocalversion@schottelius.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3] scripts/setlocalversion: fix a bug when LOCALVERSION is empty
Date: Sun, 18 Jul 2021 22:27:43 +0900	[thread overview]
Message-ID: <CAK7LNATTKZgTLqe87t=qBKBcvd+GW9boOQQjSRk_ES4+Lb+eug@mail.gmail.com> (raw)
In-Reply-To: <CAK7LNAQkZSyNjoxVfrKr2goP7rNB0OAPXS6B-p24=8QjDcYWFA@mail.gmail.com>

On Wed, Jul 14, 2021 at 8:54 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> On Tue, Jul 13, 2021 at 5:59 PM Mikulas Patocka <mpatocka@redhat.com> wrote:
> >
> >
> >
> > On Mon, 12 Jul 2021, Nico Schottelius wrote:
> >
> > >
> > > Sorry to say, but I am not convinced by the patch.
> > >
> > > While yes, we might have changed the behaviour slightly, reading
> > > something on the line of
> > >
> > > if [ -z ... ]
> > >
> > > is significantly more simple, elegant and easier to maintain, than
> > > a rather atypical special case for setting a variable to empty,
> > > using
> > >
> > > if [ "${LOCALVERSION+set}" != "set" ] ..
> > >
> > > *and* because it is so atypical, adding a long comment for it, too.
> > >
> > > Additonally, -z should be correct if the variable *is* truly empty. I
> > > assume it actually isn't and contains whitespace, which is not the same
> > > as being set and empty.
> > >
> > > Instead of re-adding complexity, could you consider changing the build
> > > flow so that LOCALVERSION is either unset or empty?
> > >
> > > Nico
> >
> > I set LOCALVERSION to an empty string (with "export LOCALVERSION="). This
> > prevented the kernel from adding a "+" sign to the kernel version. Since
> > the commit 042da426f8eb, it no longer works and the kernel adds a "+" sign
> > if LOCALVERSION is set and empty.
> >
> > If you don't like "if [ "${LOCALVERSION+set}" != "set" ]", then please
> > provide some other way how to test if the variable is set.
>
> if [ -z "${LOCALVERSION+set}" ]
>
> is the alternative way I came up with, but
> I am OK with your v3.
>
>
> I will pick it up for -rc2.
>
>

Applied to linux-kbuild.
Thanks.




-- 
Best Regards
Masahiro Yamada

      reply	other threads:[~2021-07-18 13:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-12 14:00 [PATCH] " Mikulas Patocka
2021-07-12 18:15 ` Greg Kroah-Hartman
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 [this message]

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='CAK7LNATTKZgTLqe87t=qBKBcvd+GW9boOQQjSRk_ES4+Lb+eug@mail.gmail.com' \
    --to=masahiroy@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpatocka@redhat.com \
    --cc=nico-linuxsetlocalversion@schottelius.org \
    --subject='Re: [PATCH v3] 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).