confz

git mirror of https://ccx.te2000.cz/bzr/confz
git clone https://ccx.te2000.cz/git/confz
Log | Files | Refs

commit 7222c1e0a2171bc457b9049e64b7e59f850e38e2
parent f9fcde5e2f85e20c42633abd22f50458b9966530
Author: Jan Pobrislo <ccx@webprojekty.cz>
Date:   Mon,  4 Jan 2016 17:05:39 +0100

fix quoting for arguments that are expanded using ${(z)foo}

Diffstat:
Mzsh-functions/confz_fs_init | 12++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/zsh-functions/confz_fs_init b/zsh-functions/confz_fs_init @@ -178,7 +178,7 @@ confz_gpt_partition_check() { (($+vars[align])) && do_command+=( align-check $vars[align] $vars[number] ) - (($+vars[options])) && for option in ${(z)vars[options]}; do + (($+vars[options])) && for option in ${=vars[options]}; do do_command+=( set $vars[number] $option on ) done return 1 @@ -216,7 +216,7 @@ confz_primary_partition_check() { (($+vars[align])) && do_command+=( align-check $vars[align] $vars[number] ) - (($+vars[options])) && for option in ${(z)vars[options]}; do + (($+vars[options])) && for option in ${=vars[options]}; do do_command+=( set $vars[number] $option on ) done return 1 @@ -284,7 +284,7 @@ confz_mdraid_check() { defvar metadata default defvar bitmap none - devices=( ${(z)vars[raid_devices]} ) + devices=( "${(Q@)${(z)vars[raid_devices]}}" ) level_map=( linear linear @@ -395,7 +395,7 @@ confz_volume_group_check() { checkvars vg_devices - vg_devices=( ${(z)vars[vg_devices]} ) + vg_devices=( "${(Q@)${(z)vars[vg_devices]}}" ) for device in $vg_devices; do require physical_volume device=$device done @@ -453,8 +453,8 @@ confz_filesystem_check() { die "$0: not a block device: ${(qqq)vars[device]}" do_command=( - mkfs -t ${vars[filesystem]} -L ${vars[label]} ${(z)vars[mkfs_opts]} - ${vars[device]} + mkfs -t ${vars[filesystem]} -L ${vars[label]} + "${(Q@)${(z)vars[mkfs_opts]}}" ${vars[device]} ) local tries blk_out DEVNAME LABEL UUID TYPE SEC_TYPE PARTLABEL PARTUUID