Blame 0010-use-var-val-rather-than-var-val.patch

Harald Hoyer fe48c9
From ffc68f357e95f7c8e9240e45dee2a46a3df567d7 Mon Sep 17 00:00:00 2001
Harald Hoyer fe48c9
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer fe48c9
Date: Thu, 22 Aug 2013 11:24:01 +0200
Harald Hoyer fe48c9
Subject: [PATCH] use ${var:+val} rather than ${var+val}
Harald Hoyer fe48c9
Harald Hoyer fe48c9
${var:+val} also catches var=""
Harald Hoyer fe48c9
---
Harald Hoyer fe48c9
 50-dracut.install                      |  2 +-
Harald Hoyer fe48c9
 dracut-functions.sh                    | 42 ++++++++++++++++------------------
Harald Hoyer fe48c9
 dracut.sh                              |  4 ++--
Harald Hoyer fe48c9
 modules.d/40network/dhclient-script.sh |  2 +-
Harald Hoyer fe48c9
 modules.d/40network/ifup.sh            |  4 ++--
Harald Hoyer fe48c9
 modules.d/95iscsi/iscsiroot.sh         | 14 ++++++------
Harald Hoyer fe48c9
 modules.d/95nbd/nbdroot.sh             |  4 ++--
Harald Hoyer fe48c9
 modules.d/95nfs/nfs-lib.sh             |  2 +-
Harald Hoyer fe48c9
 test/TEST-04-FULL-SYSTEMD/test.sh      |  2 +-
Harald Hoyer fe48c9
 test/TEST-50-MULTINIC/test.sh          |  2 +-
Harald Hoyer fe48c9
 10 files changed, 38 insertions(+), 40 deletions(-)
Harald Hoyer fe48c9
Harald Hoyer fe48c9
diff --git a/50-dracut.install b/50-dracut.install
Harald Hoyer fe48c9
index a0623a1..0282741 100755
Harald Hoyer fe48c9
--- a/50-dracut.install
Harald Hoyer fe48c9
+++ b/50-dracut.install
Harald Hoyer fe48c9
@@ -22,7 +22,7 @@ done
Harald Hoyer fe48c9
 ret=0
Harald Hoyer fe48c9
 case "$1" in
Harald Hoyer fe48c9
     add)
Harald Hoyer fe48c9
-	dracut ${noimageifnotneeded+--noimageifnotneeded} "$3"/initrd "$2"
Harald Hoyer fe48c9
+	dracut ${noimageifnotneeded:+--noimageifnotneeded} "$3"/initrd "$2"
Harald Hoyer fe48c9
         ret=$?
Harald Hoyer fe48c9
 	;;
Harald Hoyer fe48c9
     remove)
Harald Hoyer fe48c9
diff --git a/dracut-functions.sh b/dracut-functions.sh
Harald Hoyer fe48c9
index 8f32f07..8a1b73f 100755
Harald Hoyer fe48c9
--- a/dracut-functions.sh
Harald Hoyer fe48c9
+++ b/dracut-functions.sh
Harald Hoyer fe48c9
@@ -688,37 +688,37 @@ fi
Harald Hoyer fe48c9
 [[ $DRACUT_RESOLVE_LAZY ]] || export DRACUT_RESOLVE_DEPS=1
