From: Harald Hoyer <harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Michal Soltys <soltys-R61QfzASbfY@public.gmane.org>
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] dracut: fix arithemtic ${#VAR[@]} tests
Date: Wed, 23 Mar 2011 11:23:20 +0100 [thread overview]
Message-ID: <4D89CA18.2030807@redhat.com> (raw)
In-Reply-To: <1300650977-29456-1-git-send-email-soltys-R61QfzASbfY@public.gmane.org>
Am 20.03.2011 20:56, schrieb Michal Soltys:
> This patch fixes a handful of ${#VAR[@]} tests, which can't be evaluated
> as text expressions - the results is always true in such case, because
> "0" is non-empty string.
>
> Signed-off-by: Michal Soltys <soltys-R61QfzASbfY@public.gmane.org>
> ---
> dracut | 14 +++++++-------
> 1 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/dracut b/dracut
> index 0c1cc14..dd32b88 100755
> --- a/dracut
> +++ b/dracut
> @@ -276,48 +276,48 @@ if [[ $confdir && -d $confdir ]]; then
> fi
>
> # these optins add to the stuff in the config file
> -if [[ ${#add_dracutmodules_l[@]} ]]; then
> +if (( ${#add_dracutmodules_l[@]} )); then
> while pop add_dracutmodules_l val; do
> add_dracutmodules+=" $val "
> done
> fi
>
> -if [[ ${#add_drivers_l[@]} ]]; then
> +if (( ${#add_drivers_l[@]} )); then
> while pop add_drivers_l val; do
> add_drivers+=" $val "
> done
> fi
>
> # these options override the stuff in the config file
> -if [[ ${#dracutmodules_l[@]} ]]; then
> +if (( ${#dracutmodules_l[@]} )); then
> dracutmodules=''
> while pop dracutmodules_l val; do
> dracutmodules+="$val "
> done
> fi
>
> -if [[ ${#omit_dracutmodules_l[@]} ]]; then
> +if (( ${#omit_dracutmodules_l[@]} )); then
> omit_dracutmodules=''
> while pop omit_dracutmodules_l val; do
> omit_dracutmodules+="$val "
> done
> fi
>
> -if [[ ${#drivers_l[@]} ]]; then
> +if (( ${#drivers_l[@]} )); then
> drivers=''
> while pop drivers_l val; do
> drivers+="$val "
> done
> fi
>
> -if [[ ${#filesystems_l[@]} ]]; then
> +if (( ${#filesystems_l[@]} )); then
> filesystems=''
> while pop filesystems_l val; do
> filesystems+="$val "
> done
> fi
>
> -if [[ ${#fw_dir_l[@]} ]]; then
> +if (( ${#fw_dir_l[@]} )); then
> fw_dir=''
> while pop fw_dir_l val; do
> fw_dir+="$val "
Thanks!
prev parent reply other threads:[~2011-03-23 10:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-20 19:56 [PATCH] dracut: fix arithemtic ${#VAR[@]} tests Michal Soltys
[not found] ` <1300650977-29456-1-git-send-email-soltys-R61QfzASbfY@public.gmane.org>
2011-03-23 10:23 ` Harald Hoyer [this message]
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=4D89CA18.2030807@redhat.com \
--to=harald-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=soltys-R61QfzASbfY@public.gmane.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.