From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B4BB0FA3728 for ; Wed, 16 Oct 2019 13:33:36 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 5584F2168B for ; Wed, 16 Oct 2019 13:33:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5584F2168B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B54AA1E89F; Wed, 16 Oct 2019 15:33:35 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id B3EB91E899 for ; Wed, 16 Oct 2019 15:33:33 +0200 (CEST) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Oct 2019 06:33:32 -0700 X-IronPort-AV: E=Sophos;i="5.67,303,1566889200"; d="scan'208";a="186150716" Received: from bricha3-mobl.ger.corp.intel.com ([10.237.221.95]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 16 Oct 2019 06:33:30 -0700 Date: Wed, 16 Oct 2019 14:33:27 +0100 From: Bruce Richardson To: Anatoly Burakov Cc: dev@dpdk.org, john.mcnamara@intel.com, thomas@monjalon.net, david.marchand@redhat.com Message-ID: <20191016133327.GC720@bricha3-MOBL.ger.corp.intel.com> References: <20190930092139.2440-1-marcinx.baran@intel.com> <7e135578ac7858ac5b1af4f4b4e042743ab3fdd8.1571229052.git.anatoly.burakov@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7e135578ac7858ac5b1af4f4b4e042743ab3fdd8.1571229052.git.anatoly.burakov@intel.com> User-Agent: Mutt/1.12.1 (2019-06-15) Subject: Re: [dpdk-dev] [PATCH v2 03/10] buildtools: add ABI update shell script X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, Oct 16, 2019 at 01:43:18PM +0100, Anatoly Burakov wrote: > In order to facilitate mass updating of version files, add a shell > script that recurses into lib/ and drivers/ directories and calls > the ABI version update script. > > Signed-off-by: Anatoly Burakov > --- > > Notes: > v2: > - Add this patch to split the shell script from previous commit > - Fixup miscellaneous bugs > > buildtools/update-abi.sh | 36 ++++++++++++++++++++++++++++++++++++ > 1 file changed, 36 insertions(+) > create mode 100755 buildtools/update-abi.sh > > diff --git a/buildtools/update-abi.sh b/buildtools/update-abi.sh > new file mode 100755 > index 0000000000..a6f916a437 > --- /dev/null > +++ b/buildtools/update-abi.sh > @@ -0,0 +1,36 @@ > +#!/bin/bash Does this actually need to be bash? Most of our scripts use plain "sh". Also on FreeBSD bash is generally in /usr/local/bin not /bin. > +# SPDX-License-Identifier: BSD-3-Clause > +# Copyright(c) 2019 Intel Corporation > + > +abi_version="" > +abi_version_file="./config/ABI_VERSION" > +update_path="lib drivers" > + > +if [ -z "$1" ] > +then While there are a few scripts in DPDK putting the "then" on the next line most scripts put it on the same line as the "if", after a ";". > + # output to stderr > + >&2 echo "provide ABI version" > + exit 1 > +fi > + > +abi_version=$1 I think you can just do this assignment at the top when you define abi_version in the first place. Using $1 when it doesn't exist isn't a problem. > + > +if [ -n "$2" ] > +then > + abi_version_file=$2 > +fi > + > +if [ -n "$3" ] > +then > + update_path=${@:3} I think this might be a bash-ism, right? If so, I think using "shift" and then directly using $@ should work instead to make it sh-compatible.. > +fi > + > +echo "New ABI version:" $abi_version > +echo "ABI_VERSION path:" $abi_version_file > +echo "Path to update:" $update_path > + > +echo $abi_version > $abi_version_file Do we need to check the abi_version provided is in the correct format? Should it have both major and minor components, or just major. I think the former, so we can do minor bumps which keeping major compatibility. > + > +find $update_path -name \*version.map -exec \ > + ./buildtools/update_version_map_abi.py {} \ > + $abi_version \; -print > -- > 2.17.1