Harald Hoyer fe48c9
 inst_dir() {
Harald Hoyer fe48c9
     [[ -e ${initdir}/"$1" ]] && return 0  # already there
Harald Hoyer fe48c9
-    $DRACUT_INSTALL ${initdir+-D "$initdir"} -d "$@"
Harald Hoyer fe48c9
-    (($? != 0)) && derror $DRACUT_INSTALL ${initdir+-D "$initdir"} -d "$@" || :
Harald Hoyer fe48c9
+    $DRACUT_INSTALL ${initdir:+-D "$initdir"} -d "$@"
Harald Hoyer fe48c9
+    (($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} -d "$@" || :
Harald Hoyer fe48c9
 }
Harald Hoyer fe48c9
 
Harald Hoyer fe48c9
 inst() {
Harald Hoyer fe48c9
     [[ -e ${initdir}/"${2:-$1}" ]] && return 0  # already there
Harald Hoyer fe48c9
         #dinfo "$DRACUT_INSTALL -l $@"
Harald Hoyer fe48c9
-    $DRACUT_INSTALL ${initdir+-D "$initdir"} ${DRACUT_RESOLVE_DEPS+-l} ${DRACUT_FIPS_MODE+-H} "$@"
Harald Hoyer fe48c9
-    (($? != 0)) && derror $DRACUT_INSTALL ${initdir+-D "$initdir"} ${DRACUT_RESOLVE_DEPS+-l} ${DRACUT_FIPS_MODE+-H} "$@" || :
Harald Hoyer fe48c9
+    $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-H} "$@"
Harald Hoyer fe48c9
+    (($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-H} "$@" || :
Harald Hoyer fe48c9
 }
Harald Hoyer fe48c9
 
Harald Hoyer fe48c9
 inst_simple() {
Harald Hoyer fe48c9
     [[ -e ${initdir}/"${2:-$1}" ]] && return 0  # already there
Harald Hoyer fe48c9
     [[ -e $1 ]] || return 1  # no source
Harald Hoyer fe48c9
-    $DRACUT_INSTALL ${initdir+-D "$initdir"} "$@"
Harald Hoyer fe48c9
-    (($? != 0)) && derror $DRACUT_INSTALL ${initdir+-D "$initdir"} "$@" || :
Harald Hoyer fe48c9
+    $DRACUT_INSTALL ${initdir:+-D "$initdir"} "$@"
Harald Hoyer fe48c9
+    (($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} "$@" || :
Harald Hoyer fe48c9
 }
Harald Hoyer fe48c9
 
Harald Hoyer fe48c9
 inst_symlink() {
Harald Hoyer fe48c9
     [[ -e ${initdir}/"${2:-$1}" ]] && return 0  # already there
Harald Hoyer fe48c9
     [[ -L $1 ]] || return 1
Harald Hoyer fe48c9
-    $DRACUT_INSTALL ${initdir+-D "$initdir"} ${DRACUT_RESOLVE_DEPS+-l}  ${DRACUT_FIPS_MODE+-H} "$@"
Harald Hoyer fe48c9
-    (($? != 0)) && derror $DRACUT_INSTALL ${initdir+-D "$initdir"} ${DRACUT_RESOLVE_DEPS+-l}  ${DRACUT_FIPS_MODE+-H} "$@" || :
Harald Hoyer fe48c9
+    $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${DRACUT_RESOLVE_DEPS:+-l}  ${DRACUT_FIPS_MODE:+-H} "$@"
Harald Hoyer fe48c9
+    (($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${DRACUT_RESOLVE_DEPS:+-l}  ${DRACUT_FIPS_MODE:+-H} "$@" || :
Harald Hoyer fe48c9
 }
Harald Hoyer fe48c9
 
Harald Hoyer fe48c9
 inst_multiple() {
Harald Hoyer fe48c9
     local ret
Harald Hoyer fe48c9
         #dinfo "initdir=$initdir $DRACUT_INSTALL -l $@"
Harald Hoyer fe48c9
-    $DRACUT_INSTALL ${initdir+-D "$initdir"} -a ${DRACUT_RESOLVE_DEPS+-l}  ${DRACUT_FIPS_MODE+-H} "$@"
Harald Hoyer fe48c9
+    $DRACUT_INSTALL ${initdir:+-D "$initdir"} -a ${DRACUT_RESOLVE_DEPS:+-l}  ${DRACUT_FIPS_MODE:+-H} "$@"
Harald Hoyer fe48c9
     ret=$?
Harald Hoyer fe48c9
-    (($ret != 0)) && derror $DRACUT_INSTALL ${initdir+-D "$initdir"} -a ${DRACUT_RESOLVE_DEPS+-l}  ${DRACUT_FIPS_MODE+-H} "$@" || :
Harald Hoyer fe48c9
+    (($ret != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} -a ${DRACUT_RESOLVE_DEPS:+-l}  ${DRACUT_FIPS_MODE:+-H} "$@" || :
Harald Hoyer fe48c9
     return $ret
Harald Hoyer fe48c9
 }
Harald Hoyer fe48c9
 
Harald Hoyer fe48c9
@@ -729,18 +729,18 @@ dracut_install() {
Harald Hoyer fe48c9
 inst_library() {
Harald Hoyer fe48c9
     [[ -e ${initdir}/"${2:-$1}" ]] && return 0  # already there
Harald Hoyer fe48c9
     [[ -e $1 ]] || return 1  # no source
Harald Hoyer fe48c9
-    $DRACUT_INSTALL ${initdir+-D "$initdir"} ${DRACUT_RESOLVE_DEPS+-l}  ${DRACUT_FIPS_MODE+-H} "$@"
Harald Hoyer fe48c9
-    (($? != 0)) && derror $DRACUT_INSTALL ${initdir+-D "$initdir"} ${DRACUT_RESOLVE_DEPS+-l}  ${DRACUT_FIPS_MODE+-H} "$@" || :
Harald Hoyer fe48c9
+    $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${DRACUT_RESOLVE_DEPS:+-l}  ${DRACUT_FIPS_MODE:+-H} "$@"
Harald Hoyer fe48c9
+    (($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${DRACUT_RESOLVE_DEPS:+-l}  ${DRACUT_FIPS_MODE:+-H} "$@" || :
Harald Hoyer fe48c9
 }
Harald Hoyer fe48c9
 
Harald Hoyer fe48c9
 inst_binary() {
Harald Hoyer fe48c9
-    $DRACUT_INSTALL ${initdir+-D "$initdir"} ${DRACUT_RESOLVE_DEPS+-l}  ${DRACUT_FIPS_MODE+-H} "$@"
Harald Hoyer fe48c9
-    (($? != 0)) && derror $DRACUT_INSTALL ${initdir+-D "$initdir"} ${DRACUT_RESOLVE_DEPS+-l}  ${DRACUT_FIPS_MODE+-H} "$@" || :
Harald Hoyer fe48c9
+    $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${DRACUT_RESOLVE_DEPS:+-l}  ${DRACUT_FIPS_MODE:+-H} "$@"
Harald Hoyer fe48c9
+    (($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${DRACUT_RESOLVE_DEPS:+-l}  ${DRACUT_FIPS_MODE:+-H} "$@" || :
Harald Hoyer fe48c9
 }
Harald Hoyer fe48c9
 
Harald Hoyer fe48c9
 inst_script() {
Harald Hoyer fe48c9
-    $DRACUT_INSTALL ${initdir+-D "$initdir"} ${DRACUT_RESOLVE_DEPS+-l}  ${DRACUT_FIPS_MODE+-H} "$@"
Harald Hoyer fe48c9
-    (($? != 0)) && derror $DRACUT_INSTALL ${initdir+-D "$initdir"} ${DRACUT_RESOLVE_DEPS+-l}  ${DRACUT_FIPS_MODE+-H} "$@" || :
Harald Hoyer fe48c9
+    $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${DRACUT_RESOLVE_DEPS:+-l}  ${DRACUT_FIPS_MODE:+-H} "$@"
Harald Hoyer fe48c9
+    (($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${DRACUT_RESOLVE_DEPS:+-l}  ${DRACUT_FIPS_MODE:+-H} "$@" || :
Harald Hoyer fe48c9
 }
Harald Hoyer fe48c9
 
Harald Hoyer fe48c9
 # find symlinks linked to given library file
Harald Hoyer fe48c9
@@ -850,13 +850,11 @@ inst_rule_initqueue() {
Harald Hoyer fe48c9
 inst_rules() {
Harald Hoyer fe48c9
     local _target=/etc/udev/rules.d _rule _found
Harald Hoyer fe48c9
 
Harald Hoyer fe48c9
-    [[ $hostonly ]] || unset hostonly
Harald Hoyer fe48c9
-
Harald Hoyer fe48c9
     inst_dir "${udevdir}/rules.d"
Harald Hoyer fe48c9
     inst_dir "$_target"
Harald Hoyer fe48c9
     for _rule in "$@"; do
Harald Hoyer fe48c9
         if [ "${_rule#/}" = "$_rule" ]; then
Harald Hoyer fe48c9
-            for r in ${udevdir}/rules.d ${hostonly+/etc/udev/rules.d}; do
Harald Hoyer fe48c9
+            for r in ${udevdir}/rules.d ${hostonly:+/etc/udev/rules.d}; do
Harald Hoyer fe48c9
                 if [[ -e $r/$_rule ]]; then
Harald Hoyer fe48c9
                     _found="$r/$_rule"
Harald Hoyer fe48c9
                     inst_rule_programs "$_found"
Harald Hoyer fe48c9
@@ -1388,7 +1386,7 @@ dracut_kernel_post() {
Harald Hoyer fe48c9
     local _pid
Harald Hoyer fe48c9
 
Harald Hoyer fe48c9
     if [[ $DRACUT_KERNEL_LAZY_HASHDIR ]] && [[ -f "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist" ]]; then
Harald Hoyer fe48c9
-        xargs -r modprobe -a ${_moddirname+-d ${_moddirname}/} \
Harald Hoyer fe48c9
+        xargs -r modprobe -a ${_moddirname:+-d ${_moddirname}/} \
Harald Hoyer fe48c9
             --ignore-install --show-depends --set-version $kernel \
Harald Hoyer fe48c9
             < "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist" 2>/dev/null \
Harald Hoyer fe48c9
             | sort -u \
Harald Hoyer fe48c9
@@ -1399,7 +1397,7 @@ dracut_kernel_post() {
Harald Hoyer fe48c9
 
Harald Hoyer fe48c9
         (
Harald Hoyer fe48c9
             if [[ $DRACUT_INSTALL ]] && [[ -z $_moddirname ]]; then
Harald Hoyer fe48c9
-                xargs -r $DRACUT_INSTALL ${initdir+-D "$initdir"} -a < "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist.dep"
Harald Hoyer fe48c9
+                xargs -r $DRACUT_INSTALL ${initdir:+-D "$initdir"} -a < "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist.dep"
Harald Hoyer fe48c9
             else
Harald Hoyer fe48c9
                 while read _modpath; do
Harald Hoyer fe48c9
                     local _destpath=$_modpath
Harald Hoyer fe48c9
@@ -1418,7 +1416,7 @@ dracut_kernel_post() {
Harald Hoyer fe48c9
                 for _fwdir in $fw_dir; do
Harald Hoyer fe48c9
                     echo $_fwdir/$line;
Harald Hoyer fe48c9
                 done;
Harald Hoyer fe48c9
-            done | xargs -r $DRACUT_INSTALL ${initdir+-D "$initdir"} -a -o
Harald Hoyer fe48c9
+            done | xargs -r $DRACUT_INSTALL ${initdir:+-D "$initdir"} -a -o
Harald Hoyer fe48c9
         else
Harald Hoyer fe48c9
             for _fw in $(xargs -r modinfo -k $kernel -F firmware < "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist.dep"); do
Harald Hoyer fe48c9
                 for _fwdir in $fw_dir; do
Harald Hoyer fe48c9
diff --git a/dracut.sh b/dracut.sh
Harald Hoyer fe48c9
index 0c42958..7ad9d1e 100755
Harald Hoyer fe48c9
--- a/dracut.sh
Harald Hoyer fe48c9
+++ b/dracut.sh
Harald Hoyer fe48c9
@@ -729,7 +729,7 @@ fi
Harald Hoyer fe48c9
 
Harald Hoyer fe48c9
 if ! [[ $print_cmdline ]]; then
Harald Hoyer fe48c9
     inst /bin/sh
Harald Hoyer fe48c9
-    if ! $DRACUT_INSTALL ${initdir+-D "$initdir"} -R "$initdir/bin/sh" &>/dev/null; then
Harald Hoyer fe48c9
+    if ! $DRACUT_INSTALL ${initdir:+-D "$initdir"} -R "$initdir/bin/sh" &>/dev/null; then
Harald Hoyer fe48c9
         unset DRACUT_RESOLVE_LAZY
Harald Hoyer fe48c9
         export DRACUT_RESOLVE_DEPS=1
Harald Hoyer fe48c9
     fi
Harald Hoyer fe48c9
@@ -1184,7 +1184,7 @@ if [[ $kernel_only != yes ]]; then
Harald Hoyer fe48c9
         find "$initdir" -type f \
Harald Hoyer fe48c9
             '(' -perm -0100 -or -perm -0010 -or -perm -0001 ')' \
Harald Hoyer fe48c9
             -not -path '*.ko' -print0 \
Harald Hoyer fe48c9
-        | xargs -r -0 $DRACUT_INSTALL ${initdir+-D "$initdir"} -R ${DRACUT_FIPS_MODE+-H} --
Harald Hoyer fe48c9
+        | xargs -r -0 $DRACUT_INSTALL ${initdir:+-D "$initdir"} -R ${DRACUT_FIPS_MODE:+-H} --
Harald Hoyer fe48c9
         dinfo "*** Resolving executable dependencies done***"
Harald Hoyer fe48c9
     fi
Harald Hoyer fe48c9
 fi
Harald Hoyer fe48c9
diff --git a/modules.d/40network/dhclient-script.sh b/modules.d/40network/dhclient-script.sh
Harald Hoyer fe48c9
index f04b83d..07c3d9b 100755
Harald Hoyer fe48c9
--- a/modules.d/40network/dhclient-script.sh
Harald Hoyer fe48c9
+++ b/modules.d/40network/dhclient-script.sh
Harald Hoyer fe48c9
@@ -42,7 +42,7 @@ setup_interface() {
Harald Hoyer fe48c9
 
Harald Hoyer fe48c9
     # Note: hostname can be fqdn OR short hostname, so chop off any
Harald Hoyer fe48c9
     # trailing domain name and explicity add any domain if set.
Harald Hoyer fe48c9
-    [ -n "$hostname" ] && echo "echo ${hostname%.$domain}${domain+.$domain} > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
Harald Hoyer fe48c9
+    [ -n "$hostname" ] && echo "echo ${hostname%.$domain}${domain:+.$domain} > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
Harald Hoyer fe48c9
 }
Harald Hoyer fe48c9
 
Harald Hoyer fe48c9
 PATH=/usr/sbin:/usr/bin:/sbin:/bin
Harald Hoyer fe48c9
diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh
Harald Hoyer fe48c9
index 32f0ff2..f9e1669 100755
Harald Hoyer fe48c9
--- a/modules.d/40network/ifup.sh
Harald Hoyer fe48c9
+++ b/modules.d/40network/ifup.sh
Harald Hoyer fe48c9
@@ -124,10 +124,10 @@ do_static() {
Harald Hoyer fe48c9
     [ -n "$mtu" ] && ip link set mtu $mtu dev $netif
Harald Hoyer fe48c9
     if strstr $ip '*:*:*'; then
Harald Hoyer fe48c9
         # note no ip addr flush for ipv6
Harald Hoyer fe48c9
-        ip addr add $ip/$mask ${srv+peer $srv} dev $netif
Harald Hoyer fe48c9
+        ip addr add $ip/$mask ${srv:+peer $srv} dev $netif
Harald Hoyer fe48c9
     else
Harald Hoyer fe48c9
         ip addr flush dev $netif
Harald Hoyer fe48c9
-        ip addr add $ip/$mask ${srv+peer $srv} brd + dev $netif
Harald Hoyer fe48c9
+        ip addr add $ip/$mask ${srv:+peer $srv} brd + dev $netif
Harald Hoyer fe48c9
     fi
Harald Hoyer fe48c9
 
Harald Hoyer fe48c9
     [ -n "$gw" ] && echo ip route add default via $gw dev $netif > /tmp/net.$netif.gw
Harald Hoyer fe48c9
diff --git a/modules.d/95iscsi/iscsiroot.sh b/modules.d/95iscsi/iscsiroot.sh
Harald Hoyer fe48c9
index 0c04219..5181f52 100755
Harald Hoyer fe48c9
--- a/modules.d/95iscsi/iscsiroot.sh
Harald Hoyer fe48c9
+++ b/modules.d/95iscsi/iscsiroot.sh
Harald Hoyer fe48c9
@@ -96,7 +96,7 @@ handle_netroot()
Harald Hoyer fe48c9
 # XXX is this needed?
Harald Hoyer fe48c9
     getarg ro && iscsirw=ro
Harald Hoyer fe48c9
     getarg rw && iscsirw=rw
Harald Hoyer fe48c9
-    fsopts=${fsopts+$fsopts,}${iscsirw}
Harald Hoyer fe48c9
+    fsopts=${fsopts:+$fsopts,}${iscsirw}
Harald Hoyer fe48c9
 
Harald Hoyer fe48c9
     if [ -z $iscsi_initiator ]; then
Harald Hoyer fe48c9
     # XXX Where are these from?
Harald Hoyer fe48c9
@@ -155,12 +155,12 @@ handle_netroot()
Harald Hoyer fe48c9
     iscsistart -i $iscsi_initiator -t $iscsi_target_name        \
Harald Hoyer fe48c9
         -g $iscsi_target_group -a $iscsi_target_ip      \
Harald Hoyer fe48c9
         -p $iscsi_target_port \
Harald Hoyer fe48c9
-        ${iscsi_username+-u $iscsi_username} \
Harald Hoyer fe48c9
-        ${iscsi_password+-w $iscsi_password} \
Harald Hoyer fe48c9
-        ${iscsi_in_username+-U $iscsi_in_username} \
Harald Hoyer fe48c9
-        ${iscsi_in_password+-W $iscsi_in_password} \
Harald Hoyer fe48c9
-	${iscsi_iface_name+--param iface.iscsi_ifacename=$iscsi_iface_name} \
Harald Hoyer fe48c9
-	${iscsi_netdev_name+--param iface.net_ifacename=$iscsi_netdev_name} \
Harald Hoyer fe48c9
+        ${iscsi_username:+-u $iscsi_username} \
Harald Hoyer fe48c9
+        ${iscsi_password:+-w $iscsi_password} \
Harald Hoyer fe48c9
+        ${iscsi_in_username:+-U $iscsi_in_username} \
Harald Hoyer fe48c9
+        ${iscsi_in_password:+-W $iscsi_in_password} \
Harald Hoyer fe48c9
+	${iscsi_iface_name:+--param iface.iscsi_ifacename=$iscsi_iface_name} \
Harald Hoyer fe48c9
+	${iscsi_netdev_name:+--param iface.net_ifacename=$iscsi_netdev_name} \
Harald Hoyer fe48c9
         ${iscsi_param} \
Harald Hoyer fe48c9
 	|| :
Harald Hoyer fe48c9
 
Harald Hoyer fe48c9
diff --git a/modules.d/95nbd/nbdroot.sh b/modules.d/95nbd/nbdroot.sh
Harald Hoyer fe48c9
index 1a1ed54..823da0e 100755
Harald Hoyer fe48c9
--- a/modules.d/95nbd/nbdroot.sh
Harald Hoyer fe48c9
+++ b/modules.d/95nbd/nbdroot.sh
Harald Hoyer fe48c9
@@ -76,12 +76,12 @@ while [ -n "$nbdflags" ]; do
Harald Hoyer fe48c9
         nbdrw=$f
Harald Hoyer fe48c9
         continue
Harald Hoyer fe48c9
     fi
Harald Hoyer fe48c9
-    fsopts=${fsopts+$fsopts,}$f
Harald Hoyer fe48c9
+    fsopts=${fsopts:+$fsopts,}$f
Harald Hoyer fe48c9
 done
Harald Hoyer fe48c9
 
Harald Hoyer fe48c9
 getarg ro && nbdrw=ro
Harald Hoyer fe48c9
 getarg rw && nbdrw=rw
Harald Hoyer fe48c9
-fsopts=${fsopts+$fsopts,}${nbdrw}
Harald Hoyer fe48c9
+fsopts=${fsopts:+$fsopts,}${nbdrw}
Harald Hoyer fe48c9
 
Harald Hoyer fe48c9
 # XXX better way to wait for the device to be made?
Harald Hoyer fe48c9
 i=0
Harald Hoyer fe48c9
diff --git a/modules.d/95nfs/nfs-lib.sh b/modules.d/95nfs/nfs-lib.sh
Harald Hoyer fe48c9
index 628996c..f5fc56d 100755
Harald Hoyer fe48c9
--- a/modules.d/95nfs/nfs-lib.sh
Harald Hoyer fe48c9
+++ b/modules.d/95nfs/nfs-lib.sh
Harald Hoyer fe48c9
@@ -128,7 +128,7 @@ mount_nfs() {
Harald Hoyer fe48c9
     nfs_to_var $nfsroot $netif
Harald Hoyer fe48c9
     munge_nfs_options
Harald Hoyer fe48c9
     if [ "$nfs" = "nfs4" ]; then
Harald Hoyer fe48c9
-        options=$options${nfslock+,$nfslock}
Harald Hoyer fe48c9
+        options=$options${nfslock:+,$nfslock}
Harald Hoyer fe48c9
     else
Harald Hoyer fe48c9
         # NFSv{2,3} doesn't support using locks as it requires a helper to
Harald Hoyer fe48c9
         # transfer the rpcbind state to the new root
Harald Hoyer fe48c9
diff --git a/test/TEST-04-FULL-SYSTEMD/test.sh b/test/TEST-04-FULL-SYSTEMD/test.sh
Harald Hoyer fe48c9
index d4998d8..3eeb840 100755
Harald Hoyer fe48c9
--- a/test/TEST-04-FULL-SYSTEMD/test.sh
Harald Hoyer fe48c9
+++ b/test/TEST-04-FULL-SYSTEMD/test.sh
Harald Hoyer fe48c9
@@ -82,7 +82,7 @@ test_setup() {
Harald Hoyer fe48c9
 	inst "$basedir/modules.d/40network/ifup.sh" "/sbin/ifup"
Harald Hoyer fe48c9
 	inst_multiple grep
Harald Hoyer fe48c9
         inst_simple ./fstab /etc/fstab
Harald Hoyer fe48c9
-        rpm -ql systemd | xargs -r $DRACUT_INSTALL ${initdir+-D "$initdir"} -o -a -l
Harald Hoyer fe48c9
+        rpm -ql systemd | xargs -r $DRACUT_INSTALL ${initdir:+-D "$initdir"} -o -a -l
Harald Hoyer fe48c9
         inst /lib/systemd/system/systemd-remount-fs.service
Harald Hoyer fe48c9
         inst /lib/systemd/systemd-remount-fs
Harald Hoyer fe48c9
         inst /lib/systemd/system/systemd-journal-flush.service
Harald Hoyer fe48c9
diff --git a/test/TEST-50-MULTINIC/test.sh b/test/TEST-50-MULTINIC/test.sh
Harald Hoyer fe48c9
index b616e6b..7c9d544 100755
Harald Hoyer fe48c9
--- a/test/TEST-50-MULTINIC/test.sh
Harald Hoyer fe48c9
+++ b/test/TEST-50-MULTINIC/test.sh
Harald Hoyer fe48c9
@@ -20,7 +20,7 @@ run_server() {
Harald Hoyer fe48c9
         -display none \
Harald Hoyer fe48c9
         -net socket,listen=127.0.0.1:12350 \
Harald Hoyer fe48c9
         -net nic,macaddr=52:54:01:12:34:56,model=e1000 \
Harald Hoyer fe48c9
-        ${SERIAL+-serial "$SERIAL"} \
Harald Hoyer fe48c9
+        ${SERIAL:+-serial "$SERIAL"} \
Harald Hoyer fe48c9
         -watchdog i6300esb -watchdog-action poweroff \
Harald Hoyer fe48c9
         -kernel /boot/vmlinuz-"$KVERSION" \
Harald Hoyer fe48c9
         -append "loglevel=7 root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0" \