[dpdk-dev,v2,2/2] devtools: improve kernel script execution check

Message ID 1524139203-92094-2-git-send-email-juhamatti.kuusisaari@coriant.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

  Handle properly a case where DPDK_MAINTAINER_PATH is set
to point to a directory.

Signed-off-by: Juhamatti Kuusisaari <juhamatti.kuusisaari@coriant.com>
---
 devtools/get-maintainer.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Ferruh Yigit April 19, 2018, 1:24 p.m. UTC | #1
On 4/19/2018 1:00 PM, Juhamatti Kuusisaari wrote:
> Handle properly a case where DPDK_MAINTAINER_PATH is set
> to point to a directory.
> 
> Signed-off-by: Juhamatti Kuusisaari <juhamatti.kuusisaari@coriant.com>
> ---
>  devtools/get-maintainer.sh | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/devtools/get-maintainer.sh b/devtools/get-maintainer.sh
> index 1e9eabd..b916048 100755
> --- a/devtools/get-maintainer.sh
> +++ b/devtools/get-maintainer.sh
> @@ -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

This isn't an issue but is there a reason that for exact same check you go with
single line check in checkpatches.sh and multi line check in this file?

>  	print_usage >&2
>  	echo
>  	echo 'Cannot execute DPDK_GETMAINTAINER_PATH' >&2
>
  
Kuusisaari, Juhamatti (Infinera - FI/Espoo) April 20, 2018, 4:10 a.m. UTC | #2
> -----Original Message-----

> From: Ferruh Yigit [mailto:ferruh.yigit@intel.com]

> Sent: Thursday, April 19, 2018 4:25 PM

> To: Kuusisaari, Juhamatti <Juhamatti.Kuusisaari@coriant.com>;

> thomas@monjalon.net

> Cc: dev@dpdk.org

> Subject: Re: [dpdk-dev] [PATCH v2 2/2] devtools: improve kernel script

> execution check

> 

> On 4/19/2018 1:00 PM, Juhamatti Kuusisaari wrote:

> > Handle properly a case where DPDK_MAINTAINER_PATH is set to point to a

> > directory.

> >

> > Signed-off-by: Juhamatti Kuusisaari <juhamatti.kuusisaari@coriant.com>

> > ---

> >  devtools/get-maintainer.sh | 3 ++-

> >  1 file changed, 2 insertions(+), 1 deletion(-)

> >

> > diff --git a/devtools/get-maintainer.sh b/devtools/get-maintainer.sh

> > index 1e9eabd..b916048 100755

> > --- a/devtools/get-maintainer.sh

> > +++ b/devtools/get-maintainer.sh

> > @@ -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

> 

> This isn't an issue but is there a reason that for exact same check you go with

> single line check in checkpatches.sh and multi line check in this file?


The line was getting long, that is the reason.
 
> >  	print_usage >&2

> >  	echo

> >  	echo 'Cannot execute DPDK_GETMAINTAINER_PATH' >&2

> >
  

Patch

diff --git a/devtools/get-maintainer.sh b/devtools/get-maintainer.sh
index 1e9eabd..b916048 100755
--- a/devtools/get-maintainer.sh
+++ b/devtools/get-maintainer.sh
@@ -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