Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3225656pxv; Mon, 12 Jul 2021 12:18:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPHVb/HE0bU+j0V5iUZwEpbv43Wgm4oiJ/lrbxBp2e3MCP4FiFCCU8YWt8hSMaT+AFWCqX X-Received: by 2002:a17:907:f98:: with SMTP id kb24mr666688ejc.554.1626117489332; Mon, 12 Jul 2021 12:18:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626117489; cv=none; d=google.com; s=arc-20160816; b=Q1XwIA63hKPKjvtXcj21rL4XsrdVf8SufWf/Rpa6USh+mdoaz+43N1Mw/bFhbDjhDq 9ALAsZk+h3oHBN4UpxlxjMhBYlLWrorA1UiWbS8FCgY6v3hJuCbvIEiZwI8tNhGHLc5o QBFVTRtAxX5A3pOqZrmfQwmZo/D712Wg60b/dh9XyK07Ma55g1UMz4EJWOP2CA0CSeVA Mobqy4Om8okCQxuKJFWaTWoBiHEAFvRYyrCXyEjQxh95UzIwaMXFEgP42ORCVFRWofm3 /S2RPbMnuvjOCdzBETDI3fE7wYmW6FVFL4/M4mj37PAXJ5rtjjbEzB76X4ZHOzvmwbYv ++NQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=NoiK1+YCYYrnMAg8P9LxqJImA4GC9IVEq69H6jbs/b4=; b=J++6P6+91ARaIk0FeT1ItXvzdTXRZ2RXWQoRgYhi4BGgw6Qr6JgaxHLOgUQKKhIKZS +KYJ0niLYIG7jrV0v5edsA8C4oHkmEU5JgFxJ2G4DxL4z6AC1lUwUGiJhfxaGTKWZhwJ m3RoCVqg8KVJi37IuQW7NOauJatvQo2kNAU2BBVAIfqsUbBmH1p6e6DnuKks39ha0NQe V1E9BXAssqPR7Be2Sp2iN7gJi4xFSoipE4wwgqLaSuwcvDYJi2wRd3Y+nApm7qJMY2LE VOqaKz/PQ4YOjrrpg9yAY1423xbQ0Tnp/xZAHXUtXu6X0tHeWnmy5WAtxttLrhf5sGWs 86PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LaAoid0g; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b5si17401792edv.330.2021.07.12.12.17.46; Mon, 12 Jul 2021 12:18:09 -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=@linuxfoundation.org header.s=korg header.b=LaAoid0g; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236273AbhGLTTi (ORCPT + 99 others); Mon, 12 Jul 2021 15:19:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:59434 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233183AbhGLTTi (ORCPT ); Mon, 12 Jul 2021 15:19:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id F0C076120A; Mon, 12 Jul 2021 19:16:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626117409; bh=IHcOwBmPaeJBX2DDHP2ZsXMyNaAXQsOnf8j8Kq3ksbk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LaAoid0gm89HjKLE0eXmC9rHlC2VegZzLpoDmHJY5j/Qca9LUGyeANuvy+IwXvMfb 59tu+mBklhBpdfQMFsJoJuNEAGDDCzSYD1o2nXIDLV9Jt9XCAGM/l6QVU/FbwkanKO b9K4//Iy79S7nE29IVeaoWkpkNUVYu7Rz3V8CNuA= Date: Mon, 12 Jul 2021 21:16:47 +0200 From: Greg Kroah-Hartman To: Mikulas Patocka Cc: Masahiro Yamada , Nico Schottelius , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] scripts/setlocalversion: fix a bug when LOCALVERSION is empty Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 12, 2021 at 03:06:48PM -0400, Mikulas Patocka wrote: > > > On Mon, 12 Jul 2021, Greg Kroah-Hartman wrote: > > > On Mon, Jul 12, 2021 at 10:00:59AM -0400, Mikulas Patocka wrote: > > > The patch 042da426f8ebde012be9429ff705232af7ad7469 > > > ("scripts/setlocalversion: simplify the short version part") reduces the > > > indentation. Unfortunatelly, it also changes behavior in a subtle way - if > > > the user has empty "LOCALVERSION" variable, the plus sign is appended to > > > the kernel version. It wasn't appended before. > > > > > > This patch reverts to the old behavior - we append the plus sign only if > > > the LOCALVERSION variable is not set. > > > > > > Signed-off-by: Mikulas Patocka > > > Fixes: 042da426f8eb ("scripts/setlocalversion: simplify the short version part") > > > > > > --- > > > scripts/setlocalversion | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > Index: linux-2.6/scripts/setlocalversion > > > =================================================================== > > > --- linux-2.6.orig/scripts/setlocalversion 2021-07-12 15:29:07.000000000 +0200 > > > +++ linux-2.6/scripts/setlocalversion 2021-07-12 15:50:29.000000000 +0200 > > > @@ -131,7 +131,7 @@ res="${res}${CONFIG_LOCALVERSION}${LOCAL > > > if test "$CONFIG_LOCALVERSION_AUTO" = "y"; then > > > # full scm version string > > > res="$res$(scm_version)" > > > -elif [ -z "${LOCALVERSION}" ]; then > > > +elif [ "${LOCALVERSION+set}" != "set" ]; then > > > > That's really subtle, can you add a comment here that this handles an > > empty file? > > > > thanks, > > > > greg k-h > > OK. > > > From: Mikulas Patocka > I can't take a patch like this :( > The patch 042da426f8ebde012be9429ff705232af7ad7469 > ("scripts/setlocalversion: simplify the short version part") reduces Properly quote commits, the documentation says you do not need to use the full sha1. > indentation. Unfortunatelly, it also changes behavior in a subtle way - if > the user has empty "LOCALVERSION" variable, the plus sign is appended to > the kernel version. It wasn't appended before. > > This patch reverts to the old behavior - we append the plus sign only if > the LOCALVERSION variable is not set. > > Signed-off-by: Mikulas Patocka > Fixes: 042da426f8eb ("scripts/setlocalversion: simplify the short version part") See, use that way to quote a commit. thanks, greg k-h