Commit 8d8927ab authored by Nikos Skalkotos's avatar Nikos Skalkotos

Replace name in md5sum file with the image name

snf-image-update-helper will check the MD5 sum of the downloaded helper
image file against the one found inside the downloaded .md5sum file.
Before doing this, replace the name found inside the .md5sum file with
the one of the downloaded image. They may be different due to the fact
that curl will construct the file name from the URL when downloading.
Till now, we used to put the name of the cdn.dev.grnet.gr URL inside the
md5sum file instead of the actual one.
parent cf052a56
......@@ -137,6 +137,16 @@ if [ "x$NO_CHECKSUM" != "xyes" ]; then
exit 1
fi
# The filename listed inside the md5sum file may be different than the one
# of the image we have downloaded. This is due to redirections and the fact
# that we are not using --remote-header-name which would use the
# server-specified Content-Disposition filename instead of extracting a
# filename from the URL. This option is not used because some versions of
# curl will not attempt to decode %-sequences which may lead to unexpected
# filenames. It's better if we just replace the filename inside the md5sum
# file with the one we know.
sed -i 's/ .\+$/'" $IMAGE"'/' "$IMAGE_DIR/$IMAGE.md5sum"
$MD5SUM -c "$IMAGE_DIR/$IMAGE.md5sum"
fi
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment