Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3822510pxv; Tue, 13 Jul 2021 04:46:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0L9a8hMGYzsz0C8f+Y28bxDRHk0t3dkU2nyjm4Nd9ElHIAev2NRLpFgIrxN0EO37a0Hw4 X-Received: by 2002:a17:906:14cf:: with SMTP id y15mr4958245ejc.124.1626176772964; Tue, 13 Jul 2021 04:46:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626176772; cv=none; d=google.com; s=arc-20160816; b=osNy7wcVROH1LixPvfEvxR+u3ZAMBSfRKoqCTDHwRA+2t3TKaDFFyOg311euPFptfw zafXMbEoBu4Ghg7Fyw4x5FuAXFBAOfPr1+pMLazdMBXjLdlZ/XRuCo64aeSn1U4Rr8nt sWcy5FnPBDszHTuXZh3eMgijYDmcAfrd81N0uz3VqvwDBJHc1nlzpCg0tFFfRkkBoFjp DOX0X9kv56Mmaq3Ruqr0Y590cQOouUkZxBK0EW27RHBW4eEvNK8il+iCkC5FfI5TJvfm NIuSRZFLKGJduQUa37RPQprVCAJStRB/ks0TNf5T5xoJ2SxSgPK4eO6m5pK4IszUsrPP GsrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature; bh=/PhPn0HsWdt3/if9m4dksmO9/1fk5RdagIKiaocN3ws=; b=0uHlVCrprRJuy2mTJCwq8MmZoPE2OP5o51iC8j55gV2Kab1qFQ291qjSpqvHG62T1W 2lPEuFmH9ZxSyK6X38yM99XtWI6nlcQk58ao7/orLE5Y+Z2z7Sk3a/l/1yC/QwghD4n/ 4Gwlox1FTuwH8R8chN0SGnBM5rC1W+c0L9nzvdgs3O4JSTS8pXQ83V5DKL6LTsqGLhS8 gyAQkllFrUx1EDaqfpMbG1/R2Joly15cDNT03O8luW7TugGxfHmt/1qqvhK8E+RQo41R 5e9Yz7jIsvd8psFinzaLqL8e3eDXB1ArwxcQoCHOH43z4W+fXv7X3vpEPVtoH74hzfrK Wa0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Nhr9Cs67; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d15si4453920ejc.258.2021.07.13.04.45.50; Tue, 13 Jul 2021 04:46:12 -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=@redhat.com header.s=mimecast20190719 header.b=Nhr9Cs67; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235900AbhGMLqh (ORCPT + 99 others); Tue, 13 Jul 2021 07:46:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:37777 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235803AbhGMLqh (ORCPT ); Tue, 13 Jul 2021 07:46:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626176627; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=/PhPn0HsWdt3/if9m4dksmO9/1fk5RdagIKiaocN3ws=; b=Nhr9Cs67GFe18Y+yL+q/lGw9wRks4FPO7fZxVKA8C3YIU6YTxqqDhQlmlprEViFttsp3ly /LQ/tVtlEfs+aEZYGI6rjJE3RDnvlfwcYV42b2AI6A4BkRO26hnoVGJDMgAVceaE0QE1Fp KviosKhyD6Myzngi4vMjmjDPGLED9wQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-53-mXR0SX6AOxmjgQ5j1nOkJw-1; Tue, 13 Jul 2021 07:43:45 -0400 X-MC-Unique: mXR0SX6AOxmjgQ5j1nOkJw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D40B91082261; Tue, 13 Jul 2021 11:43:43 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (file01.intranet.prod.int.rdu2.redhat.com [10.11.5.7]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AD08760583; Tue, 13 Jul 2021 11:43:43 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (localhost [127.0.0.1]) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4) with ESMTP id 16DBhgbj018767; Tue, 13 Jul 2021 07:43:42 -0400 Received: from localhost (mpatocka@localhost) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4/Submit) with ESMTP id 16DBhgRV018764; Tue, 13 Jul 2021 07:43:42 -0400 X-Authentication-Warning: file01.intranet.prod.int.rdu2.redhat.com: mpatocka owned process doing -bs Date: Tue, 13 Jul 2021 07:43:42 -0400 (EDT) From: Mikulas Patocka X-X-Sender: mpatocka@file01.intranet.prod.int.rdu2.redhat.com To: Nico Schottelius cc: Nico Schottelius , Greg Kroah-Hartman , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] scripts/setlocalversion: fix a bug when LOCALVERSION is empty In-Reply-To: <87r1g2h92y.fsf@ungleich.ch> Message-ID: References: <87tukzgrkg.fsf@ungleich.ch> <87r1g2h92y.fsf@ungleich.ch> User-Agent: Alpine 2.02 (LRH 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 13 Jul 2021, Nico Schottelius wrote: > > > Mikulas Patocka writes: > > 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. > > I fail to see the problem you are solving, as that case works exactly > like I wrote in my last mail: The problem is this - I have a few patches applied to the kernel and I don't want the plus sign in the kernel version. So, I set "export LOCALVERSION=". In the kernel 5.13 and previous versions, there is no plus sign at the end of version string. With the version 5.14-rc1, there is a plus sign.because of the patch 042da426f8eb. > [11:09:03] nb3:~$ export LOCALVERSION=; [ -z "${LOCALVERSION}" ] && echo unset > unset > [11:09:27] nb3:~$ echo $BASH_VERSION > 5.1.8(1)-release > > Did you try that in your environment? I tried and it and it doesn't work - the plus sign is present in the kernel version because [ -z "${LOCALVERSION}" ] return true. Mikulas