tFix path to base-cloud.qcow2 and use [[ instead of [ for test. - libdevuansdk - common library for devuan's simple distro kits HTML git clone https://git.parazyd.org/libdevuansdk DIR Log DIR Files DIR Refs DIR Submodules DIR README DIR LICENSE --- DIR commit c1c6fc8c0686ecdb30da61775f9015798133fb15 DIR parent 589d62ca0eb8d72149d3c8a54c310a5255ad47dd HTML Author: parazyd <parazyd@dyne.org> Date: Mon, 8 Oct 2018 15:45:37 +0200 Fix path to base-cloud.qcow2 and use [[ instead of [ for test. Diffstat: M zlibs/vm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) --- DIR diff --git a/zlibs/vm b/zlibs/vm t@@ -174,8 +174,8 @@ vm_init_cloud() { req=(workdir strapdir imageformat loopdevice) ckreq || return 1 - [ -n "$makecloud" ] || return - [ "$imageformat" = qcow2 ] || { + [[ -n "$makecloud" ]] || return + [[ "$imageformat" = qcow2 ]] || { die "imageformat is not qcow2" zerr } t@@ -187,6 +187,7 @@ vm_init_cloud() { notice "Connecting qemu-nbd and mounting" sudo mkdir -p "$strapdir" sudo qemu-nbd --connect=${loopdevice} base-cloud.qcow2 || zerr + silly sleep 1 sudo mount ${loopdevice}p1 $strapdir || zerr notice "Installing cloud-init" t@@ -213,8 +214,9 @@ vm_pack_dist() { mv $workdir/base.${imageformat} $R/dist/${vm_name}.${imageformat} cp $workdir/base.vdi $R/dist/${vm_name}.vdi - [ -n "$makecloud" ] && \ - mv base-cloud.${imageformat} $R/dist/${vm_name}-cloud.${imageformat} + [[ -n "$makecloud" ]] && \ + mv $workdir/base-cloud.${imageformat} \ + $R/dist/${vm_name}-cloud.${imageformat} act "calculating sha256 sums..." silly t@@ -224,7 +226,7 @@ vm_pack_dist() { $R/dist/${vm_name}.${imageformat}.sha sha256sum $R/dist/${vm_name}.vdi > \ $R/dist/${vm_name}.vdi.sha - [ -n "$makecloud" ] && \ + [[ -n "$makecloud" ]] && \ sha256sum $R/dist/${vm_name}-cloud.${imageformat} > \ $R/dist/${vm_name}-cloud.${imageformat}.sha