Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1944923pxu; Sun, 13 Dec 2020 08:22:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJzwVnG7IhYeJUth2XrzN1GoaquSPUmlyCDNk9k4KA5NuB2w8bznMd3FTjTJ1vcnEPte1F22 X-Received: by 2002:a17:906:56ca:: with SMTP id an10mr19259741ejc.498.1607876547010; Sun, 13 Dec 2020 08:22:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607876547; cv=none; d=google.com; s=arc-20160816; b=IxAS8A28Yl2RtD8xovSEMf0ClmsTJV0JRUPOKAVoe+KqgC+oaEEJR7LI1OcUiL7FF2 tnIZjnTqSKicbRHyc+dDKPvs4koIKQxD+Wg+kFTjK7PzY3GMrQsGgH6yUhImKbpBzy3n BRFdwgyXREty2jdHp9O9G3kEhpdKS0cYQ5IvTTWYjRJ6xVX2OTAaIcGr2aZo6JA71gdj I+Q8tqmpQaDGZb1Qwc1y6OKbr5bEzaBcslVv1qwAFAx8GPRH4h/bYo0aPF5/L6E1EKfA fm64qyAcr6Rwbk2NRVRhhwb3PIsiiQbim/h8CVA56Dr/+/up5zFtkpydBBDIKL5dXqyg rliw== 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; bh=ejx1zllV9riMIJLb39YeKNcEYReY+WGzLMi9jydpHzY=; b=AJ5L4f37tCI+oiDHXF5nu8Ix2tQSdt9YJpNg466Ai+LsUok7vd1G2Xl/ehixnTqJ/r 1McsZP80QeU27eAJjz132YnPvo+CicrkjBdJDVXawNcGTbYKSy/gchDT33zGendh/KLb 4Add5JvNHo8+jL2eJTWM9ZOjUyZ/sQGiKaiDKnS1qYILHitjlJw9N4hJ4pGXgozK1uOr YfFHkMUvCFhxuTC5+8LPIeqeLZolaXIW061X0m9OKl5ZQDWqjdw6upKtmga/djuhsEP8 gI+i1qPXPufh8uK+9NhNNm1ha6vQGMRGHndeFgJQMzbomMRp61TrdRXVhCFMJNkxsq3+ X8FA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mf27si8359105ejb.129.2020.12.13.08.22.04; Sun, 13 Dec 2020 08:22:26 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437246AbgLLRbJ (ORCPT + 99 others); Sat, 12 Dec 2020 12:31:09 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:6123 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2407639AbgLLRav (ORCPT ); Sat, 12 Dec 2020 12:30:51 -0500 X-IronPort-AV: E=Sophos;i="5.78,414,1599516000"; d="scan'208";a="482633059" Received: from 173.121.68.85.rev.sfr.net (HELO hadrien) ([85.68.121.173]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Dec 2020 18:30:06 +0100 Date: Sat, 12 Dec 2020 18:30:06 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Masahiro Yamada cc: linux-kbuild@vger.kernel.org, Michal Marek , Gilles Muller , Nicolas Palix , Dominique Martinet , Matthias Maennich , linux-kernel@vger.kernel.org, cocci@systeme.lip6.fr Subject: Re: [Cocci] [PATCH 1/3] kbuild: do not use scripts/ld-version.sh for checking spatch version In-Reply-To: <20201212165431.150750-1-masahiroy@kernel.org> Message-ID: References: <20201212165431.150750-1-masahiroy@kernel.org> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 13 Dec 2020, Masahiro Yamada wrote: > scripts/ld-version.sh was, as its file name implies, originally intended > for the GNU ld version, but is (ab)used for the spatch version too. > > Use 'sort -CV' for the version comparison, then coccicheck does not need > to use scripts/ld-version.sh. Fix nsdeps as well. > > Signed-off-by: Masahiro Yamada Applied, thanks. julia > --- > > scripts/coccicheck | 14 +++++--------- > scripts/nsdeps | 4 +--- > 2 files changed, 6 insertions(+), 12 deletions(-) > > diff --git a/scripts/coccicheck b/scripts/coccicheck > index 209bb0427b43..d7f6b7ff130a 100755 > --- a/scripts/coccicheck > +++ b/scripts/coccicheck > @@ -16,7 +16,6 @@ if [ ! -x "$SPATCH" ]; then > fi > > SPATCH_VERSION=$($SPATCH --version | head -1 | awk '{print $3}') > -SPATCH_VERSION_NUM=$(echo $SPATCH_VERSION | ${DIR}/scripts/ld-version.sh) > > USE_JOBS="no" > $SPATCH --help | grep "\-\-jobs" > /dev/null && USE_JOBS="yes" > @@ -186,14 +185,11 @@ coccinelle () { > > OPT=`grep "Options:" $COCCI | cut -d':' -f2` > REQ=`grep "Requires:" $COCCI | cut -d':' -f2 | sed "s| ||"` > - REQ_NUM=$(echo $REQ | ${DIR}/scripts/ld-version.sh) > - if [ "$REQ_NUM" != "0" ] ; then > - if [ "$SPATCH_VERSION_NUM" -lt "$REQ_NUM" ] ; then > - echo "Skipping coccinelle SmPL patch: $COCCI" > - echo "You have coccinelle: $SPATCH_VERSION" > - echo "This SmPL patch requires: $REQ" > - return > - fi > + if [ -n "$REQ" ] && ! { echo "$REQ"; echo "$SPATCH_VERSION"; } | sort -CV ; then > + echo "Skipping coccinelle SmPL patch: $COCCI" > + echo "You have coccinelle: $SPATCH_VERSION" > + echo "This SmPL patch requires: $REQ" > + return > fi > > # The option '--parse-cocci' can be used to syntactically check the SmPL files. > diff --git a/scripts/nsdeps b/scripts/nsdeps > index dab4c1a0e27d..e8ce2a4d704a 100644 > --- a/scripts/nsdeps > +++ b/scripts/nsdeps > @@ -12,11 +12,9 @@ if [ ! -x "$SPATCH" ]; then > exit 1 > fi > > -SPATCH_REQ_VERSION_NUM=$(echo $SPATCH_REQ_VERSION | ${DIR}/scripts/ld-version.sh) > SPATCH_VERSION=$($SPATCH --version | head -1 | awk '{print $3}') > -SPATCH_VERSION_NUM=$(echo $SPATCH_VERSION | ${DIR}/scripts/ld-version.sh) > > -if [ "$SPATCH_VERSION_NUM" -lt "$SPATCH_REQ_VERSION_NUM" ] ; then > +if ! { echo "$SPATCH_REQ_VERSION"; echo "$SPATCH_VERSION"; } | sort -CV ; then > echo "spatch needs to be version $SPATCH_REQ_VERSION or higher" > exit 1 > fi > -- > 2.27.0 > > _______________________________________________ > Cocci mailing list > Cocci@systeme.lip6.fr > https://systeme.lip6.fr/mailman/listinfo/cocci >