]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut: fix arithemtic ${#VAR[@]} tests
authorMichal Soltys <soltys@ziu.info>
Sun, 20 Mar 2011 19:56:17 +0000 (20:56 +0100)
committerHarald Hoyer <harald@redhat.com>
Wed, 23 Mar 2011 10:25:55 +0000 (11:25 +0100)
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@ziu.info>
dracut

diff --git a/dracut b/dracut
index 0c1cc147ea09d88bab7151169c8f628eecc2e635..dd32b88d467d81bc8594456f725b16b715af1fc6 100755 (executable)
--- 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 "