All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: fstests@vger.kernel.org
Cc: linux-fscrypt@vger.kernel.org, keyrings@vger.kernel.org,
	Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Subject: [RFC PATCH 1/3] common/rc: handle option with argument in _require_xfs_io_command()
Date: Tue, 19 Nov 2019 14:31:28 -0800	[thread overview]
Message-ID: <20191119223130.228341-2-ebiggers@kernel.org> (raw)
In-Reply-To: <20191119223130.228341-1-ebiggers@kernel.org>

From: Eric Biggers <ebiggers@google.com>

Fix _require_xfs_io_command() to handle options that take arguments when
the argument is shown in the help text.  E.g., it didn't work to run:

	_require_xfs_io_command "add_enckey" "-k"

because the relevant line of the help text is:

	-k KEY_ID -- ID of fscrypt-provisioning key containing the raw key

... but the grep command only matched "-k --", not "-k KEY_ID --".

Signed-off-by: Eric Biggers <ebiggers@google.com>
---
 common/rc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/rc b/common/rc
index b988e912..8d9479c0 100644
--- a/common/rc
+++ b/common/rc
@@ -2216,7 +2216,7 @@ _require_xfs_io_command()
 	[ -n "$param" ] || return
 
 	if [ -z "$param_checked" ]; then
-		$XFS_IO_PROG -c "help $command" | grep -q "^ $param --" || \
+		$XFS_IO_PROG -c "help $command" | grep -E -q "^ $param ([a-zA-Z_]+ )?--" || \
 			_notrun "xfs_io $command doesn't support $param"
 	else
 		# xfs_io could result in "command %c not supported" if it was
-- 
2.24.0.432.g9d3f5f5b63-goog


WARNING: multiple messages have this Message-ID (diff)
From: Eric Biggers <ebiggers@kernel.org>
To: fstests@vger.kernel.org
Cc: linux-fscrypt@vger.kernel.org, keyrings@vger.kernel.org,
	Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Subject: [RFC PATCH 1/3] common/rc: handle option with argument in _require_xfs_io_command()
Date: Tue, 19 Nov 2019 22:31:28 +0000	[thread overview]
Message-ID: <20191119223130.228341-2-ebiggers@kernel.org> (raw)
In-Reply-To: <20191119223130.228341-1-ebiggers@kernel.org>

From: Eric Biggers <ebiggers@google.com>

Fix _require_xfs_io_command() to handle options that take arguments when
the argument is shown in the help text.  E.g., it didn't work to run:

	_require_xfs_io_command "add_enckey" "-k"

because the relevant line of the help text is:

	-k KEY_ID -- ID of fscrypt-provisioning key containing the raw key

... but the grep command only matched "-k --", not "-k KEY_ID --".

Signed-off-by: Eric Biggers <ebiggers@google.com>
---
 common/rc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/rc b/common/rc
index b988e912..8d9479c0 100644
--- a/common/rc
+++ b/common/rc
@@ -2216,7 +2216,7 @@ _require_xfs_io_command()
 	[ -n "$param" ] || return
 
 	if [ -z "$param_checked" ]; then
-		$XFS_IO_PROG -c "help $command" | grep -q "^ $param --" || \
+		$XFS_IO_PROG -c "help $command" | grep -E -q "^ $param ([a-zA-Z_]+ )?--" || \
 			_notrun "xfs_io $command doesn't support $param"
 	else
 		# xfs_io could result in "command %c not supported" if it was
-- 
2.24.0.432.g9d3f5f5b63-goog

  reply	other threads:[~2019-11-19 22:32 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-19 22:31 [RFC PATCH 0/3] xfstests: test adding filesystem-level fscrypt key via key_id Eric Biggers
2019-11-19 22:31 ` Eric Biggers
2019-11-19 22:31 ` Eric Biggers [this message]
2019-11-19 22:31   ` [RFC PATCH 1/3] common/rc: handle option with argument in _require_xfs_io_command() Eric Biggers
2019-11-19 22:31 ` [RFC PATCH 2/3] common/encrypt: move constant test key to common code Eric Biggers
2019-11-19 22:31   ` Eric Biggers
2019-11-19 22:31 ` [RFC PATCH 3/3] generic: test adding filesystem-level fscrypt key via key_id Eric Biggers
2019-11-19 22:31   ` Eric Biggers
2019-11-21  0:25   ` Eric Biggers
2019-11-21  0:25     ` Eric Biggers
2019-11-27 20:45 ` [RFC PATCH 0/3] xfstests: " Jarkko Sakkinen
2019-11-27 20:45   ` Jarkko Sakkinen
2019-11-27 20:46   ` Jarkko Sakkinen
2019-11-27 20:46     ` Jarkko Sakkinen
2019-11-27 22:57   ` Eric Biggers
2019-11-27 22:57     ` Eric Biggers
2019-12-11  9:50     ` Jarkko Sakkinen
2019-12-11  9:50       ` Jarkko Sakkinen
2019-12-11 18:00       ` Eric Biggers
2019-12-11 18:00         ` Eric Biggers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191119223130.228341-2-ebiggers@kernel.org \
    --to=ebiggers@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=jarkko.sakkinen@linux.intel.com \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-fscrypt@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.