* [PATCH] common/xfs: use whole-word matching for _require_xfsrestore_xflag
@ 2023-02-07 17:00 Darrick J. Wong
2023-02-09 15:18 ` Zorro Lang
0 siblings, 1 reply; 2+ messages in thread
From: Darrick J. Wong @ 2023-02-07 17:00 UTC (permalink / raw)
To: Zorro Lang; +Cc: fstests, shiina.hironori
From: Darrick J. Wong <djwong@kernel.org>
On my system, the path to the xfsrestore binary is:
/code/xfsdump/build-x86_64/restore/xfsrestore
The grep command in _require_xfsrestore_xflag matches on the "build-x86"
part, even though my version of xfsrestore does not actually have a -x
flag. Fix the string parsing to match entire words so that we only look
for -x in the help output.
(Maybe someone should patch xfsrestore -h to report basename(argv[0])
instead of argv[0]...)
Fixes: 1ffa16c573 ("xfs: test for fixing wrong root inode number in dump")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
common/xfs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/common/xfs b/common/xfs
index ba59889c3b..97c049e2ca 100644
--- a/common/xfs
+++ b/common/xfs
@@ -1529,7 +1529,7 @@ _xfs_filter_mkfs()
_require_xfsrestore_xflag()
{
- $XFSRESTORE_PROG -h 2>&1 | grep -q -e '-x' || \
+ $XFSRESTORE_PROG -h 2>&1 | grep -q -w -e '-x' || \
_notrun 'xfsrestore does not support -x flag.'
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] common/xfs: use whole-word matching for _require_xfsrestore_xflag
2023-02-07 17:00 [PATCH] common/xfs: use whole-word matching for _require_xfsrestore_xflag Darrick J. Wong
@ 2023-02-09 15:18 ` Zorro Lang
0 siblings, 0 replies; 2+ messages in thread
From: Zorro Lang @ 2023-02-09 15:18 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: fstests, shiina.hironori
On Tue, Feb 07, 2023 at 09:00:12AM -0800, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
>
> On my system, the path to the xfsrestore binary is:
>
> /code/xfsdump/build-x86_64/restore/xfsrestore
>
> The grep command in _require_xfsrestore_xflag matches on the "build-x86"
> part, even though my version of xfsrestore does not actually have a -x
> flag. Fix the string parsing to match entire words so that we only look
> for -x in the help output.
>
> (Maybe someone should patch xfsrestore -h to report basename(argv[0])
> instead of argv[0]...)
>
> Fixes: 1ffa16c573 ("xfs: test for fixing wrong root inode number in dump")
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> ---
Good to me,
Reviewed-by: Zorro Lang <zlang@redhat.com>
> common/xfs | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/common/xfs b/common/xfs
> index ba59889c3b..97c049e2ca 100644
> --- a/common/xfs
> +++ b/common/xfs
> @@ -1529,7 +1529,7 @@ _xfs_filter_mkfs()
>
> _require_xfsrestore_xflag()
> {
> - $XFSRESTORE_PROG -h 2>&1 | grep -q -e '-x' || \
> + $XFSRESTORE_PROG -h 2>&1 | grep -q -w -e '-x' || \
> _notrun 'xfsrestore does not support -x flag.'
> }
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-02-09 15:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-07 17:00 [PATCH] common/xfs: use whole-word matching for _require_xfsrestore_xflag Darrick J. Wong
2023-02-09 15:18 ` Zorro Lang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.