Skip to content

Commit

Permalink
Improve vmdist-mount-option parsing
Browse files Browse the repository at this point in the history
No need to spawn a sed command to remove the quotes. Also clean
up the comment.
  • Loading branch information
mlschroe committed Feb 9, 2017
1 parent f48f313 commit 1ca6450
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions build-vm
Expand Up @@ -220,10 +220,14 @@ vm_parse_options() {
shift
;;
-vm-disk-mount-options|-vmdisk-mount-options)
needarg
# options needs to be quoted to handle argument which might start with "-o ..."
VMDISK_MOUNT_OPTIONS=$(echo $ARG | sed 's/^\"\(.*\)\"$/\1/g')
shift
needarg
VMDISK_MOUNT_OPTIONS="$ARG"
shift
# silly compat code for old bs_worker versions...
if test "$ARG" != "${ARG#\"}" -a "$ARG" != "${ARG%\"}" ; then
VMDISK_MOUNT_OPTIONS="${VMDISK_MOUNT_OPTIONS#\"}"
VMDISK_MOUNT_OPTIONS="${VMDISK_MOUNT_OPTIONS%\"}"
fi
;;
-vm-disk-clean|-vmdisk-clean)
# delete old root/swap to get rid of the old blocks
Expand Down

0 comments on commit 1ca6450

Please sign in to comment.