Skip to contentSkip to conversation

scripts/atomic: change 'fold' to 'grep'

PATCH In review Anders Roxell 4 participants 4 messages Dec 4, 2018 – Dec 10, 2018 Atomic infrastructure

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scripts/atomic: change 'fold' to 'grep'

Some distibutions and build systems doesn't include 'fold' from coreutils default.

.../scripts/atomic/atomic-tbl.sh: line 183: fold: command not found

Rework to use 'grep' instead of 'fold' to use a dependency that is already used a lot in the kernel.

---
 scripts/atomic/atomic-tbl.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/atomic/atomic-tbl.sh +1 -1
index 9d6be538a987..81d5c32039dd 100755
@@ -180,7 +180,7 @@ gen_proto_variants()
 #gen_proto(meta, ...)
 gen_proto() {
 	local meta="$1"; shift
-	for m in $(echo "${meta}" | fold -w1); do
+	for m in $(echo "${meta}" | grep -o .); do
 		gen_proto_variants "${m}" "$@"
 	done
 }
Signature · 1 line
2.19.2
Acked-by on v1 1/1
#1 lore raw

[+ Ingo and Mark]

Quoted 20 lines · Anders Roxell

Some distibutions and build systems doesn't include 'fold' from coreutils default.

.../scripts/atomic/atomic-tbl.sh: line 183: fold: command not found

Rework to use 'grep' instead of 'fold' to use a dependency that is already used a lot in the kernel.

---
 scripts/atomic/atomic-tbl.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/atomic/atomic-tbl.sh +0 -0
index 9d6be538a987..81d5c32039dd 100755

scripts/atomic/atomic-tbl.sh gen_proto_variants() · line 185

Quoted 7 lines
scripts/atomic/atomic-tbl.sh +1 -1
@@ -180,7 +180,7 @@ gen_proto_variants()
 #gen_proto(meta, ...)
 gen_proto() {
 	local meta="$1"; shift
-	for m in $(echo "${meta}" | fold -w1); do
+	for m in $(echo "${meta}" | grep -o .); do
 		gen_proto_variants "${m}" "$@"
 	done

Ingo -- please can you take this one via -tip?

Cheers,

Will

#2 lore raw
Quoted 33 lines · Will Deacon

[+ Ingo and Mark]

Quoted 20 lines · Anders Roxell

Some distibutions and build systems doesn't include 'fold' from coreutils default.

.../scripts/atomic/atomic-tbl.sh: line 183: fold: command not found

Rework to use 'grep' instead of 'fold' to use a dependency that is already used a lot in the kernel.

---
 scripts/atomic/atomic-tbl.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/atomic/atomic-tbl.sh +0 -0
index 9d6be538a987..81d5c32039dd 100755

scripts/atomic/atomic-tbl.sh gen_proto_variants() · line 185

Quoted 7 lines
scripts/atomic/atomic-tbl.sh +1 -1
@@ -180,7 +180,7 @@ gen_proto_variants()
 #gen_proto(meta, ...)
 gen_proto() {
 	local meta="$1"; shift
-	for m in $(echo "${meta}" | fold -w1); do
+	for m in $(echo "${meta}" | grep -o .); do
 		gen_proto_variants "${m}" "$@"
 	done
Quoted 1 line

Ingo -- please can you take this one via -tip?

I'm still waiting for a reply to my previous concerns expressed in:

Re: [tip:locking/core] locking/atomics: Check generated headers are up-to-date <[email protected]>

Will remove it from linux-next if there's no good resolution for this cycle.

Thanks,

Ingo

reviewer
#3 lore raw

Hi Ingo,

Quoted 38 lines · Ingo Molnar
Quoted 33 lines · Will Deacon

[+ Ingo and Mark]

Quoted 20 lines · Anders Roxell

Some distibutions and build systems doesn't include 'fold' from coreutils default.

.../scripts/atomic/atomic-tbl.sh: line 183: fold: command not found

Rework to use 'grep' instead of 'fold' to use a dependency that is already used a lot in the kernel.

---
 scripts/atomic/atomic-tbl.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/atomic/atomic-tbl.sh +0 -0
index 9d6be538a987..81d5c32039dd 100755

scripts/atomic/atomic-tbl.sh gen_proto_variants() · line 185

Quoted 7 lines
scripts/atomic/atomic-tbl.sh +1 -1
@@ -180,7 +180,7 @@ gen_proto_variants()
 #gen_proto(meta, ...)
 gen_proto() {
 	local meta="$1"; shift
-	for m in $(echo "${meta}" | fold -w1); do
+	for m in $(echo "${meta}" | grep -o .); do
 		gen_proto_variants "${m}" "$@"
 	done
Quoted 1 line

Ingo -- please can you take this one via -tip?

Quoted 7 lines

I'm still waiting for a reply to my previous concerns expressed in:

Re: [tip:locking/core] locking/atomics: Check generated headers are up-to-date <[email protected]>

Will remove it from linux-next if there's no good resolution for this cycle.

I've just sent a couple of patches for that; please see:

https://lkml.kernel.org/r/[email protected]

Thanks,
Mark.