Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3718016pxv; Tue, 13 Jul 2021 02:00:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyx7v5sceHn8ua962bm4NdAm6YkJc/i/niBJqyuEFbJ7AVKAAvtDLZO9S/kCy3PpW+unxDt X-Received: by 2002:a92:c60c:: with SMTP id p12mr2181159ilm.7.1626166842711; Tue, 13 Jul 2021 02:00:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626166842; cv=none; d=google.com; s=arc-20160816; b=cRfv4hXePOpeBJx1pff0Qw29XDf1DtO8H5zdgEVddnqqgBDhd/rZFTN7DG+OKakHi9 8ZJ4peCmDhE+kRXSX1tIG9uKVlL7OnamPhKWPkC9lv9vLXCc9R8XEJ8AMK3uLLyB8MT6 tyN9HdrGyEbudVwUnu3W+ZntlLdF7yqImPZu5HBaYuQ5rmCDqzKec6FiLNNBwehMhxt5 /ZMAB2UQ/bs/lFolTHDmq19mx8/ZGzZBSxkbPUgUvHMjyMFXB4p/l7ipUtXQwt3qXD7z GSsCXWduhF1cYd+h2JCOGgSJ7pqp40A/QxCExqzfsNb1J8sX+S3/3yQi1T9zVsaXrBUY I/KQ== 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=1jbljAuxlCrSmymVFLKpgjR864vr/cvdzhGXW1LdC7k=; b=siHqkG6acOGeBRmavUb87GCs9BeBJKwX8CD8D6DGH4/VNDk8zEWgI+GEtq600zaF5u 2zuOp6Qgevg2WaLmgU0qhcSfE9A4CphmTovnd9up525ltR6vdbIq55oLyXw9gfSYClYq sZCGIWaufw5VVbwVVi7QO751Szdi7yT3tTQUN7fkPu/2QKX8MVYQAXhfqLhbM74losNa hB7j4FZq+PCY1DmRQc4wfhA46Uu7x76jpkEtZYKIvuX4rpJjEDZ2qHdgoOFHecZTFgvl fG/8/GTaeexQC8eNswbdXI4Ixv3rXpjDv9X/9FnQ4scKemdVkQcyUqyytyFsoajfMBth mCNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iaDttx2W; 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 m1si23440324ilu.13.2021.07.13.02.00.26; Tue, 13 Jul 2021 02:00:42 -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=iaDttx2W; 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 S234677AbhGMJCZ (ORCPT + 99 others); Tue, 13 Jul 2021 05:02:25 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:58741 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234121AbhGMJCZ (ORCPT ); Tue, 13 Jul 2021 05:02:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626166775; 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=1jbljAuxlCrSmymVFLKpgjR864vr/cvdzhGXW1LdC7k=; b=iaDttx2WOxGUDGaYvacj4Cf3BRIqSv0wA474PUjlJLI46GrP94giU2HYveIdCyD3taUQgp UH7N2VACr53F1y9VIJcAp999VGAaIcA49kBbJKZKQJq6spveVBVXgll5QEZYiyDnEJn3wS gymOqMWRFXQB/o3MACDtyH/1Yk9PtxI= 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-562-Yq_e_LiaP8SoSh_JJgsn8g-1; Tue, 13 Jul 2021 04:59:32 -0400 X-MC-Unique: Yq_e_LiaP8SoSh_JJgsn8g-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 123378189D5; Tue, 13 Jul 2021 08:59:31 +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 D66EF5DA60; Tue, 13 Jul 2021 08:59:30 +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 16D8xU3q004057; Tue, 13 Jul 2021 04:59:30 -0400 Received: from localhost (mpatocka@localhost) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4/Submit) with ESMTP id 16D8xUNi004054; Tue, 13 Jul 2021 04:59:30 -0400 X-Authentication-Warning: file01.intranet.prod.int.rdu2.redhat.com: mpatocka owned process doing -bs Date: Tue, 13 Jul 2021 04:59:30 -0400 (EDT) From: Mikulas Patocka X-X-Sender: mpatocka@file01.intranet.prod.int.rdu2.redhat.com To: Nico Schottelius cc: 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: <87tukzgrkg.fsf@ungleich.ch> Message-ID: References: <87tukzgrkg.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.14 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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