From c43fda67c58cd4aacc7faee5b035030917b80692 Mon Sep 17 00:00:00 2001 From: Fabian Arrotin Date: Nov 13 2019 11:29:09 +0000 Subject: Added simple verification that source is reachable after upload Signed-off-by: Fabian Arrotin --- 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 +