Added simple verification that source is reachable after upload

Signed-off-by: Fabian Arrotin <arrfab@centos.org>
This commit is contained in:
Fabian Arrotin 2019-11-13 12:29:09 +01:00
parent dc7af13b6c
commit c43fda67c5

View file

@ -110,5 +110,13 @@ curl ${lookaside_baseurl}/sources/upload.cgi \
--progress-bar | tee /dev/null
f_log "Returned value: $?"
f_log "Validating that source was correctly uploaded ...."
local_size=$(stat -c %s ${file})
remote_size=$(curl --silent -i --head ${lookaside_baseurl}/sources/${pkgname}/${branch}/${checksum}|grep "Content-Length"|cut -f 2 -d ':'|tr -d [:blank:]|tr -d '\r')
if [ "$local_size" -eq "$remote_size" ] ; then
f_log "Source should be available at ${lookaside_baseurl}/sources/${pkgname}/${branch}/${checksum}"
else
f_log "ERROR : it seems there is a mismatch with source size and remote file size"
fi