From: Florian Westphal Date: Thu, 9 Jul 2026 20:03:54 +0000 (+0200) Subject: tests: diff.sh: preserve file name X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=724582bb94b1681fc4e652f10948bdf8c892da50;p=thirdparty%2Fipset.git tests: diff.sh: preserve file name As-is, in case of error, its not easy to see which diff file has failed, because diff gets fed via <(sed...), so diff shows something like Signed-off-by: Jozsef Kadlecsik --- diff --git a/tests/diff.sh b/tests/diff.sh index a364a28..76b1938 100755 --- a/tests/diff.sh +++ b/tests/diff.sh @@ -1,7 +1,14 @@ #!/bin/bash -diff -u -I 'Revision: .*' -I 'Size in memory.*' \ - <(sed -e 's/timeout [0-9]*/timeout x/' -e 's/initval 0x[0-9a-fA-F]\{8\}/initval 0x00000000/' $1) \ - <(sed -e 's/timeout [0-9]*/timeout x/' -e 's/initval 0x[0-9a-fA-F]\{8\}/initval 0x00000000/' $2) +NEW_DUMP="$IPSET_TMP/kernel-dump.sed" +STORED_DUMP="$IPSET_TMP/$2.sed" +sed -e 's/timeout [0-9]*/timeout x/' -e 's/initval 0x[0-9a-fA-F]\{8\}/initval 0x00000000/' "$1" > "$NEW_DUMP" +sed -e 's/timeout [0-9]*/timeout x/' -e 's/initval 0x[0-9a-fA-F]\{8\}/initval 0x00000000/' "$2" > "$STORED_DUMP" +diff -u -I 'Revision: .*' -I 'Size in memory.*' "$STORED_DUMP" "$NEW_DUMP" +ret=$? + +rm -f "$STORED_DUMP" "$NEW_DUMP" + +exit $ret