Skip to content

Commit

Permalink
Fixed iocage import (#365)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
dsdickinson authored and Brandon Schneider committed Jun 17, 2016
1 parent a2d9c47 commit 3963ccc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/ioc-image
Original file line number Diff line number Diff line change
Expand Up @@ -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!"
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 3963ccc

Please sign in to comment.