DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] devtools: fix checkpatch for filename with space
@ 2018-07-20 11:41 Thomas Monjalon
  2018-07-20 18:25 ` Neil Horman
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Monjalon @ 2018-07-20 11:41 UTC (permalink / raw)
  To: nhorman; +Cc: dev

If the patch filename or the temporary file path have a space
in their name, the script checkpatches.sh does not work.
The variables for the filenames must be enclosed in quotes
in order to preserve spaces.

Fixes: 4bec48184e33 ("devtools: add checks for ABI symbol addition")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---

Strangely, I did a fix for check-symbol-change.sh and I forgot
to fix checkpatches.sh.

---
 devtools/checkpatches.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
index 1439bce94..e97a4f2c9 100755
--- a/devtools/checkpatches.sh
+++ b/devtools/checkpatches.sh
@@ -25,7 +25,7 @@ NEW_TYPEDEFS,COMPARISON_TO_NULL"
 
 clean_tmp_files() {
 	if echo $tmpinput | grep -q '^checkpatches\.' ; then
-		rm -f $tmpinput
+		rm -f "$tmpinput"
 	fi
 }
 
@@ -77,13 +77,13 @@ check () { # <patch> <commit> <title>
 	elif [ -n "$2" ] ; then
 		tmpinput=$(mktemp checkpatches.XXXXXX)
 		git format-patch --find-renames \
-		--no-stat --stdout -1 $commit > $tmpinput
+		--no-stat --stdout -1 $commit > "$tmpinput"
 	else
 		tmpinput=$(mktemp checkpatches.XXXXXX)
-		cat > $tmpinput
+		cat > "$tmpinput"
 	fi
 
-	report=$($DPDK_CHECKPATCH_PATH $options $tmpinput 2>/dev/null)
+	report=$($DPDK_CHECKPATCH_PATH $options "$tmpinput" 2>/dev/null)
 	if [ $? -ne 0 ] ; then
 		$verbose || printf '\n### %s\n\n' "$3"
 		printf '%s\n' "$report" | sed -n '1,/^total:.*lines checked$/p'
-- 
2.17.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] devtools: fix checkpatch for filename with space
  2018-07-20 11:41 [dpdk-dev] [PATCH] devtools: fix checkpatch for filename with space Thomas Monjalon
@ 2018-07-20 18:25 ` Neil Horman
  2018-07-20 20:56   ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Neil Horman @ 2018-07-20 18:25 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev

On Fri, Jul 20, 2018 at 01:41:03PM +0200, Thomas Monjalon wrote:
> If the patch filename or the temporary file path have a space
> in their name, the script checkpatches.sh does not work.
> The variables for the filenames must be enclosed in quotes
> in order to preserve spaces.
> 
> Fixes: 4bec48184e33 ("devtools: add checks for ABI symbol addition")
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Neil Horman <nhorman@tuxdriver.com>

> ---
> 
> Strangely, I did a fix for check-symbol-change.sh and I forgot
> to fix checkpatches.sh.
> 
> ---
>  devtools/checkpatches.sh | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
> index 1439bce94..e97a4f2c9 100755
> --- a/devtools/checkpatches.sh
> +++ b/devtools/checkpatches.sh
> @@ -25,7 +25,7 @@ NEW_TYPEDEFS,COMPARISON_TO_NULL"
>  
>  clean_tmp_files() {
>  	if echo $tmpinput | grep -q '^checkpatches\.' ; then
> -		rm -f $tmpinput
> +		rm -f "$tmpinput"
>  	fi
>  }
>  
> @@ -77,13 +77,13 @@ check () { # <patch> <commit> <title>
>  	elif [ -n "$2" ] ; then
>  		tmpinput=$(mktemp checkpatches.XXXXXX)
>  		git format-patch --find-renames \
> -		--no-stat --stdout -1 $commit > $tmpinput
> +		--no-stat --stdout -1 $commit > "$tmpinput"
>  	else
>  		tmpinput=$(mktemp checkpatches.XXXXXX)
> -		cat > $tmpinput
> +		cat > "$tmpinput"
>  	fi
>  
> -	report=$($DPDK_CHECKPATCH_PATH $options $tmpinput 2>/dev/null)
> +	report=$($DPDK_CHECKPATCH_PATH $options "$tmpinput" 2>/dev/null)
>  	if [ $? -ne 0 ] ; then
>  		$verbose || printf '\n### %s\n\n' "$3"
>  		printf '%s\n' "$report" | sed -n '1,/^total:.*lines checked$/p'
> -- 
> 2.17.1
> 
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] devtools: fix checkpatch for filename with space
  2018-07-20 18:25 ` Neil Horman
@ 2018-07-20 20:56   ` Thomas Monjalon
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2018-07-20 20:56 UTC (permalink / raw)
  To: dev; +Cc: Neil Horman

20/07/2018 20:25, Neil Horman:
> On Fri, Jul 20, 2018 at 01:41:03PM +0200, Thomas Monjalon wrote:
> > If the patch filename or the temporary file path have a space
> > in their name, the script checkpatches.sh does not work.
> > The variables for the filenames must be enclosed in quotes
> > in order to preserve spaces.
> > 
> > Fixes: 4bec48184e33 ("devtools: add checks for ABI symbol addition")
> > 
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> Acked-by: Neil Horman <nhorman@tuxdriver.com>
> 
> > ---
> > 
> > Strangely, I did a fix for check-symbol-change.sh and I forgot
> > to fix checkpatches.sh.
> > 
> > ---

Applied

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-07-20 20:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-20 11:41 [dpdk-dev] [PATCH] devtools: fix checkpatch for filename with space Thomas Monjalon
2018-07-20 18:25 ` Neil Horman
2018-07-20 20:56   ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).