qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Max Reitz <mreitz@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>, John Snow <jsnow@redhat.com>,
	qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [PATCH 1/2] iotests: Drop readarray from _do_filter_img_create
Date: Fri, 10 Jul 2020 22:02:30 +0100	[thread overview]
Message-ID: <87imevjd7d.fsf@linaro.org> (raw)
In-Reply-To: <20200710163253.381630-2-mreitz@redhat.com>


Max Reitz <mreitz@redhat.com> writes:

> Some systems where we run tests on do not have a 4.x bash, so they do
> not have readarray.  While it looked a bit nicer than messing with
> `head` and `tail`, we do not really need it, so we might as well not use
> it.

I've fixed the cirrus build failure by brew installing a more recent
bash. However if we prefer we could do this.

>
> Reported-by: Claudio Fontana <cfontana@suse.de>
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
>  tests/qemu-iotests/common.filter | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.filter
> index 3833206327..345c3ca03e 100644
> --- a/tests/qemu-iotests/common.filter
> +++ b/tests/qemu-iotests/common.filter
> @@ -138,13 +138,13 @@ _do_filter_img_create()
>      # Split the line into the pre-options part ($filename_part, which
>      # precedes ", fmt=") and the options part ($options, which starts
>      # with "fmt=")
> -    # (And just echo everything before the first "^Formatting")
> -    readarray formatting_line < <($SED -e 's/, fmt=/\n/')
> +    read formatting_line
>  
> -    filename_part=${formatting_line[0]}
> -    unset formatting_line[0]
> +    # Split line at the first ", fmt="
> +    formatting_line=$(echo "$formatting_line" | $SED -e 's/, fmt=/\nfmt=/')
>  
> -    options="fmt=${formatting_line[@]}"
> +    filename_part=$(echo "$formatting_line" | head -n 1)
> +    options=$(echo "$formatting_line" | tail -n +2)
>  
>      # Set grep_data_file to '\|data_file' to keep it; make it empty
>      # to drop it.


-- 
Alex Bennée


  parent reply	other threads:[~2020-07-10 21:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-10 16:32 [PATCH 0/2] iotests: More _filter_img_create fixes Max Reitz
2020-07-10 16:32 ` [PATCH 1/2] iotests: Drop readarray from _do_filter_img_create Max Reitz
2020-07-10 16:39   ` Eric Blake
2020-07-10 21:02   ` Alex Bennée [this message]
2020-07-10 16:32 ` [PATCH 2/2] iotests: Set LC_ALL=C for sort Max Reitz
2020-07-10 16:43   ` Eric Blake
2020-07-11  8:57   ` Alex Bennée
2020-07-13  7:55     ` Max Reitz
2020-07-10 17:18 ` [PATCH 0/2] iotests: More _filter_img_create fixes John Snow
2020-07-13  6:19   ` Max Reitz

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=87imevjd7d.fsf@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).