[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/2] iotests: Drop readarray from _do_filter_img_create
From: |
Alex Bennée |
Subject: |
Re: [PATCH 1/2] iotests: Drop readarray from _do_filter_img_create |
Date: |
Fri, 10 Jul 2020 22:02:30 +0100 |
User-agent: |
mu4e 1.5.4; emacs 28.0.50 |
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