[dpdk-dev] devtools: improve kernel script execution check

Message ID 1524054116-41787-1-git-send-email-juhamatti.kuusisaari@coriant.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers

Checks

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

Commit Message

Kuusisaari, Juhamatti (Infinera - FI/Espoo) April 18, 2018, 12:21 p.m. UTC
  Handle properly a case where DPDK_PATCH_PATH is set
to point to a directory.

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

Comments

Ferruh Yigit April 18, 2018, 1:30 p.m. UTC | #1
On 4/18/2018 1:21 PM, Juhamatti Kuusisaari wrote:
> Handle properly a case where DPDK_PATCH_PATH is set
> to point to a directory.
> 
> Signed-off-by: Juhamatti Kuusisaari <juhamatti.kuusisaari@coriant.com>

Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
  
Thomas Monjalon April 18, 2018, 2:06 p.m. UTC | #2
18/04/2018 15:30, Ferruh Yigit:
> On 4/18/2018 1:21 PM, Juhamatti Kuusisaari wrote:
> > Handle properly a case where DPDK_PATCH_PATH is set
> > to point to a directory.
> > 
> > Signed-off-by: Juhamatti Kuusisaari <juhamatti.kuusisaari@coriant.com>
> 
> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>

Funny bug, I didn't thought that "test -x" is positive for directories.
It makes sense.

Applied, thanks
  
Thomas Monjalon April 18, 2018, 2:09 p.m. UTC | #3
18/04/2018 16:06, Thomas Monjalon:
> 18/04/2018 15:30, Ferruh Yigit:
> > On 4/18/2018 1:21 PM, Juhamatti Kuusisaari wrote:
> > > Handle properly a case where DPDK_PATCH_PATH is set
> > > to point to a directory.
> > > 
> > > Signed-off-by: Juhamatti Kuusisaari <juhamatti.kuusisaari@coriant.com>
> > 
> > Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
> 
> Funny bug, I didn't thought that "test -x" is positive for directories.
> It makes sense.
> 
> Applied, thanks

No, sorry, not applied yet.

Please, could you send a v2 fixing devtools/get-maintainer.sh too?

Thanks
  

Patch

diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
index 7676a6b..2bb5458 100755
--- a/devtools/checkpatches.sh
+++ b/devtools/checkpatches.sh
@@ -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