aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2022-04-11 15:55:02 -0700
committerEryu Guan <guaneryu@gmail.com>2022-04-17 22:19:16 +0800
commit86e537edb41d9fbda0d6a18a8a30fc5c3f49d886 (patch)
tree38935a8fceb15194fd359d886fd16ce7b030df6d
parent0ab8b3ac61ffe7c3b5ac01b6727cc11cddf03384 (diff)
downloadxfstests-dev-86e537edb41d9fbda0d6a18a8a30fc5c3f49d886.tar.gz
common/rc: let xfs_scrub tell us about its unicode checker
Now that xfs_scrub can report whether or not it was built with the Unicode name checker, rewrite _check_xfs_scrub_does_unicode to take advantage of that. This supersedes the old method of trying to observe dynamic library linkages and grepping the binary, neither of which worked very well. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Zorro Lang <zlang@redhat.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
-rw-r--r--common/rc12
1 files changed, 12 insertions, 0 deletions
diff --git a/common/rc b/common/rc
index 83e932cf28..553ae350f7 100644
--- a/common/rc
+++ b/common/rc
@@ -4816,6 +4816,18 @@ _check_xfs_scrub_does_unicode() {
_supports_xfs_scrub "${mount}" "${dev}" || return 1
+ # Newer versions of xfs_scrub advertise whether or not it supports
+ # Unicode name checks.
+ local xfs_scrub_ver="$("${XFS_SCRUB_PROG}" -VV)"
+
+ if echo "${xfs_scrub_ver}" | grep -q -- '-Unicode'; then
+ return 1
+ fi
+
+ if echo "${xfs_scrub_ver}" | grep -q -- '+Unicode'; then
+ return 0
+ fi
+
# If the xfs_scrub binary contains the string "Unicode name.*%s", then
# we know that it has the ability to complain about improper Unicode
# names.