Skip to contentSkip to conversation

devtools: check_symbol_change requires bash

PATCH In review Stephen Hemminger 5 participants 8 messages Jul 31, 2018 – Aug 9, 2018

lore
Share & tools
lore
#0 lore raw

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.

Fixes 4bec48184e33 ("devtools: add checks for ABI symbol addition")
---
 devtools/check-symbol-change.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
devtools/check-symbol-change.sh +1 -1
index 40b72073a975..19035a8d40e4 100755
@@ -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
#1 lore raw
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_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.

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

#2 lore raw
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_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.

Quoted 5 lines

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.

Yes, checkpatches also needs to be bashifyed.

#3 lore raw
In reply to Stephen Hemminger

31/07/2018 17:14, Stephen Hemminger:

Quoted 3 lines

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.

I would prefer we fix the root cause.
What is the error?

I see there are some == bashisms. Is there something else?

#4 lore raw

PATCH 1/1 devtools: fix symbol check for dash

The script check-symbol-change.sh was not running when /bin/sh redirects to dash.

Fixes 4bec48184e33 ("devtools: add checks for ABI symbol addition")
---
 devtools/check-symbol-change.sh | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
devtools/check-symbol-change.sh +5 -5
index 40b72073a..daaf45e14 100755
@@ -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
Acked-by
#6 lore raw

Re: [PATCH] devtools: fix symbol check for dash

Quoted 4 lines · Ferruh Yigit
Quoted 3 lines · Thomas Monjalon

The script check-symbol-change.sh was not running when /bin/sh redirects to dash.

Quoted 8 lines
Quoted 5 lines
Fixes 4bec48184e33 ("devtools: add checks for ABI symbol addition")
#7 lore raw

Re: [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.sh was not running when /bin/sh redirects to dash.

Fixes 4bec48184e33 ("devtools: add checks for ABI symbol addition")
Quoted 6 lines
Quoted 5 lines
Quoted 2 lines

Applied