4a4a20c477
- As "readlink -e" and "readlink -m" do not exist on freebsd, use "readlink -f", it should not have any impact in these cases. - "sed -ri" is invalid on freebsd and should be replaced by "sed -ri=''" - Use gmake instead of make. This fixes the following command: SYSDIR=/usr/src/sys ./devtools/test-build.sh \ -j4 x86_64-native-freebsd-gcc Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Reviewed-by: David Marchand <david.marchand@redhat.com>
19 lines
497 B
Bash
Executable File
19 lines
497 B
Bash
Executable File
#! /bin/sh -e
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
# Copyright 2017 Mellanox Technologies, Ltd
|
|
|
|
# Check C files in git repository for duplicated includes.
|
|
# Usage: devtools/check-dup-includes.sh [directory]
|
|
|
|
dir=${1:-$(dirname $(readlink -f $0))/..}
|
|
cd $dir
|
|
|
|
# speed up by ignoring Unicode details
|
|
export LC_ALL=C
|
|
|
|
for file in $(git ls-files '*.[ch]') ; do
|
|
sed -rn 's,^[[:space:]]*#include[[:space:]]*[<"](.*)[>"].*,\1,p' $file |
|
|
sort | uniq -d |
|
|
sed "s,^,$file: duplicated include: ,"
|
|
done
|