Check cached file size when downloading an url

In some cases cache-url fails when downloading an image and leaves
an empty cached file. qemu-img then fails with "Wrong medium type"
error on next run.

Change-Id: I23e91c52094f27248cf8452f192ad63646051190
This commit is contained in:
Jan Provaznik 2013-09-16 13:27:03 -07:00
parent 9ba761ef27
commit 9a5e14cbc5

View File

@ -27,7 +27,7 @@ dest=$2
mkdir -p $(dirname $dest)
tmp=$(mktemp $(dirname $dest)/.download.XXXXXXXX)
if [ -f $dest ] ; then
if [ -f $dest -a -s $dest ] ; then
time_cond="-z $dest"
success="Server copy has changed. Using server version of $url"
else