xref: /dpdk/devtools/get-maintainer.sh (revision 089e5ed727a15da2729cfee9b63533dd120bd04c)
1#!/bin/sh
2# SPDX-License-Identifier: BSD-3-Clause
3# Copyright(c) 2017 Intel Corporation
4
5
6# Load config options:
7# - DPDK_GETMAINTAINER_PATH
8. $(dirname $(readlink -f $0))/load-devel-config
9
10options="--no-git-fallback"
11options="$options --no-rolestats"
12
13print_usage () {
14	cat <<- END_OF_HELP
15	usage: $(basename $0) <patch>
16
17	The DPDK_GETMAINTAINER_PATH variable should be set to the full path to
18	the get_maintainer.pl script located in Linux kernel sources. Example:
19	DPDK_GETMAINTAINER_PATH=~/linux/scripts/get_maintainer.pl
20
21	Also refer to devtools/load-devel-config to store your configuration.
22	END_OF_HELP
23}
24
25# Requires DPDK_GETMAINTAINER_PATH devel config option set
26if [ ! -f "$DPDK_GETMAINTAINER_PATH" ] ||
27   [ ! -x "$DPDK_GETMAINTAINER_PATH" ] ; then
28	print_usage >&2
29	echo
30	echo 'Cannot execute DPDK_GETMAINTAINER_PATH' >&2
31	exit 1
32fi
33
34FILES="COPYING CREDITS Kbuild"
35FOLDERS="Documentation arch include fs init ipc scripts"
36
37# Kernel script checks for some files and folders to run
38workaround () {
39	for f in $FILES; do
40		if [ ! -f $f ]; then touch $f; fi
41	done
42
43	for d in $FOLDERS; do
44		if [ ! -d $d ]; then mkdir $d; fi
45	done
46}
47
48fix_workaround () {
49	for f in $FILES; do if [ -f $f ]; then rm -f $f; fi; done
50	for d in $FOLDERS; do if [ -d $d ]; then rmdir $d; fi; done
51}
52
53# clean workaround on exit
54trap fix_workaround EXIT
55
56workaround
57$DPDK_GETMAINTAINER_PATH $options $@
58# fix_workaround called on exit by trap
59