devtools: check_symbol_change requires bash
PATCH 1/1 devtools: check_symbol_change requires bash
The syntax of check_symbol_change uses some bash syntax. It does not run correctly on Debian where /bin/sh is not the same as /bin/bash.
--- devtools/check-symbol-change.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
devtools/check-symbol-change.sh +1 -1
@@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2018 Neil Horman <[email protected]>
Signature · 1 line
2.18.0
Quoted 10 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Stephen Hemminger
Sent: Tuesday, July 31, 2018 4:14 PM
To: [email protected]
Cc: [email protected]; Stephen Hemminger <[email protected]>
Subject: [dpdk-dev] [PATCH] devtools:check_symbol_changerequires bashThe syntax of
check_symbol_changeuses some bash syntax. It does not run correctly on Debian where/bin/shis not the same as/bin/bash.
I think this fix may be required for devtools/checkpatches.sh as well since it seems to use bash specific call to trap().
I saw this in an internal bug report but didn't have a system to check the fix on. Could you do a quick check.
John
Quoted 11 lines · John
Quoted 10 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Stephen Hemminger
Sent: Tuesday, July 31, 2018 4:14 PM
To: [email protected]
Cc: [email protected]; Stephen Hemminger <[email protected]>
Subject: [dpdk-dev] [PATCH] devtools:check_symbol_changerequires bashThe syntax of
check_symbol_changeuses some bash syntax. It does not run correctly on Debian where/bin/shis not the same as/bin/bash.
Quoted 5 lines
I think this fix may be required for
devtools/checkpatches.shas well since it seems to use bash specific call totrap().I saw this in an internal bug report but didn't have a system to check the fix on. Could you do a quick check.
Yes, checkpatches also needs to be bashifyed.
31/07/2018 17:14, Stephen Hemminger:
Quoted 3 lines
The syntax of
check_symbol_changeuses some bash syntax. It does not run correctly on Debian where/bin/shis not the same as/bin/bash.
I would prefer we fix the root cause.
What is the error?
I see there are some == bashisms. Is there something else?
PATCH 1/1 devtools: fix symbol check for dash
The script check-symbol-change.sh was not running when /bin/sh redirects to dash.
--- devtools/check-symbol-change.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
devtools/check-symbol-change.sh +5 -5
@@ -4,8 +4,8 @@ build_map_changes() { - local fname=$1 - local mapdb=$2 + local fname="$1" + local mapdb="$2" cat "$fname" | awk ' # Initialize our variables
@@ -80,7 +80,7 @@ build_map_changes() check_for_rule_violations() { - local mapdb=$1 + local mapdb="$1" local mname local symname local secname
@@ -89,10 +89,10 @@ check_for_rule_violations() while read mname symname secname ar do - if [ "$ar" == "add" ] + if [ "$ar" = "add" ] then - if [ "$secname" == "unknown" ] + if [ "$secname" = "unknown" ] then # Just inform the user of this occurrence, but # don't flag it as an error
Signature · 1 line
2.17.1
Re: [PATCH] devtools: fix symbol check for dash
Quoted 8 lines · Thomas Monjalon
The script
check-symbol-change.shwas not running when/bin/shredirects to dash.Fixes 4bec48184e33 ("devtools: add checks for ABI symbol addition")Reported-by Stephen Hemminger <[email protected]>Signed-off-by Thomas Monjalon <[email protected]>
Neil Horman
Acked-byRe: [PATCH] devtools: fix symbol check for dash
Quoted 4 lines · Ferruh Yigit
Quoted 3 lines · Thomas Monjalon
The script
check-symbol-change.shwas not running when/bin/shredirects to dash.
Quoted 8 lines
Quoted 5 lines
Fixes 4bec48184e33 ("devtools: add checks for ABI symbol addition")Reported-by Stephen Hemminger <[email protected]>Signed-off-by Thomas Monjalon <[email protected]>Tested-by Ferruh Yigit <[email protected]>
Thomas Monjalon
AppliedRe: [PATCH] devtools: fix symbol check for dash
09/08/2018 17:14, Neil Horman:
Quoted 8 lines · Ferruh Yigit
Quoted 7 lines · Thomas Monjalon
Quoted 6 lines
The script
check-symbol-change.shwas not running when/bin/shredirects to dash.Fixes 4bec48184e33 ("devtools: add checks for ABI symbol addition")
Quoted 6 lines
Quoted 5 lines
Quoted 2 lines
Reported-by Stephen Hemminger <[email protected]>Signed-off-by Thomas Monjalon <[email protected]>Tested-by Ferruh Yigit <[email protected]>Acked-by Neil Horman <[email protected]>
Applied