devtools: fix bad substitution

Message ID 20230711071619.26797-1-rasland@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series devtools: fix bad substitution |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/intel-Functional success Functional PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-aarch-unit-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS

Commit Message

Raslan Darawsheh July 11, 2023, 7:16 a.m. UTC
  When running check-git-log, it showed a Bad substitution.

It is fixed by using tr to escape the open parenthesis.

Fixes: 6fd14c1b58e6 ("devtools: fix mailmap check for parentheses")
Cc: thomas@monjalon.net

Suggested-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Raslan Darawsheh <rasland@nvidia.com>
---
 devtools/check-git-log.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Thomas Monjalon July 12, 2023, 4:19 p.m. UTC | #1
11/07/2023 09:16, Raslan Darawsheh:
> When running check-git-log, it showed a Bad substitution.
> 
> It is fixed by using tr to escape the open parenthesis.
> 
> Fixes: 6fd14c1b58e6 ("devtools: fix mailmap check for parentheses")
> Cc: thomas@monjalon.net
> 
> Suggested-by: Thomas Monjalon <thomas@monjalon.net>
> Signed-off-by: Raslan Darawsheh <rasland@nvidia.com>
> ---
>  devtools/check-git-log.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/devtools/check-git-log.sh b/devtools/check-git-log.sh
> index 89544a2cc5..5c869b7683 100755
> --- a/devtools/check-git-log.sh
> +++ b/devtools/check-git-log.sh
> @@ -264,7 +264,7 @@ names=$(git log --format='From: %an <%ae>%n%b' --reverse $range |
>  	sed -rn 's,.*: (.*<.*@.*>),\1,p' |
>  	sort -u)
>  bad=$(for contributor in $names ; do
> -	contributor=${contributor//(/\\(}
> +	contributor=$(echo $contributor | tr '(' '\\(')

tr was not working here, replaced with sed

Applied, thanks.
  

Patch

diff --git a/devtools/check-git-log.sh b/devtools/check-git-log.sh
index 89544a2cc5..5c869b7683 100755
--- a/devtools/check-git-log.sh
+++ b/devtools/check-git-log.sh
@@ -264,7 +264,7 @@  names=$(git log --format='From: %an <%ae>%n%b' --reverse $range |
 	sed -rn 's,.*: (.*<.*@.*>),\1,p' |
 	sort -u)
 bad=$(for contributor in $names ; do
-	contributor=${contributor//(/\\(}
+	contributor=$(echo $contributor | tr '(' '\\(')
 	! grep -qE "^$contributor($| <)" $selfdir/../.mailmap || continue
 	name=${contributor%% <*}
 	if grep -q "^$name <" $selfdir/../.mailmap ; then