Skip to contentSkip to conversation

devtools: trap SIGINT is not recognizable to dash

PATCH Applied Gavin Hu 5 participants 7 messages Aug 1, 2018 – Aug 6, 2018

lore
Share & tools
lore

Gavin Hu

author
#0 lore raw

PATCH 1/1 devtools: trap SIGINT is not recognizable to dash

When running checkpatch.sh, it generates the following error on some linux distributions(like Debian) with Dash as the default shell interpreter.
trap: SIGINT: bad trap

The fix is to replace SIGINT with INT signal, it works for both bash and dash.

Fixes 4bec48184e ("devtools: add checks for ABI symbol addition")
---
 devtools/checkpatches.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
devtools/checkpatches.sh +1 -1
index 2509269df..ba795ad1d 100755
@@ -29,7 +29,7 @@ clean_tmp_files() {
 	fi
 }
 
-trap "clean_tmp_files" SIGINT
+trap "clean_tmp_files" INT
 
 print_usage () {
 	cat <<- END_OF_HELP
Signature · 1 line
2.11.0
Acked-by on v1 1/1
#1 lore raw
Quoted 14 lines

-----Original Message-----
From: stable [mailto:[email protected]] On Behalf Of Gavin Hu
Sent: Wednesday, August 1, 2018 6:23 AM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]
Subject: [dpdk-stable] [PATCH] devtools: trap SIGINT is not recognizable to dash

When running checkpatch.sh, it generates the following error on some linux distributions(like Debian) with Dash as the default shell interpreter.
trap: SIGINT: bad trap

Quoted 8 lines

The fix is to replace SIGINT with INT signal, it works for both bash and dash.

Fixes 4bec48184e ("devtools: add checks for ABI symbol addition")
#2 lore raw

Checked with Ubuntu 16.04.4 LTS, it works.

Quoted 33 lines

-----Original Message-----
From: dev <[email protected]>
Sent: Wednesday, August 1, 2018 4:10 PM
To: Gavin Hu <[email protected]>; [email protected]
Cc: [email protected]; [email protected]
Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH] devtools: trap SIGINT is not recognizable to dash

Quoted 12 lines

-----Original Message-----
From: stable [mailto:[email protected]] On Behalf Of Gavin Hu
Sent: Wednesday, August 1, 2018 6:23 AM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]
Subject: [dpdk-stable] [PATCH] devtools: trap SIGINT is not recognizable to dash

When running checkpatch.sh, it generates the following error on some linux distributions(like Debian) with Dash as the default shell interpreter.
trap: SIGINT: bad trap

Quoted 8 lines

The fix is to replace SIGINT with INT signal, it works for both bash and dash.

Fixes 4bec48184e ("devtools: add checks for ABI symbol addition")
#3 lore raw
In reply to Mcnamara, John
Quoted 7 lines
Quoted 7 lines

When running checkpatch.sh, it generates the following error on some linux distributions(like Debian) with Dash as the default shell interpreter.
trap: SIGINT: bad trap

The fix is to replace SIGINT with INT signal, it works for both bash and dash.

Quoted 7 lines
Quoted 5 lines
Fixes 4bec48184e ("devtools: add checks for ABI symbol addition")

Applied, thanks

#4 lore raw
In reply to Gavin Hu
Quoted 22 lines · On Wed, 1 Aug 2018 13:22:57 +0800 Gavin Hu <[email protected]> wrote:

When running checkpatch.sh, it generates the following error on some linux distributions(like Debian) with Dash as the default shell interpreter.
trap: SIGINT: bad trap

The fix is to replace SIGINT with INT signal, it works for both bash and dash.

Fixes 4bec48184e ("devtools: add checks for ABI symbol addition")
---
 devtools/checkpatches.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
devtools/checkpatches.sh +0 -0
index 2509269df..ba795ad1d 100755

devtools/checkpatches.sh clean_tmp_files() { · line 35

Quoted 8 lines
devtools/checkpatches.sh +1 -1
@@ -29,7 +29,7 @@ clean_tmp_files() {
 	fi
 }
 
-trap "clean_tmp_files" SIGINT
+trap "clean_tmp_files" INT
 
 print_usage () {
 	cat <<- END_OF_HELP

This patch alone is not sufficient to make checkpatch run successfully

./devtools/checkpatches.sh: 52: read: Illegal option -d

It looks like the -d flag to read is also a bash extension.

I recommend changing both checkpatches.sh and check-symbol-changes to have #!/bin/bash

author
#5 lore raw

Hi Stephen,

I am no sure only supporting bash is acceptable or not. Any impact to freebsd?

We should seek wider opinions about this.

I did not meet your problem, either bash or dash, what's your shell?

Best Regards,
Gavin

Quoted 45 lines

-----Original Message-----
From: Stephen Hemminger <[email protected]>
Sent: Saturday, August 4, 2018 6:17 AM
To: Gavin Hu <[email protected]>
Cc: [email protected]; Honnappa Nagarahalli <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH] devtools: trap SIGINT is not recognizable to dash

Quoted 22 lines · On Wed, 1 Aug 2018 13:22:57 +0800 Gavin Hu <[email protected]> wrote:

When running checkpatch.sh, it generates the following error on some linux distributions(like Debian) with Dash as the default shell interpreter.
trap: SIGINT: bad trap

The fix is to replace SIGINT with INT signal, it works for both bash and dash.

Fixes 4bec48184e ("devtools: add checks for ABI symbol addition")
---
 devtools/checkpatches.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
devtools/checkpatches.sh index renamed from devtools/checkpatches.sh +0 -0

2509269df..ba795ad1d 100755

devtools/checkpatches.sh clean_tmp_files() { · line 35

Quoted 8 lines
devtools/checkpatches.sh +1 -1
@@ -29,7 +29,7 @@ clean_tmp_files() {
 fi
 }
 
-trap "clean_tmp_files" SIGINT
+trap "clean_tmp_files" INT
 
 print_usage () {
 cat <<- END_OF_HELP

This patch alone is not sufficient to make checkpatch run successfully

Quoted 6 lines

./devtools/checkpatches.sh: 52: read: Illegal option -d

It looks like the -d flag to read is also a bash extension.

I recommend changing both checkpatches.sh and check-symbol-changes to have #!/bin/bash

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

#6 lore raw
Quoted 10 lines · On Sat, 4 Aug 2018 06:42:53 +0000 Gavin Hu <[email protected]> wrote:

Hi Stephen,

I am no sure only supporting bash is acceptable or not. Any impact to freebsd?

We should seek wider opinions about this.

I did not meet your problem, either bash or dash, what's your shell?

Best Regards,
Gavin

I am running Debian testing, still see complaints about -d

$ dpkg -S /bin/sh
diversion by dash from: /bin/sh
diversion by dash to: /bin/sh.distrib
dash: /bin/sh

Also, requiring bash is not that big an issue on FreeBSD. We already require gnu make so requiring gnu shell is not something developers should really mind.