From patchwork Thu Oct 17 14:31:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Burakov, Anatoly" X-Patchwork-Id: 61401 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0FA801E987; Thu, 17 Oct 2019 16:32:14 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id D12F01E954 for ; Thu, 17 Oct 2019 16:32:06 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Oct 2019 07:32:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,308,1566889200"; d="scan'208";a="396282130" Received: from silpixa00399498.ir.intel.com (HELO silpixa00399498.ger.corp.intel.com) ([10.237.223.151]) by fmsmga005.fm.intel.com with ESMTP; 17 Oct 2019 07:32:04 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: john.mcnamara@intel.com, bruce.richardson@intel.com, thomas@monjalon.net, david.marchand@redhat.com Date: Thu, 17 Oct 2019 15:31:53 +0100 Message-Id: <745d35b8e3911e778e43e7d4845176d170fa473c.1571322634.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v4 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" 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 Acked-by: Bruce Richardson --- Notes: v3: - Switch to sh rather than bash, and remove bash-isms - Address review comments v2: - Add this patch to split the shell script from previous commit - Fixup miscellaneous bugs buildtools/update-abi.sh | 42 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 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..89ba5804a6 --- /dev/null +++ b/buildtools/update-abi.sh @@ -0,0 +1,42 @@ +#!/bin/sh +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2019 Intel Corporation + +abi_version=$1 +abi_version_file="./config/ABI_VERSION" +update_path="lib drivers" + +if [ -z "$1" ]; then + # output to stderr + >&2 echo "Please provide ABI version" + exit 1 +fi + +# check version string format +echo $abi_version | grep -q -e "^[[:digit:]]\{1,2\}\.[[:digit:]]\{1,2\}$" +if [ "$?" -ne 0 ]; then + # output to stderr + >&2 echo "ABI version must be formatted as MAJOR.MINOR version" + exit 1 +fi + +if [ -n "$2" ]; then + abi_version_file=$2 +fi + +if [ -n "$3" ]; then + # drop $1 and $2 + shift 2 + # assign all other arguments as update paths + update_path=$@ +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 + +find $update_path -name \*version.map -exec \ + ./buildtools/update_version_map_abi.py {} \ + $abi_version \; -print