test mbuf attach
[dpdk.git] / devtools / update-abi.sh
1 #!/bin/sh -e
2 # SPDX-License-Identifier: BSD-3-Clause
3 # Copyright(c) 2019 Intel Corporation
4
5 abi_version=$1
6 abi_version_file="./ABI_VERSION"
7 update_path="lib drivers"
8
9 # check ABI version format string
10 check_abi_version() {
11       echo $1 | grep -q -e "^[[:digit:]]\{1,2\}\.[[:digit:]]\{1,2\}$"
12 }
13
14 if [ -z "$1" ]; then
15       # output to stderr
16       >&2 echo "Please provide ABI version"
17       exit 1
18 fi
19
20 # check version string format
21 if ! check_abi_version $abi_version ; then
22       # output to stderr
23       >&2 echo "ABI version must be formatted as MAJOR.MINOR version"
24       exit 1
25 fi
26
27 if [ -n "$2" ]; then
28       abi_version_file=$2
29 fi
30
31 if [ -n "$3" ]; then
32       # drop $1 and $2
33       shift 2
34       # assign all other arguments as update paths
35       update_path=$@
36 fi
37
38 echo "New ABI version:" $abi_version
39 echo "ABI_VERSION path:" $abi_version_file
40 echo "Path to update:" $update_path
41
42 echo $abi_version > $abi_version_file
43
44 find $update_path -name  \*version.map -exec \
45       devtools/update_version_map_abi.py {} \
46       $abi_version \; -print