devtools: fix checkpatch for filename with space
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: 4bec48184e
("devtools: add checks for ABI symbol addition")
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
This commit is contained in:
parent
6a015363b3
commit
6793a1f771
@ -25,7 +25,7 @@ NEW_TYPEDEFS,COMPARISON_TO_NULL"
|
|||||||
|
|
||||||
clean_tmp_files() {
|
clean_tmp_files() {
|
||||||
if echo $tmpinput | grep -q '^checkpatches\.' ; then
|
if echo $tmpinput | grep -q '^checkpatches\.' ; then
|
||||||
rm -f $tmpinput
|
rm -f "$tmpinput"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,13 +77,13 @@ check () { # <patch> <commit> <title>
|
|||||||
elif [ -n "$2" ] ; then
|
elif [ -n "$2" ] ; then
|
||||||
tmpinput=$(mktemp checkpatches.XXXXXX)
|
tmpinput=$(mktemp checkpatches.XXXXXX)
|
||||||
git format-patch --find-renames \
|
git format-patch --find-renames \
|
||||||
--no-stat --stdout -1 $commit > $tmpinput
|
--no-stat --stdout -1 $commit > "$tmpinput"
|
||||||
else
|
else
|
||||||
tmpinput=$(mktemp checkpatches.XXXXXX)
|
tmpinput=$(mktemp checkpatches.XXXXXX)
|
||||||
cat > $tmpinput
|
cat > "$tmpinput"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
report=$($DPDK_CHECKPATCH_PATH $options $tmpinput 2>/dev/null)
|
report=$($DPDK_CHECKPATCH_PATH $options "$tmpinput" 2>/dev/null)
|
||||||
if [ $? -ne 0 ] ; then
|
if [ $? -ne 0 ] ; then
|
||||||
$verbose || printf '\n### %s\n\n' "$3"
|
$verbose || printf '\n### %s\n\n' "$3"
|
||||||
printf '%s\n' "$report" | sed -n '1,/^total:.*lines checked$/p'
|
printf '%s\n' "$report" | sed -n '1,/^total:.*lines checked$/p'
|
||||||
|
Loading…
Reference in New Issue
Block a user