Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp320850pxv; Wed, 14 Jul 2021 04:57:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWKu0NVB8E32mfoLqA4MDFz9N05hdgeHDAIEwbR66bFz1ef0WQPdZ7OgcZoKY7Bc4TZ8WK X-Received: by 2002:aa7:cb03:: with SMTP id s3mr13133687edt.189.1626263836063; Wed, 14 Jul 2021 04:57:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626263836; cv=none; d=google.com; s=arc-20160816; b=eF2e+XPSf6eUiEM/bfNqCTH7MUSlNo/LJhQ4ZoNRsAIOSvyAjPgoJWasAZi7mSZXcR EUsjMvH5xCFNyLMk5JbbzlkIR1TM7cUDpBj59ZvXv0m9y0d/i06LalGQy3W+VkmphkhA SRCjqM0wixos0dl8XXts7+td2oKxL+s6jtXvKj+Bvfj9CzJ7gMdiXtguAs+wrvvHJQVU Dar7qLhczy34IjTMIXWRCd/M2ov5U9qS8icJMT4SnG1eMyZsd1b4jP2quMcR+I0KryTq Ol8HuUr04cqwEbxm/n7p5/NW0VqYY6GkRLyao4R8JxtgZVeQcUsOhfIyHn5+/h8ZQxkv nnUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature:dkim-filter; bh=Sz3iImpUukCR0yg6rBq7bSklYInDXr9aiKQBe2KLL18=; b=jKQBgu0gYEzMpkJ9+ZDZqxuN58/PwQVx8og7jw8LzX0b17Yz7UYWtnWezKqVVgobm0 1+/Ge8LYv9k0KCrIIEikymwf8YdVWEsNtxUkMpxt/EUBpLGvMEMWY7UhSGKAVEzQ7NXW GWe2agjDxCX+DjEEmYeEzAqRBQhtF+3LQ64kFtLL2Y5m0I6oBZac8EnxiIFJ8b9gttGN eBu+fHXafxz2guBzx8GqvRi/bHelh9BACJ5A8chPtTmF6eVI+MNTp5Cxbzchp5CzCmxJ b13Sji2Dtl4hxQMsMl/4GNWPhvq2YHOoGfGq8nDo6ykYw1iUKVbF/DmmhFlhwwmvy7O1 M7fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=PoB47dgf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l6si2384402edv.341.2021.07.14.04.56.52; Wed, 14 Jul 2021 04:57:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=PoB47dgf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239249AbhGNL6H (ORCPT + 99 others); Wed, 14 Jul 2021 07:58:07 -0400 Received: from conssluserg-01.nifty.com ([210.131.2.80]:41429 "EHLO conssluserg-01.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230405AbhGNL6H (ORCPT ); Wed, 14 Jul 2021 07:58:07 -0400 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (authenticated) by conssluserg-01.nifty.com with ESMTP id 16EBssxl030572 for ; Wed, 14 Jul 2021 20:54:54 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-01.nifty.com 16EBssxl030572 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1626263694; bh=Sz3iImpUukCR0yg6rBq7bSklYInDXr9aiKQBe2KLL18=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=PoB47dgfFXBipUpE6p8yx4kxGqgP/GmHua16XAIDvNxnBsng3UaSUytsANILwwxrC z5KFUq7zxx/aQF1My/orx7fXqXunfOpJi8MglOQRpMP88eZFt+apLX6eq9RWzNhCeg k1x7mnGrE0tpm2Sov75wmMFcB8ZUHQTJ69HefKRVkFs0PXXmjV+/2ooJgujySRyc7Z ypSGlKfOirfcG1IFx67TJXcvXoYHcIw7K51mA8h5DwdXXdSO5NJUD8VoZ0gwd/jimp H/PHRP5ghAL/+y5hdjbuNueMpk/9ivoip0ONomY3Q6FJZx4WjQ6EE5HEpF1MH8/TKu TQHTFSy9N38gw== X-Nifty-SrcIP: [209.85.214.180] Received: by mail-pl1-f180.google.com with SMTP id j3so1358116plx.7 for ; Wed, 14 Jul 2021 04:54:54 -0700 (PDT) X-Gm-Message-State: AOAM530LPei2Sj+TM6h81gW8/7r77bZ2kbToOFCIBejv08H7PaV7Ig59 avB8CJtPjEjozrCT6ZcswCj25na2FkFWVipEqUU= X-Received: by 2002:a17:90a:c506:: with SMTP id k6mr3454897pjt.198.1626263693958; Wed, 14 Jul 2021 04:54:53 -0700 (PDT) MIME-Version: 1.0 References: <87tukzgrkg.fsf@ungleich.ch> In-Reply-To: From: Masahiro Yamada Date: Wed, 14 Jul 2021 20:54:17 +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 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. -- Best Regards Masahiro Yamada