From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46363C636CA for ; Sun, 18 Jul 2021 13:28:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 21C1A6108B for ; Sun, 18 Jul 2021 13:28:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233824AbhGRNbc (ORCPT ); Sun, 18 Jul 2021 09:31:32 -0400 Received: from conssluserg-05.nifty.com ([210.131.2.90]:16732 "EHLO conssluserg-05.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232859AbhGRNbb (ORCPT ); Sun, 18 Jul 2021 09:31:31 -0400 Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) (authenticated) by conssluserg-05.nifty.com with ESMTP id 16IDSL8j001468 for ; Sun, 18 Jul 2021 22:28:21 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-05.nifty.com 16IDSL8j001468 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1626614901; bh=YHSiAnz6Je5fuj8dGcu+SNF81bL0OsgiFPsyXkM2Yo4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=IlnBKFaPQijcy8UMi/ddzFZEgDKmjmACLSGegCjRo44y74vt3vRguIRH+aAwGmc8m RUd2XCKkzZRljrWjnSZqMJrMC6VVg+wgoVxPph0E5asm1z3GqEU7eNr3/rzGCVaEgE sdDqjfHLbQWiBd+qkZ+szW9jy6UIOjEpkQaqBQoPYmGlZy+zVSRbvvRQiCWChXPRmR 5Z7T/5fIiLK++Na/1eRDKlqdBSoDzzJMPpUiyS9QHfSoTnwo0AhclJZDBaKCVwPK1z LYUVMu357hRan+zxZzNVijsqs3qOqdMBwAJOkWn3AwUFhxCCICg821O7FCBhZlvBEz brQu6vbwH9Wgw== X-Nifty-SrcIP: [209.85.216.43] Received: by mail-pj1-f43.google.com with SMTP id p9so9646072pjl.3 for ; Sun, 18 Jul 2021 06:28:21 -0700 (PDT) X-Gm-Message-State: AOAM531yfmNCI/I1yKcwPHzLjS+4FuDfHwefDaQ8Yu12GuB3rmPYGxAC hgPWfEtQHOZ2wcf60e70NJNd33L6AeXBZ90ryKQ= X-Google-Smtp-Source: ABdhPJzACnn+XtZ229M87+xlRA/X1EiKrya+Q+Egd8GXnTniie3jvjteVJ9gFACIaSKiFDtQkKWvTSkbMVSQCtLQZco= X-Received: by 2002:a17:90b:11d4:: with SMTP id gv20mr23838852pjb.87.1626614900913; Sun, 18 Jul 2021 06:28:20 -0700 (PDT) MIME-Version: 1.0 References: <87tukzgrkg.fsf@ungleich.ch> In-Reply-To: From: Masahiro Yamada Date: Sun, 18 Jul 2021 22:27:43 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3] scripts/setlocalversion: fix a bug when LOCALVERSION is empty To: Mikulas Patocka Cc: Nico Schottelius , Greg Kroah-Hartman , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 14, 2021 at 8:54 PM Masahiro Yamada wrote: > > On Tue, Jul 13, 2021 at 5:59 PM Mikulas Patocka 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