On Mon, Apr 11, 2022 at 03:55:02PM -0700, Darrick J. Wong wrote: > From: Darrick J. Wong <djwong@xxxxxxxxxx> > > 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@xxxxxxxxxx> > --- Good to me, Reviewed-by: Zorro Lang <zlang@xxxxxxxxxx> > common/rc | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > > diff --git a/common/rc b/common/rc > index 17629801..ec146c4e 100644 > --- a/common/rc > +++ b/common/rc > @@ -4800,6 +4800,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. >