numam-dpdk/devtools/check-spdx-tag.sh
David Marchand 56ea803e87 build: remove Windows export symbol list
Rather than have two files that keeps getting out of sync, let's
annotate the version.map to generate the Windows export file.

Some mlx5 symbols (haswell_broadwell_cpu, mlx5_glue, mlx5_os_*) were
only exported for Windows.
All of them are available and used by Linux too, so this patch adds
them in version.map.

Note: Existing version.map annotation achieved with:
$ for dir in lib/librte_eal drivers/common/mlx5; do
    ./buildtools/map-list-symbol.sh $dir/*.map |
    while read file version sym; do
      ! git grep -qw $sym $dir/*.def || continue;
      sed -i -e "s/$sym;/$sym; # WINDOWS_NO_EXPORT/" $dir/*.map;
    done;
  done

Signed-off-by: David Marchand <david.marchand@redhat.com>
Tested-by: Tal Shnaiderman <talshn@nvidia.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2021-04-08 17:57:33 +02:00

71 lines
1.4 KiB
Bash
Executable File

#! /bin/sh
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2020 Microsoft Corporation
#
# Produce a list of files with incorrect license tags
errors=0
warnings=0
quiet=false
verbose=false
print_usage () {
echo "usage: $(basename $0) [-q] [-v]"
exit 1
}
check_spdx() {
if $verbose; then
echo "Files without SPDX License"
echo "--------------------------"
fi
git grep -L SPDX-License-Identifier -- \
':^.git*' ':^.ci/*' ':^.travis.yml' \
':^README' ':^MAINTAINERS' ':^VERSION' ':^ABI_VERSION' \
':^*/Kbuild' ':^*/README' \
':^license/' ':^config/' ':^buildtools/' \
':^*.cocci' ':^*.abignore' \
':^*.map' ':^*.ini' ':^*.data' ':^*.cfg' ':^*.txt' \
':^*.svg' ':^*.png'\
> $tmpfile
errors=$(wc -l < $tmpfile)
$quiet || cat $tmpfile
}
check_boilerplate() {
if $verbose ; then
echo
echo "Files with redundant license text"
echo "---------------------------------"
fi
git grep -l Redistribution -- \
':^license/' ':^/devtools/check-spdx-tag.sh' > $tmpfile
warnings=$(wc -l <$tmpfile)
$quiet || cat $tmpfile
}
while getopts qvh ARG ; do
case $ARG in
q ) quiet=true ;;
v ) verbose=true ;;
h ) print_usage ; exit 0 ;;
? ) print_usage ; exit 1 ;;
esac
done
shift $(($OPTIND - 1))
tmpfile=$(mktemp -t dpdk.checkspdx.XXXXXX)
trap 'rm -f -- "$tmpfile"' INT TERM HUP EXIT
check_spdx
$quiet || echo
check_boilerplate
$quiet || echo
echo "total: $errors errors, $warnings warnings"
exit $errors