From 3963cccb78ed57ef167c02193a6fc070a99069b1 Mon Sep 17 00:00:00 2001 From: Steve Dickinson Date: Fri, 17 Jun 2016 00:36:09 -0400 Subject: [PATCH] Fixed iocage import (#365) * Fixed "iocage import" so it will not hang when importing exported jails. It was trying to do a sha256 checksum on /iocage/package files that do not exist. When exporting jails, only /iocage/images files get created. * Fixed spacing. --- lib/ioc-image | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ioc-image b/lib/ioc-image index 89d95abe..b0c5163f 100644 --- a/lib/ioc-image +++ b/lib/ioc-image @@ -111,10 +111,6 @@ __import () { _icount="$(echo $_image|wc -w)" _pcksum="$(find $iocroot/packages/ -name $_name\*.sha256)" _icksum="$(find $iocroot/images/ -name $_name\*.sha256)" - _new_cksum="$(sha256 -q $_package)" - _old_cksum="$(cat $_pcksum)" - _uuid="$(__create_jail create | grep uuid | cut -f2 -d=)" - _mountpoint="$(__get_jail_prop mountpoint $_uuid)" if [ -z $_name ] ; then echo " ERROR: Missing package UUID!" @@ -145,6 +141,10 @@ __import () { exit 1 fi + _new_cksum="$(sha256 -q $_package)" + _old_cksum="$(cat $_pcksum)" + _uuid="$(__create_jail create | grep uuid | cut -f2 -d=)" + _mountpoint="$(__get_jail_prop mountpoint $_uuid)" if [ $_new_cksum != $_old_cksum ] ; then echo " ERROR: Checksum mismatch. Exiting"