generi/579: handle quoted cmp output
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
@@ -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
Quoted 3 lines · Andrey Albershteyn
diffutils updated cmp with more consistent quoting in commit:
69ae797392bdcmp,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.
Signed-off-by Andrey Albershteyn <[email protected]>--- tests/generic/579 | 1 + 1 file changed, 1 insertion(+)tests/generic/579 +0
-0
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
-0grep -v "SCRATCH_MNT/fsv$i: No such file or directory" | \ grep -v "EOF on SCRATCH_MNT/fsv$i"Signature · 1 line
2.51.2
Quoted 32 lines · Zorro Lang
Quoted 3 lines · Andrey Albershteyn
diffutils updated cmp with more consistent quoting in commit:
69ae797392bdcmp,diff,diff3,sdiff: quote more consistentlySigh... 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.
Signed-off-by Andrey Albershteyn <[email protected]>--- tests/generic/579 | 1 + 1 file changed, 1 insertion(+)tests/generic/579 +0
-0tests/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
_cmpfunction 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.
Reviewed-by Zorro Lang <[email protected]>
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