]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
tests/erofs_test: Fix mkfs.erofs version test to not use process substitution bashism
authorGlenn Washburn <development@efficientek.com>
Thu, 13 Nov 2025 03:10:39 +0000 (21:10 -0600)
committerDaniel Kiper <daniel.kiper@oracle.com>
Tue, 18 Nov 2025 11:49:32 +0000 (12:49 +0100)
The shell used to run the tests is generally /bin/sh, which does not
support process substitution.

Fixes: b990df0bef9e (tests/util/grub-fs-tester: Fix EROFS label tests in grub-fs-tester)
Signed-off-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Reviewed-by: Sudhakar Kuppusamy <sudhakar@linux.ibm.com>
tests/util/grub-fs-tester.in

index 9a13f87a304ca82e2e5bb4abb3c40360c80b26dd..f8181837e1e6e873eadb3f81b819021d03f9b689 100644 (file)
@@ -599,11 +599,12 @@ for LOGSECSIZE in $(range "$MINLOGSECSIZE" "$MAXLOGSECSIZE" 1); do
                    | x"minix3" | xreiserfs_old)
                    NOFSLABEL=y;;
                x"erofs_"*)
-                   MKFS_EROFS_VERSION=$(mkfs.erofs -V 2>/dev/null | tr ' ' '\n' | grep '^[0-9]')
+                   MKFS_EROFS_VERSION=$(mkfs.erofs 2>/dev/null | head -n 1 | (read _ V; echo $V))
                    # check if the version is at least 1.6
-                   if [ $(sort -V <(echo "$MKFS_EROFS_VERSION") <(echo "1.6") | head -n 1) != "1.6" ]; then
+                   if [ "$(echo -e "${MKFS_EROFS_VERSION}\n1.6" | sort -V | head -n 1)" != "1.6" ]; then
                        NOFSLABEL=y
-                   fi
+                       unset FSLABEL
+                   fi;;
            esac
 
            PDIRCOMPNUM=210