Skip to contentSkip to conversation

generi/579: handle quoted cmp output

PATCH In review Andrey Albershteyn 3 participants 3 messages Feb 19 – Feb 23 fs-verity: read-only file-based authenticity protection

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 generi/579: handle quoted cmp output

diffutils updated cmp with more consistent quoting in commit:

69ae797392bd cmp,diff,diff3,sdiff: quote more consistently

This causes generic/579 to fail from time to time due to grep not catching these errors. Remove quote to work with new and old version of cmp.

---
 tests/generic/579 | 1 +
 1 file changed, 1 insertion(+)
tests/generic/579 +1 -0
index d5fab4892e9a..19ffd4954db2 100755
@@ -71,6 +71,7 @@ for ((proc = 0; proc < nproc_reader; proc++)); do
 			# match, regardless of whether verity has been enabled
 			# or not yet (or is currently being enabled).
 			cmp $orig_file $fsv_file |& _filter_scratch | \
+				sed "s/'//g" | \
 				grep -v "SCRATCH_MNT/fsv$i: No such file or directory" | \
 				grep -v "EOF on SCRATCH_MNT/fsv$i"
 
Signature · 1 line
2.51.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Andrey Albershteyn

diffutils updated cmp with more consistent quoting in commit:

69ae797392bd cmp,diff,diff3,sdiff: quote more consistently

Sigh... changing the default output of core commands again.

Quoted 15 lines

This causes generic/579 to fail from time to time due to grep not catching these errors. Remove quote to work with new and old version of cmp.

---
 tests/generic/579 | 1 +
 1 file changed, 1 insertion(+)
tests/generic/579 +0 -0
index d5fab4892e9a..19ffd4954db2 100755

tests/generic/579 for ((proc = 0; proc < nproc_reader; proc++)); do · line 74

Quoted 4 lines
tests/generic/579 +1 -0
@@ -71,6 +71,7 @@ for ((proc = 0; proc < nproc_reader; proc++)); do
 			# match, regardless of whether verity has been enabled
 			# or not yet (or is currently being enabled).
 			cmp $orig_file $fsv_file |& _filter_scratch | \
+				sed "s/'//g" | \

Thanks for finding this bug. So the output of cmp isn't consistent between the old and new versions, which is going to break later cases (base on cmp) on old or new diffutils version. We usually handle this by wrapping it in a _cmp function to keep the behavior consistent, refer to how we handled common/attr:_getfattr().

If no more review points, I can merge this patch to fix this issue at first.

I'm not sure if we need further updates on diff command, we can revisit this if any bugs are reported.

Thanks,
Zorro

Quoted 6 lines
tests/generic/579 +0 -0
 				grep -v "SCRATCH_MNT/fsv$i: No such file or directory" | \
 				grep -v "EOF on SCRATCH_MNT/fsv$i"
 
Signature · 1 line
2.51.2
#2 lore raw
Quoted 32 lines · Zorro Lang
Quoted 3 lines · Andrey Albershteyn

diffutils updated cmp with more consistent quoting in commit:

69ae797392bd cmp,diff,diff3,sdiff: quote more consistently

Sigh... changing the default output of core commands again.

Quoted 15 lines

This causes generic/579 to fail from time to time due to grep not catching these errors. Remove quote to work with new and old version of cmp.

---
 tests/generic/579 | 1 +
 1 file changed, 1 insertion(+)
tests/generic/579 +0 -0
index d5fab4892e9a..19ffd4954db2 100755

tests/generic/579 for ((proc = 0; proc < nproc_reader; proc++)); do · line 74

Quoted 4 lines
tests/generic/579 +1 -0
@@ -71,6 +71,7 @@ for ((proc = 0; proc < nproc_reader; proc++)); do
 			# match, regardless of whether verity has been enabled
 			# or not yet (or is currently being enabled).
 			cmp $orig_file $fsv_file |& _filter_scratch | \
+				sed "s/'//g" | \

Thanks for finding this bug. So the output of cmp isn't consistent between the old and new versions, which is going to break later cases (base on cmp) on old or new diffutils version. We usually handle this by wrapping it in a _cmp function to keep the behavior consistent, refer to how we handled common/attr:_getfattr().

Quoted 3 lines

If no more review points, I can merge this patch to fix this issue at first.

Thanks!

Quoted 2 lines

I'm not sure if we need further updates on diff command, we can revisit this if any bugs are reported.

I was running -g auto and -g quick with new diffutils, haven't seen any other failures.

Signature · 1 line
- Andrey