Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp2952317pxv; Sun, 18 Jul 2021 06:29:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzlrWTYrNpXYAgnv1CxaAFvv/OpI7zY40n6dXvveORQwGNnmB1VsjoSdWndnlZMJzDODvTR X-Received: by 2002:a05:6602:3155:: with SMTP id m21mr14825752ioy.145.1626614960371; Sun, 18 Jul 2021 06:29:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626614960; cv=none; d=google.com; s=arc-20160816; b=sd5X2KOYvv4X8jXfsNNnKiJpAd10aozJ7MEWjKUQ2Pj5BoZsi/19MRRNsji/qnfoRI B5Shb1lLcdOF0J48Ts5jVRSe0stAAbX3ZIERGGvgSh7OpgodTimXNOTSnd8G0XS/KcY7 VnjeFyPAZrc4ApNMJ9mUQ6oOorg7jYyy3FSNvG3FRD4+X/Llxm1HvKiKqLNeQYglCh4/ CCh9y62cQwAOfxpLU2i1HN4m6wi2Idy7h/myIlWe0MB/RnFUJ1vySxcQxvt8YuromAY/ 61a12PfUaO4ykrCNVvBMTlUI9tBYpRporh331y+d71NfPbKxMoivpW77dVgEKxjq7eBl NFyg== 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=YHSiAnz6Je5fuj8dGcu+SNF81bL0OsgiFPsyXkM2Yo4=; b=vXuaZxc3CiU/qg0I55+zpcD5g1PWXFxPOd3Dt+/P7eRWTzUypipu7IsNrRQVAFJ1a6 2HyGsXyW8n3u1gbL4df/5dIyUG4RaeiYue6Mbt+03AhY2CZwtIrY7YQoSIM/XPQyM3jM DG3zi8PmKgAxaeAG6LHlDgiLQ3PNjQ92cuC/9fBI/ZZdiflSvm455NY1ymOjFsxIoC9X slvVBGGaVQq2pWMmc4P+9Qayar1lcTi/qvtgSzWvqtPxXuNDzfSyrFFUgZLLDrEB+MWN JGzcNyzbv2LRxwmnxohgrcK01qTzaTN78mc5ZwkLHkekmwc1L4rT3PTlCnPWv2GaVcuR 7CpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=IlnBKFaP; 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 r4si15893241ioh.93.2021.07.18.06.29.08; Sun, 18 Jul 2021 06:29:20 -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=IlnBKFaP; 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 S233746AbhGRNbc (ORCPT + 99 others); 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-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