f-stack/dpdk/devtools/get-maintainer.sh

59 lines
1.4 KiB
Bash
Raw Normal View History

2017-04-21 10:43:26 +00:00
#!/bin/sh
2019-06-25 11:12:58 +00:00
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2017 Intel Corporation
2017-04-21 10:43:26 +00:00
# Load config options:
# - DPDK_GETMAINTAINER_PATH
. $(dirname $(readlink -e $0))/load-devel-config
2017-04-21 10:43:26 +00:00
options="--no-git-fallback"
options="$options --no-rolestats"
2017-04-21 10:43:26 +00:00
print_usage () {
cat <<- END_OF_HELP
usage: $(basename $0) <patch>
2019-06-25 11:12:58 +00:00
The DPDK_GETMAINTAINER_PATH variable should be set to the full path to
the get_maintainer.pl script located in Linux kernel sources. Example:
DPDK_GETMAINTAINER_PATH=~/linux/scripts/get_maintainer.pl
Also refer to devtools/load-devel-config to store your configuration.
END_OF_HELP
}
2017-04-21 10:43:26 +00:00
2019-06-25 11:12:58 +00:00
# Requires DPDK_GETMAINTAINER_PATH devel config option set
if [ ! -f "$DPDK_GETMAINTAINER_PATH" ] ||
[ ! -x "$DPDK_GETMAINTAINER_PATH" ] ; then
print_usage >&2
echo
echo 'Cannot execute DPDK_GETMAINTAINER_PATH' >&2
exit 1
fi
2017-04-21 10:43:26 +00:00
FILES="COPYING CREDITS Kbuild"
2019-06-25 11:12:58 +00:00
FOLDERS="Documentation arch include fs init ipc scripts"
2017-04-21 10:43:26 +00:00
# Kernel script checks for some files and folders to run
workaround () {
for f in $FILES; do
if [ ! -f $f ]; then touch $f; fi
done
2017-04-21 10:43:26 +00:00
for d in $FOLDERS; do
if [ ! -d $d ]; then mkdir $d; fi
done
}
2017-04-21 10:43:26 +00:00
fix_workaround () {
for f in $FILES; do if [ -f $f ]; then rm -f $f; fi; done
for d in $FOLDERS; do if [ -d $d ]; then rmdir $d; fi; done
}
2017-04-21 10:43:26 +00:00
# clean workaround on exit
trap fix_workaround EXIT
2017-04-21 10:43:26 +00:00
workaround
$DPDK_GETMAINTAINER_PATH $options $@
# fix_workaround called on exit by trap