All of lore.kernel.org
 help / color / mirror / Atom feed
From: fdmanana@kernel.org
To: fstests@vger.kernel.org
Cc: linux-btrfs@vger.kernel.org, Filipe Manana <fdmanana@suse.com>
Subject: [PATCH] btrfs: fix grep warning at _require_btrfs_mkfs_uuid_option()
Date: Wed,  6 Mar 2024 15:01:57 +0000	[thread overview]
Message-ID: <ef2df19486ef71adccd14b3df0bf475ecc7f3b38.1709737287.git.fdmanana@suse.com> (raw)

From: Filipe Manana <fdmanana@suse.com>

When running _require_btrfs_mkfs_uuid_option(), some grep versions
complain about escaping the dash characters and make the tests that
use this function fail like this:

  btrfs/313       2s - output mismatch (see /root/fstests/results//btrfs_normal/btrfs/313.out.bad)
      --- tests/btrfs/313.out	2024-03-05 18:48:34.929372495 +0000
      +++ /root/fstests/results//btrfs_normal/btrfs/313.out.bad	2024-03-05 20:52:27.745166101 +0000
      @@ -1,5 +1,8 @@
       QA output created by 313
       ---- clone_uuids_verify_tempfsid ----
      +grep: warning: stray \ before -
      +grep: warning: stray \ before -
      +grep: warning: stray \ before -
       Mounting original device
       On disk fsid:		FSID
      ...
      (Run 'diff -u /root/fstests/tests/btrfs/313.out /root/fstests/results//btrfs_normal/btrfs/313.out.bad'  to see the entire diff)
  btrfs/314       3s - output mismatch (see /root/fstests/results//btrfs_normal/btrfs/314.out.bad)
      --- tests/btrfs/314.out	2024-03-05 18:48:34.929372495 +0000
      +++ /root/fstests/results//btrfs_normal/btrfs/314.out.bad	2024-03-05 20:52:32.880237216 +0000
      @@ -1,6 +1,9 @@
       QA output created by 314

       From non-tempfsid SCRATCH_MNT to tempfsid TEST_DIR/314/tempfsid_mnt
      +grep: warning: stray \ before -
      +grep: warning: stray \ before -
      +grep: warning: stray \ before -
       wrote 9000/9000 bytes at offset 0
      ...

So fix this by not escaping anymore the dashes and using the -- separator
before the regex pattern parameter.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
---
 common/btrfs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/btrfs b/common/btrfs
index 3eb2a91b..aa344706 100644
--- a/common/btrfs
+++ b/common/btrfs
@@ -93,7 +93,7 @@ _require_btrfs_mkfs_uuid_option()
 	local cnt
 
 	cnt=$($MKFS_BTRFS_PROG --help 2>&1 | \
-				grep -E --count "\-\-uuid|\-\-device-uuid")
+				grep -E --count -- "--uuid|--device-uuid")
 	if [ $cnt != 2 ]; then
 		_notrun "Require $MKFS_BTRFS_PROG with --uuid and --device-uuid options"
 	fi
-- 
2.43.0


             reply	other threads:[~2024-03-06 15:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-06 15:01 fdmanana [this message]
2024-03-06 22:59 ` [PATCH] btrfs: fix grep warning at _require_btrfs_mkfs_uuid_option() David Disseldorp
2024-03-07  6:17 ` Anand Jain

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=ef2df19486ef71adccd14b3df0bf475ecc7f3b38.1709737287.git.fdmanana@suse.com \
    --to=fdmanana@kernel.org \
    --cc=fdmanana@suse.com \
    --cc=fstests@vger.kernel.org \
    --cc=linux-btrfs@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.