lkml.org 
[lkml]   [2021]   [Jul]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3] scripts/setlocalversion: fix a bug when LOCALVERSION is empty


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.

Mikulas

\
 
 \ /
  Last update: 2021-07-13 16:39    [W:0.100 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site