diff --git a/lookaside_upload b/lookaside_upload index 911313b..e971af9 100755 --- a/lookaside_upload +++ b/lookaside_upload @@ -110,5 +110,13 @@ curl ${lookaside_baseurl}/sources/upload.cgi \ --progress-bar | tee /dev/null f_log "Returned value: $?" -f_log "Source should be available at ${lookaside_baseurl}/sources/${pkgname}/${branch}/${checksum}" +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 +