devtools: check Linux script path if directory
authorJuhamatti Kuusisaari <juhamatti.kuusisaari@coriant.com>
Thu, 19 Apr 2018 12:00:02 +0000 (15:00 +0300)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 22 May 2018 22:33:35 +0000 (00:33 +0200)
Handle properly a case where the path (DPDK_PATCH_PATH
or DPDK_MAINTAINER_PATH) is set to point to a directory.

Signed-off-by: Juhamatti Kuusisaari <juhamatti.kuusisaari@coriant.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
devtools/checkpatches.sh
devtools/get-maintainer.sh

index 7676a6b..2bb5458 100755 (executable)
@@ -75,7 +75,7 @@ while getopts hn:qv ARG ; do
 done
 shift $(($OPTIND - 1))
 
-if [ ! -x "$DPDK_CHECKPATCH_PATH" ] ; then
+if [ ! -f "$DPDK_CHECKPATCH_PATH" ] || [ ! -x "$DPDK_CHECKPATCH_PATH" ] ; then
        print_usage >&2
        echo
        echo 'Cannot execute DPDK_CHECKPATCH_PATH' >&2
index 1e9eabd..b916048 100755 (executable)
@@ -23,7 +23,8 @@ print_usage () {
 }
 
 # Requires DPDK_GETMAINTAINER_PATH devel config option set
-if [ ! -x "$DPDK_GETMAINTAINER_PATH" ] ; then
+if [ ! -f "$DPDK_GETMAINTAINER_PATH" ] ||
+   [ ! -x "$DPDK_GETMAINTAINER_PATH" ] ; then
        print_usage >&2
        echo
        echo 'Cannot execute DPDK_GETMAINTAINER_PATH' >&2